Commit graph

13 commits

Author SHA1 Message Date
Stephane Lee
45f8ab3477 Fix logging in Health HAL 2.0
Bug: 149577800
Test: Ensure logging works as expected
Change-Id: I79b78593ee6bdbda59e49a27e70076184a30668d
2020-02-14 11:56:48 -08:00
Yifan Hong
00ebc75aef [REFACTOR] health 2.0: battery monitor returns health info 2.0
BatteryMonitor returns HealthInfo structs directly. Modify
code to adapt to this behavior.

Test: health VTS test 2.0
Bug: 142260281
Change-Id: I5e6605e46bb4f8bb08c1356e5f2233880e6f9d14
2019-10-15 17:38:40 -07:00
Yifan Hong
9521b9d458 [REFACTOR] health 2.0: BatteryMonitor::update split into 3 funcs
BatteryMonitor::update no longer calls healthd_board_battery_update
and callback for us.

Test: VTS health HAL 2.0 test
Change-Id: I05fbf60b7e2c38f82e019d2fec2b5f535defaeae
2019-10-14 15:24:21 -07:00
Yifan Hong
e9fc235eb4 health: registerCallback() and getHealthInfo() does not notify all callbacks
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
2018-10-02 14:30:03 -07:00
Yifan Hong
a46c0dae81 health: use recursive_mutex.
Need to use an reentrant lock.

Bug: 117167903
Test: vts
Change-Id: I25a366e06ed9d983823f7276668b7f45ddcf1c2b
2018-10-02 14:30:03 -07:00
Hridya Valsaraju
bf0b9faaad Initialize healthd_mode_ops in recovery default Health HAL impl.
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
2018-09-28 21:30:20 +00:00
Yifan Hong
81b2833a2f health: expand debug info.
Test: lshal -m android.hardware.health@2.0::IHealth/default
Test: lshal -m android.hardware.health@2.0::IHealth/backup

Bug: 74057048
Change-Id: Iaca0a7fd32209522d7d759342b98d6e6898595ac
2018-04-04 22:32:53 +00:00
Hridya Valsaraju
d31932aa67 Modify IHealthInfoCallback interface to return V2.0 HealthInfo
Bug: 71860528
Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: Ie7294efa644442825baa5f08c39553c10b368e75
2018-01-18 21:24:12 +00:00
TreeHugger Robot
759987d939 Merge changes from topic "health_report_api"
* changes:
  Test API returning health information
  Add an API to return Health Info
2018-01-18 18:04:18 +00:00
Hridya Valsaraju
1bd3772833 Add an API to return Health Info
Bug: 71860528
Test: vts-tradefed run vts -m VtsHalHealthV2_0

Change-Id: I5e0defdabcd8e44b32a6eab609492ff354512e64
2018-01-17 20:31:32 +00:00
Yifan Hong
81874af4a1 IHealth: get* function return 0 on fail.
getChargeCounter, getCurrentNow, getCurrentAverage,
getCapacity, getEnergyCounter returns 0 when result is
not SUCCESS.

This is consistent with the invalid value defined
by @1.0::IHealthInfo and @2.0::IHealthInfo.
IHealthInfoCallback.healthInfoChanged() and
IHealth.getHealthInfo() both zero-fill invalid values.

This does not affect any clients, because client code
checks for result before using the value.

Test: health VTS test
Change-Id: I50e6faa5f4feb42bb1ec899e289567d6dde7e9c2
2018-01-17 11:14:50 -08:00
Hridya Valsaraju
2b520838b1 Add methods to health HAL interface to report storage info
The methods will report device specific storage info.

Bug: 68388678
Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: I76a15f36f271312d2b49141ee1d45118be101397
2018-01-11 10:35:48 -08:00
Hridya Valsaraju
d3e3d72cf8 Move android.hardware.health@2.0-impl to hardware/interfaces
Move android.hardware.health@2.0-impl to hardware/interfaces
from system/core/healthd.

Bug: 70533363 63702641
Test: make -j32

Change-Id: I0e4468f2183a273b4f73606b04faff88dd7afb72
2017-12-12 17:19:01 -08:00