Commit Graph

16 Commits

Author SHA1 Message Date
Xin Li
763c473c3d Merge Android 24Q1 Release (ab/11220357)
Bug: 319669529
Merged-In: I976f80006aeb88bde2ae34ca4f9be72cea727d9e
Change-Id: Id94b25af52bd2e2847b6858697ab21cc6ce27aa3
2024-01-30 10:36:50 -08:00
Treehugger Robot
2734d2f2bb Merge "Remove the active deletion action of callbacks" into main 2024-01-22 10:03:12 +00:00
David Anderson
f213e177fd Merge "health: Query new properties from BatteryMonitor." into main am: c601ec2ff5 am: e62ba8d5ba am: 0748629366
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2865639

Change-Id: I6a021d6b7af3548859eac0ed4398ef823e0931b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-12 21:47:44 +00:00
David Anderson
6e367dd86f Merge "Add android.hardware.health AIDL HAL V3." into main am: 9315c9f499 am: 346f8587c6 am: eb6c88c9d2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2836453

Change-Id: I4a3578173a7d6a59d73f4acd6b84088358c1e0e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-12 05:43:39 +00:00
David Anderson
8b413eb4ab health: Query new properties from BatteryMonitor.
Bug: 309792384
Test: VtsHealthTargetTest
Change-Id: I3e0117cf0e98b4861ede92623994877374cd2e23
2023-12-11 11:01:52 -08:00
David Anderson
85b3b0321a Add android.hardware.health AIDL HAL V3.
Bug: 309792384
Test: m
Change-Id: I5e9183b840f523f4d5b81dec813d35983882f71d
2023-12-11 11:01:52 -08:00
Hang Lu
cef01a32a1 Remove the active deletion action of callbacks
The active deletion action will cause binder blocked in some corner
cases. As serviceDied will take care of its deletion, remove the active
deletion has no side effect and could fix the issue.

Test: none
Bug: 296817256
Change-Id: Ib30b3910202e6bbd86ac59e0e69fbeb0a890dd38
2023-09-04 10:52:04 +08:00
Treehugger Robot
da4428be6e Merge "health: Check return value of LinkedCallback::Make." into main am: af52e698da am: 30525c3b18 am: 390416afba am: 589e7010a5 am: 4d568fdbb9 am: 2613d6735a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2651239

Change-Id: Ifee664f55dfce9f8a27b51fc3edea2e17f919c0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-08 00:30:12 +00:00
Yifan Hong
70197263f0 health: Check return value of LinkedCallback::Make.
If LinkedCallback::Make returns nullptr, do not put it
in Health::callback_. Otherwise, OnHealthInfoChanged
crashes later because the linked callback objects are
not null checked before accessing.

Test: android.hardware.health-service.aidl_fuzzer (with
  a special corpus)
Fixes: 289599278
Change-Id: I8bad41dbcfbefeb54744059baffd4eef1ae7ec42
2023-07-06 17:46:25 -07:00
Kevin Jeon
0331772902 Add missing newline to health/wifi AIDL interfaces
This change adds a missing newline character to the end of dump() for
the default health and wifi int

Add missing newline to health/wifi AIDL interfaces

This change adds a missing newline character to the end of dump() for
health and wifi.

Test: Take a bugreport and verify that the "X was the duration of
      dumpsys Y" lines aren't preceded by the final line of the dump.
Test: Run "dumpsys android.hardware.health.IHealth/default" and verify
      that the new line exists.
Test: Run "dumpsys android.hardware.wifi.IWifi/default" and verify that
      the new line exists.
Bug: 278081288
Change-Id: I173dd174b5bab808c6296f7163982393e60ba0c6
2023-04-13 13:09:07 -04:00
Jack Wu
cbbf24f15d health: get batteryStateOfHealth from healthd
Bug: 251427118
Test: m android.hardware.health-update-api
Change-Id: I556570782b0a9698fd3530be86f8ede33b11afe2
Signed-off-by: Jack Wu <wjack@google.com>
2023-02-23 01:24:00 +00:00
Jack Wu
3356161d6c health: expose battery health data and update version to V2
1. add the new propertes
  - batteryHealthData
  - batteryStateOfHealth
  - chargingState
  - chargingPolicy
2. add new types to health status
3. add new methods
  - setChargingPolicy
  - getChargingPolicy
  - getBatteryHealthData

Bug: 251425963
Test: m android.hardware.health-update-api
Change-Id: Ie2339c50e1f9bfc28427e4108a95b1a16c739205
Signed-off-by: Jack Wu <wjack@google.com>
2023-01-21 07:33:51 +00:00
Yifan Hong
bc84a7903a health: batterymonitor uses AIDL HealthInfo.
As a side effect, chargerDockOnline is properly set.

Test: TH
Bug: 222120465
Change-Id: I660e8ac0d1897ce30e3ae5d4f402a0b9ccac3c5c
2022-03-01 12:27:13 -08:00
Yifan Hong
2d418a2b5b health: do not use default destructor.
Otherwise, clients will need to know how to destroy
LinkedCallback, a hidden class.

Test: builds
Bug: 177269435
Change-Id: I89532755da16b672c4cbece55b943306f68cdb9e
2021-11-12 19:05:24 -08:00
Yifan Hong
6839f6742e health impl: compare interfaces with their binders
The intention is to compare binder objects not the
outer interface class.

Test: VTS
Bug: 177269435
Change-Id: I1c48112a75cb229b40c42ed2a3f347472d1860f9
2021-10-29 21:16:34 +00:00
Yifan Hong
830cdb119e health: Add default impl of health AIDL HAL
Compared to the HIDL HAL implementation,
- libhealthloop (and the HealthLoop class) is kept
- Create libhealthaidlimpl that replaces libhealth2impl. Fork the implementation because
  libhealth2impl is highly coupled with HIDL’s design rationale. This includes forking:
  - HalHealthLoop
  - Health implementation
- Combine the passthrough Health and hwbinder BinderHealth classes into the AIDL
  implementation of Health. This is because AIDL does not support passthrough transport.
  Separating the implementation for the two transports in HIDL does not make sense for AIDL.
- In HIDL, a BinderHealth is a HalHealthLoop which is composed of a (passthrough)
  Health implementation. As a result of this change, in AIDL, a Health implementation
  is a HalHealthLoop, which associates with the Health implementation itself with a raw
  pointer.
- hidl_death_recipient becomes ScopedAIBinder_DeathRecipient
- Callback becomes LinkedCallback

Test: manual
Bug: 177269435
Change-Id: I76e914117ce09b218cdb9d655f2135d29bb629ae
2021-10-26 23:53:55 -07:00