Commit graph

70 commits

Author SHA1 Message Date
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
1698fe28eb Merge "health: Also add h2aTranslate(V1_0.HealthInfo)" 2021-11-10 21:11:00 +00:00
Yifan Hong
2e07613c79 health: make libhealth_aidl_impl visibility public
It was meant to be the replacement of health2impl, the helper library
for implementing the health HAL. Hence, vendor implementation needs
to access it.

Test: pass
Bug: 177269435
Change-Id: I58f4bcd860983b2b16ea52fbdd6e05c8d4953454
2021-11-08 13:02:17 -08:00
Yifan Hong
701ff4a1de Merge "health: handle charger in health HAL" 2021-11-08 20:33:46 +00:00
Yifan Hong
9af94c627c Merge "health AIDL: Add readme" 2021-11-08 20:29:15 +00:00
Yifan Hong
02f04175c9 health AIDL: Add readme
Test: none
Bug: 177269435
Change-Id: I54e69d7789c6e1246bb126a27f9463e04407314e
2021-11-08 12:28:18 -08:00
Yifan Hong
4335f1cf9f health: Also add h2aTranslate(V1_0.HealthInfo)
... for BatteryService to use. Other fields
are kept as default values.

Test: builds
Bug: 177269435
Change-Id: I7e1c997f5441c7a81bcffb32688f4a2216378998
2021-11-08 12:23:23 -08:00
Yifan Hong
a8f55cacaa health: handle charger in health HAL
Test: manual in charger mode
Bug: 203246116

Change-Id: Id02077d78fa8b1489ea4fba5b10e32f961c4cea0
2021-11-03 11:56:01 -07:00
Treehugger Robot
9b965ac6a5 Merge "health AIDL: add vts tests" 2021-10-30 00:53:03 +00:00
Treehugger Robot
919d9a3da3 Merge "health: make AIDL HAL recovery available." 2021-10-30 00:30:34 +00:00
Yifan Hong
2200cffdad health AIDL: add vts tests
This is a direct translation of the health 2.0
and 2.1 VTS tests.

Some slight modifications are made (e.g. use googlemock
matchers) to make the test code more readable.

Test: run on Pixel
Bug: 203245778

Change-Id: Ifc3799a04a6a09d0d53f400b60d19fbfe004a3e3
2021-10-29 15:51:42 -07:00
Yifan Hong
1f5c57c965 Merge "health impl: compare interfaces with their binders" 2021-10-29 21:16:46 +00: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
Bob Badour
a88d5b1cb3 [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  health/aidl/Android.bp
  health/aidl/default/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I24a0212a955a084c795990653c45b60ebda33357
2021-10-28 17:18:27 -07:00
Yifan Hong
e32a8ea137 health: make AIDL HAL recovery available.
Test: builds
Bug: 170338625
Change-Id: I45e0032e7a765cdeb39e01d17bacf11d1c10a75c
2021-10-26 23:53:55 -07: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
Steven Moreland
713d22e0f1 Merge changes from topic "health-aidl"
* changes:
  health: Add to compatibility matrix.
  health: separate_platform_variant = false
  health: Convert of health HAL to AIDL
2021-10-26 22:33:31 +00:00
Yifan Hong
b47f676008 health: separate_platform_variant = false
Disable the generation of ndk_platform variant during the
ndk_platform -> ndk migration.

Test: builds
Bug: 177269435
Change-Id: I467eaee53542b152df1d398a8f044eb42fd01772
2021-10-26 11:03:03 -07:00
Yifan Hong
52ecb3f421 health: Convert of health HAL to AIDL
On top of the hidl2aidl translation, the following is
done manually:

- Renamed the package from health2 to health. Also pulls in
health@1.0::Battery* enums.
- Removes Result and Constants enum. Result values are returned
as transaction status codes.
- Removes health@2.1 charger related APIs.
  - remove shouldKeepScreenOn
  - remove getHealthConfig
  - remove HealthConfig type
- Removes StorageAttribute because it is not used in the framework
- Add units to HealthInfo fields and IHealth methods.
- Update docs (namely, u -> µ in various places)

Bug: 177269435
Test: pass

Change-Id: I9c9a9d9dd5d49142258e608a463412d3e89e91a3
2021-10-26 11:03:03 -07:00
Yifan Hong
9ca39cef7f health: AIDL add owners.
... for usage in other places.

Test: none
Bug: 177269435
Change-Id: I74ea2a497237d966db0c146868c61a1a667e8cca
2021-10-19 19:51:58 +00:00