libbatterymonitor_V1 is used for some libraries linking health
aidl_interface V1 but at the same time BatteryMonitor also uses
battery hal V2 structure, it will cause compiling error.
Folk BatteryMonitor is also required along with folk libbatterymonitor
Bug: 251425963
Test: build
Change-Id: I796db83b1a67ad63e7f75f966e829a790b5c9c89
Signed-off-by: Jack Wu <wjack@google.com>
Requirements for battery health aidl hal v2, include sysfs nodes:
- Battery state of health
- Charging state
- Charging policy
- Date of manufacturing of the battery
- Date of first use of the battery
and functions
- setChargingPolicy
- getChargingPolicy
- getBatteryHealthData
Bug: 251425963
Test: m
Change-Id: I210dc403ba95b1b75759227f84bc32f32be1bbaf
Signed-off-by: Jack Wu <wjack@google.com>
When health aidl_interface version updraged, some libraries are
depending on V1 and libbatterymonitor or libhealthd_charger_ui at
the same time. It will cause multiple versions depending if
libbatterymonitor or libhealthd_charger_ui are depending on new
version.
Fork libbatterymonitor and libhealthd_charger_ui to generate two
versions, so that other libraries can depend on the same aidl_interface
version, to avoid multiple versions depending.
Bug: 251425963
Test: build
Change-Id: I37ba23169428677550176916e5d0b52c154d7b85
Signed-off-by: Jack Wu <wjack@google.com>
* According to healthd_mode_charger.cpp#L106 this should be
res/images/default/charger and not res/images/charger/default
Change-Id: Iabb5f5ecdd3b94c90a4b46849dd0a048da51364a
This change cleans up technical debt. As a side
effect, this change also exposes chargerDockOnline
properly to health HAL implementations.
Test: TH
Bug: 222120465
Change-Id: I306bd0538d94b310a69befb93b5862dd7208447f
For the vendor variant of libhealthd_mode_charger, read resources
from /vendor. The core variant continues to read resources from
/product, /system, and /res.
Test: run charger from /vendor manually
Bug: 203246116
Change-Id: Ia9df1d081a51783409b5dbd3e3d4719efc3cb6a7
This is a prerequisite to move charger to vendor partition.
Because vendor domains can't read ro.charger.*, they are all assumed
to be the default value. They aren't set in the ecosystem anyway,
so it is time to deprecate them.
Test: builds
Bug: 203246116
Change-Id: I0b17e62ab3ac5a89df091333fd9f24e33bdfd49a
The system property is set by vendor partition but owned by platform,
hence vendor domains can't read this value. Add an API in
ChargerConfigurationInterface so that HAL implementations can override
its value.
Other ro.charger.* sysprops are unused, hence no APIs are created for
them.
Test: manual
Bug: 203246116
Change-Id: I583c21e58ed3d912b156e253d6a4b46a0378f11e
Abstract all the HIDL-ness from charger so an AIDL HAL
can later replace the HIDL HAL.
Created libhealthd_charger_ui that is responsible for
UI stuff in charger. Then libhealthd_charger is now the
charger library backed by HIDL HAL.
Bug: 170338625
Bug: 203246116
Test: charger_test
Change-Id: I193bb76afa18b3367f24796ac53b1760650e8683
It is replaced by health HIDL HAL 2.0. Devices launching
with Android P and above must always have health HAL 2.0,
so health HAL is no longer needed for Android S.
Test: TH
Bug: 171260613
Change-Id: I7d94af36a880d7c658e879a3986924a786e58de9
Convert rules to build charger resources to Soong
assuming BOARD_CHARGER_NO_UI is not set. As of now,
no devices in the source tree sets this variable. Also,
these images should be installed to the system image
regardless of this variable.
This change moves battery_fail and battery_scale to
/system/etc/res/images/charger.
Test: build and inspect system/etc/res/images/charger
Fixes: 143907179
Change-Id: Idccf5631371c7520cbfcfa6e92d1e88d0f3f95e7
This makefile is not included before, so it was never built. Also do
the following changes to make sure it works:
- Remove non-existing libhealthd_internal dep
- Add necessary libhealthd_charger dep because it tests AnimationParser
- Since it tests AnimationParser, change its name to
libhealthd_charger_test
Test: run it
Change-Id: If7f91de4b910024f27d09a25ca801e67b98221db
Clean up charger's libhealthd dependency.
- Charger uses libhealthloop to maintain an infinite
loop, similar to all health 2.x services.
- Charger tries to open up health 2.1 HAL implementation
to retrieve health info. If it failed, it falls back
to the legacy code path where a default BatteryMonitor
is used, *except* that it won't depend on libhealthd's
healthd_board_init() and healthd_board_battery_update()
anymore.
- Remove global static variables because they are hard to
track.
- Modernize code by converting charger_state in to a C++
Charger class, transforming all functions into methods,
and moving all other global states into the class.
- Devices that matches all of the following:
- have a customized libhealthd (search for modules
named libhealthd.xxxx)
- uses charger from system image (look for "class charger"
in device init.rc scripts; if you see the binary is named
"/charger" or "/system/bin/charger" then you are using
charger from system image)
... must implement health 2.1 passthrough implementation
properly in order to have charger continue to work.
See hardware/interfaces/health/2.1/README.md for details.
Test: charger test
Test: manual charger mode
Bug: 127677771
Bug: 142286265
Change-Id: I0f26e5c1fe2be6b5952fc019224457c8419e43e4
... instead of BatteryProperties. HealthInfo contains
much more information and is easy for health HAL impl
to use it.
Also add getHealthInfo* functions for health HAL
implentations to use.
Test: health VTS 2.0 test
Bug: 142260281
Change-Id: I188276788fd8f11e69f8e046b91a873afaa23457
Since these were combined into libhidlbase.
Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I0bdffced6af52695c0ef98c9dd659348e56f7aa6
Converting charger to Soong, one step at a time.
In the meantime, drop the use of BOARD_*/TARGET_* variables
in Android.mk because runtime sysprops will be used instead.
Libraries / binaries will always link to libminui / libpng /
libsuspend.
charger{.recovery,} can't be converted to Soong yet because
of the use of HAL_STATIC_LIBRARIES (Bug 127677771).
charger_test isn't converted because of the shared list
of CHARGER_{STATIC,SHARED}_LIBRARIES.
Bug: 124118169
Test: run charger on walleye
Change-Id: I355deda14e5b5c9938256ff0b778590ac0191095
This CL splits out healthd_mode_charger_nops for building
charger.recovery. It doesn't change the functionality of the charger
module under recovery, i.e. a) it still doesn't do much work other than
reporting the battery status periodically; b) it keeps calling
device-specific healthd functions (healthd_board_init and
healthd_board_battery_update) via the statically linked HAL.
Previously `charger -r` was used to indicate starting charger under
recovery mode. This CL makes it a noop since we've changed the caller in
recovery.
Bug: 73660730
Bug: 114042635
Test: Boot into charger mode on walleye. Check that charger UI works.
Test: Boot into recovery mode on walleye. Check that /system/bin/charger
keeps working.
Test: Run charger_test on walleye.
Change-Id: Id91acfcc77ec315c2382392dc54e36c3e85de2eb
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
Bug: 77541952
Bug: 79107699
Change-Id: I1cac3570f64a0308b1f2d465205f98a97e4b4320
Merged-In: I1cac3570f64a0308b1f2d465205f98a97e4b4320
(cherry picked from commit 2db565d75f)
Removes healthd from the build if -service.override
is provided. This encourages developers to deprecate healthd
for their devices when they can.
When -service.override is used, framework manifest needs
to remove the /backup instance as well; this can be done
by including manifest_healthd_exclude.xml in
DEVICE_FRAMEWORK_MANIFEST_FILE.
Test: build and boot on 2016/2017 Pixel devices
Test: build and boot on a new device
Test: lshal and vts_treble_vintf_test on all these
devices
Bug: 77541952
Change-Id: I25744feaad3034441cd7a96a5343d4ce3eedc288
Split healthd section from init.rc into its own. This allows
healthd.rc to be excluded from the build when healthd is excluded.
Test: builds
Test: exclude healthd from build, healthd.rc is not installed
Bug: 77541952
Change-Id: I1c055f14c5862631f359fd0029289da8f43af063
... to hardware/interfaces. HealthServiceCommon
becomes two separate libraries:
- libhealthservicedefault for services on vendor
- libhealthservicehealthd for healthd
Test: boots
Bug: 63702641
Change-Id: Ibc7096328bb36356cb653e542bab900cd046fe8a
This is to add empty implementations of methods
reporting storage health.
Bug: 68388678
Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: If6180c22a4b356650084df61b1e24af3de0ca67e
With migration to health 2.0 HAL, there are unused code paths
that can be removed.
Test: health VTS test
Test: charger_test
Bug: 68724651
Change-Id: I9af2f95432529a0bf6e10980a99014d570dfce93
This is the original code path (BatteryService
-> healthd -> health 1.0 HAL). This ensures
upgrade-ability for old devices to P.
This is a partial revert of
287c41fffe, with
some modifications to the original healthd_board_*
functions for healthd.
Bug: 65990106
Test: VTS test for healthd and health service
Change-Id: If1c65e64e2fd6750369d52c8051ca6aa2b57ef27
Use healthd_board_* functions for the
code that's different between them.
Bug: 65990106
Test: boots
Test: VTS tests on healthd and health service
Change-Id: I88e6f210cb91c0cf08a9d7c52910c38fa9a75130
healthd_common.cpp uses health@2.0 for health@2.0-service
and healthd.
charger and recovery will be fixed in a follow up change.
(They still use libbatterymonitor for now).
Test: adb logcat -e "health@2.0"
Test: adb shell lshal --debug
Change-Id: I9ff0691d467df37118d7f143693c1bcd17a5bcbf