BatteryMonitor returns HealthInfo structs directly. Modify
code to adapt to this behavior.
Test: health VTS test 2.0
Bug: 142260281
Change-Id: I5e6605e46bb4f8bb08c1356e5f2233880e6f9d14
Documentation: https://source.android.com/devices/tech/power/batteryless
If a battery device is not detected, the following battery-related
defaults are used on Android 9 and higher:
* Present: false
* Status: unknown
* Remaining capacity: 0
* Health: unknown
* AC charger online: not modified
The previous version of the test failed devices if the vendor HAL
reported BatteryStatus::UNKNOWN. However, the tests were skipped if the
default HAL was the one being used, so this has not come up before for
other batteryless devices.
Bug: 142081126
Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: I8ca758677478b47511e24990fee545fafa6c7f83
BatteryMonitor::update no longer calls healthd_board_battery_update
and callback for us.
Test: VTS health HAL 2.0 test
Change-Id: I05fbf60b7e2c38f82e019d2fec2b5f535defaeae
This change converts the original healthd_common.cpp to a
C++ class, HealthLoop, that manages the infinite loop in health-related
modules (charger, health HAL, healthd, etc.). By doing so, the global
static variables (including FDs and healthd_mode_ops) are cleaned up.
This helps us implement health HAL 2.1.
In order to support legacy modules (namely, healthd, charger, health HAL
2.0, which all depends on android.hardware.health@2.0-impl), a
healthd_common_adapter.cpp file is added to
android.hardware.health@2.0-impl, so that the following functions
in healthd/healthd.h continues to be implemented using the global
healthd_mode_ops:
- healthd_register_event
- healthd_battery_update_internal
Test: boot up the device and run VTS test on health HAL.
Bug: 137670450
Bug: 142260281
Change-Id: Iadcfc1315155404a3600f0e1219b5bc370d96409
Since these were combined into libhidlbase.
Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I075670b64eebbbbd6a6ae0e84ad51bf1c6f5ba36
hidl-generated makefiles are now generated such that bpfmt(file) == file.
Bug: 67417008
Test: enable bpfmt hook
Change-Id: I1f69d292bc23a7cc293a66110cb02d597e1019ad
gtest in Android P tree does not have GTEST_SKIP. Implement
a naive version of it.
Bug: 118852225
Test: manually undefine GTEST_SKIP, test with and without --force
Change-Id: I8df1154d8a94a67ae28e8024de6022fcfe76384d
If vendor HAL is present, healthd is not used by the framework. VTS should
skip testing it when this is the case.
Provide a --force option to the test if one wants to test healthd.
Fixes: 118852225
Test: on walleye, test healthd with and without --force.
Change-Id: I85f792f25406b1c02887a0ac273730e719003e2f
health/2.0/default/healthd_common.cpp wants to use
timerfd_create() to register a wakealarm.
To use the timerfd_create() syscall with CLOCK_BOOTTIME_ALARM,
CAP_WAKE_ALARM is needed.
Update the README to reflect the needed cap in the init file,
see also https://r.android.com/861532
Since the v1.0 HAL is in passthrough mode, the cap is needed for the 1.0
service as well.
Change-Id: I0e71da125eeef1360b5fd8bc7a69285e0b786511
Signed-off-by: Felix <google@ix5.org>
registerCallback() and getHealthInfo() unintentionally broadcast
health info to all callbacks, which has a performance impact.
* registerCallback() still invokes the new callback immediately
* getHealthInfo() does not call any callbacks at all.
Test: VTS test call getHealthInfo does not invoke update()
Bug: 117167903
Change-Id: Ida99fdd73831e747fbf2d65089c7c0e7661fe7c4
This is required for correct functioning of getHealthInfo() API
in recovery since BatteryMonitor requires healthd_mode_ops to be
initialized to update battery properties.
Bug: 78793464
Test: fastboot getvar battery-voltage
Change-Id: I9ff77664cada22e4aa3668bfb7d28d5f1d45590b
... so that it can be installed to recovery image.
Test: build and inspect out dir
Test: boot to recovery and 'adb shell ls /vendor/lib64/hw'
Bug: 80132328
Change-Id: Icb33c9e9e648b54db33cac23ed877392cce4e76b
Merged-In: Icb33c9e9e648b54db33cac23ed877392cce4e76b
(cherry picked from commit 4e40086d39)
This encourages device manufacturers to use
service.override over service and to remove healthd
on device, because it is one less step to do.
Test: make VINTF metadata
Bug: 66917623
Change-Id: I447395450060cdf17731514bb9a5e3ed912bbc66
Merged-In: I447395450060cdf17731514bb9a5e3ed912bbc66
(cherry picked from commit ae005c4610)
The fields being checked were uint64_t and it
is valid for them to have any value greater than
or equal to zero.
Bug: 74057048
Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: If932e1d6af8e162b7c570a1d5dd0f5ddce89ad1e
... to hardware/interfaces. HealthServiceCommon
becomes two separate libraries:
- libhealthservicedefault for services on vendor
- libhealthservicehealthd for healthd
Test: boots
Bug: 63702641
Change-Id: I40235cef7d4fa62103629bf507b0401e3f939654