Commit graph

23 commits

Author SHA1 Message Date
Jiyong Park
6c8e9f4b94 Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same ndk backend.

Bug: 161456198
Test: m
Merged-In: Ifadc89ec1cdb32dc39d5639665167c7bae336836
Change-Id: I99947e7fc58b5f6ab7d75f2af63b6bf9384917c3
2021-08-09 09:06:11 +09:00
Kalesh Singh
b64a38eee2 libpower: Use AIDL suspend HAL
Use the system susepnd AIDL hal for requesting wakelocks from libpower
or libhardware_legacy.

Bug: 170260236
Test: boot test on cf (suspend blocker works).
Test: libpower_test
Test: block_suspend
Change-Id: I8fc345c33fb893ca11603826b0e993ca908d5b20
2021-07-22 19:57:05 +00:00
Bob Badour
9380e9875c [LSC] Add LOCAL_LICENSE_KINDS to hardware/libhardware_legacy
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  audio/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id879ff71929846da71ae2df96ab748a4ad464d82
2021-02-12 16:32:13 -08:00
Michael Sun
2ab27a5e1e Update to use new android.system.suspend.control AIDL interface
The suspend_control_aidl_interface is updated, renamed, and splitted
into android.system.suspend.control and
android.system.suspend.control.internal. Update to use the correct
interfaces.

Test: atest libpower_test
Bug: 171598743
Change-Id: I707f5cb868e6756147587e0e097e77ec50995bd4
2020-11-03 04:34:38 +00:00
Tri Vo
032365882b block_suspend: test util to block suspend from shell
Bug: 143284916
Test: ./block_suspend; dumpsys suspend_control shows that wakelocks are
created as expected
Change-Id: Ifacb4f476632e0c36f7ec4f59164f91e89faf1f1
2019-11-11 12:32:59 -08:00
Tri Vo
934f175a42 libpower: RAII wake lock implementation
Main motivation is to prevent wake lock leaks, e.g. b/133175847.

Changing power.h header breaks downstream vendor code that does C
linkage to that header b/135730848. Introduce new wakelock.h header.

Bug: 133175847
Test: boot blueline
Test: device suspends if left alone
Change-Id: I477123938ab20e954ce4d55b8588c0a116ed3882
2019-06-26 13:01:39 -07:00
Ruslan Tkhakokhov
acf23a23e7 Merged-In Revert "libpower: RAII wake lock implementation"
This reverts commit 23009bb199.

Reason for revert: Breaks the build

Change-Id: I347928c4d444f4b1ce9d79f855c171626c0214c0
2019-06-21 10:32:57 +00:00
Tri Vo
23009bb199 libpower: RAII wake lock implementation
Bug: 133175847
Test: boot blueline
Test: device suspends if left alone
Change-Id: I5a63fedabb18a9dcd510ca76303f54ec6c0b7f8c
2019-06-20 09:02:16 -07:00
Tri Vo
54ecb7ea67 libpower_test: require root on test device
And promote the test back to presubmit

Fixes: 134078730
Test: libpower_test
Change-Id: I2773bf57698460d98fbeba79659724b0ef75eaf3
2019-06-15 13:58:06 -07:00
Jooyung Han
53a4f1a31f Revert "Mark libhardware_legacy as double_loadable"
This reverts commit 3ec8dc636a.

Reason for revert: libhardware_legacy is no longer used by libmediandk(aosp/915075)

Change-Id: I74accc24cf20dae40c29a3b1a2fcd985346143cb
2019-03-11 14:11:02 +00:00
Jooyung Han
3ec8dc636a Mark libhardware_legacy as double_loadable
libhardware_legacy is a VNDK lib and also used by LLNDK(libmediandk)
which means this lib can be double-loaded.

deps:
 - libmediandk -> libmedia_jni -> libandroid_runtime -> libhardware_legacy

Bug: 121280180
Test: m -j
Change-Id: I169e6fe520edb4a6961a6452b22b49b9bfbdf823
2019-02-08 11:44:08 +09:00
Tri Vo
850ab7e2a0 libpower: add TEST_MAPPING
Bug: n/a
Test: presubmit
Change-Id: Ib2505acb33871eb920c9ed7d62cabd6ad7e36839
2019-02-03 18:18:23 -08:00
Tri Vo
ca0b45a15e Handle concurrent exit and wake lock acquisition.
We use "-Wexit-time-destructors" and "-fno-c++-static-destructors" flags
to make sure that no static variables are destroyed at exit time.

We do this to avoid the race condition between process exit and use of
static vars when calling acquire/release_wake_lock().

Bug: 117575503
Test: libpower_test
Change-Id: I16acfeb2412685e376d8bd1069c86f60f56d215a
2018-11-28 16:04:12 -08:00
Tri Vo
18177506a7 libpower: add stress test
Test: libpower_test
Change-Id: I971e9c792d1d44a7c11b746fea880fdf28015753
2018-10-22 14:03:54 -07:00
Tri Vo
e0a9c90bf5 libpower: acquire wake locks from SystemSuspend service.
This change routes libpower and libhardware_legacy to SystemSuspend service for
wake locks instead of /sys/power/wake_[un]lock.

Bug: 78888165
Bug: 115946999
Test: /sys/kernel/debug/suspend_stats shows that device suspends if left alone
Change-Id: Id4d392e13d06be6d86e3112dedeb6a57bb24c06f
2018-10-05 17:45:00 -07:00
Chih-Hung Hsieh
3ba7298e95 Use -Werror in hardware/libhardware_legacy
* Remove unused local variable or suppress the warning.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I4d7b4f2e9e7e6c60d8bfc209f47e6f1d33720165
2017-10-03 13:38:46 -07:00
Justin Yun
39b86dd6ba Mark the module as VNDK or VNDK-SP in Android.bp
As a VNDK/VNDK-SP module, Android.bp must have 'vndk' tag as well
as 'vendor_available: true'.

For a VNDK module, the 'vndk' tag has 'enabled: true'.
It will be installed system/lib(64)/vndk as a vendor variant.

For a VNDK-SP module, the 'vndk' tag has
'support_system_process: true' as well as 'enabled: true'.
It will be installed system/lib(64)/vndk-sp as a vendor variant.

Bug: 63866913
Test: build and boot with BOARD_VNDK_VERSION=current
Merged-In: I9b9d9c0a3f33e396e71167c055220b55380eb1b5
Change-Id: I9b9d9c0a3f33e396e71167c055220b55380eb1b5
(cherry picked from commit 5bed6372b8)
2017-09-07 05:55:06 +00:00
Steven Moreland
477e5978ac libhardware_legacy: vendor_available
Test: build with BOARD_VNDK_VERSION := current
Change-Id: Iccc3a0301a28de52fc17102d251ce728d372ba5c
2017-04-17 13:38:11 -07:00
TreeHugger Robot
a8d05433c4 Merge "Mark as vendor_available" into oc-dev 2017-04-17 18:10:25 +00:00
Dan Willemsen
703e783e28 Mark as vendor_available
By setting vendor_available, the following may become true:

* a prebuilt library from this release may be used at runtime by
  in a later releasse (by vendor code compiled against this release).
  so this library shouldn't depend on runtime state that may change
  in the future.
* this library may be loaded twice into a single process (potentially
  an old version and a newer version). The symbols will be isolated
  using linker namespaces, but this may break assumptions about 1
  library in 1 process (your singletons will run twice).

Background:

This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.

At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.

It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:

https://android-review.googlesource.com/368372

None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.

Bug: 36426473
Bug: 36079834
Bug: 37343006
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Test: attempt to compile with BOARD_VNDK_VERSION := current
Merged-In: I3f1e4986c5920b4a64768636cb0bc37fa602c7a7
Change-Id: I3f1e4986c5920b4a64768636cb0bc37fa602c7a7
2017-04-14 16:42:32 +00:00
Steven Moreland
4d4047b7e9 libhardware_legacy: Android.mk -> Android.bp
Test: builds with BOARD_VNDK_VERSION := current
Test: (sanity) Boots and works on internal marlin.
Bug: 33241851
Bug: 29915755
Change-Id: Ic355174a67860afa13377bc9d8f0a140f59ec34e
2017-04-14 16:05:25 +00:00
Dan Willemsen
24230cd423 Include what you use
This doesn't need utils/Log.h, only log/log.h (and liblog)

Bug: 33241851
Test: m -j libpower
Merged-In: I21b08203fad51902d4a0f6172b4321b8b701ec47
Change-Id: I21b08203fad51902d4a0f6172b4321b8b701ec47
2017-04-11 18:22:37 +00:00
Colin Cross
d945d77458 Convert libpower from Android.mk to Android.bp
See build/soong/README.md for more information.

Test: builds
Change-Id: I4cc68e4bbe65abe741c02448aa7f42fdfd5804fa
2017-01-12 15:35:16 -08:00