Load resources from /product/etc/res/{values,images}/charger. If a
resource fails, falls back to /res/{values,images}/charger.
If the device has GSI flashed, resources may exist in both paths.
Resources in /product is used with a higher priority.
Test: turn off device, charge, observe animation
Bug: 119549685
Change-Id: I5a5143d132a0cc6ce9135469fb523feeeafd1b1b
In case some power supply paths should not be considered, add a black list
to the healthd_config to instruct BatteryMonitor of the power supply paths
to ignore on init.
Bug: 117903348
Change-Id: I6f9ddeff9351ad01772b43728ddc2627da81df2a
Signed-off-by: Thierry Strudel <tstrudel@google.com>
platform/interfaces/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.
Since the .rc file for android.hardware.health@2.0 is shipped here in
system/core, update it here.
Signed-off-by: Felix <google@ix5.org>
Change-Id: I6cd5701b6e5cac37eb021d894251a3a9dc590b95
This reverts commit 17a65497bb.
Reason for revert: Dependencies which broke tests due to exclusion from LOCAL_JNI_SHARED_LIBS have been added.
Change-Id: I51e8ea7072026f233cd4a6c7e2142d92603af1f9
This reverts commit f23fa3b12f.
Reason for revert: This breaks framework tests and blocks presubmit
Change-Id: Iccf29d7499c378c611ea5a783074865febf8514e
Log an error if minui init fails, and avoid subsequent calls to minui
in this case (which are likely to crash).
Warn if no system text font available. This is now expected on most
devices, and the fallback text is not expected to be needed, but just
in case.
Avoid the attempt to print text if no system font available, log
warnings instead.
Bug: 80249440
Test: manual: charger mode with no system font
Change-Id: Ib0c761d37e41a893b2a192438eebcf48c4827049
Merged-In: Ib0c761d37e41a893b2a192438eebcf48c4827049
(cherry picked from commit 8211515fbe)
Original code is unblank screen for all frames of the first
cycle, unblank is needed only before the first frame of the
first cycle.
Bug: 74771887
Change-Id: I51d8390e359335a0b1cb127b096db1a8b889b169
Signed-off-by: Thierry Strudel <tstrudel@google.com>
It used to use global header include dirs, which is bad.
Test: builds
Bug: 68724651
Change-Id: Ib5354c66633499ad57fe5997e2c35283ba5e408f
Merged-In: Ib5354c66633499ad57fe5997e2c35283ba5e408f
(cherry picked from commit 530ac5bad1)
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)
Original code is unblank screen for all frames of the first
cycle, unblank is needed only before the first frame of the
first cycle.
Bug: 74771887
Change-Id: I51d8390e359335a0b1cb127b096db1a8b889b169
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Bug: http://b/77320844
Android.mk doesn't have support for PGO either. This causes linker
error (about missing __llvm_profile symbols) in the PGO-instrumentation
enabled builds in the release branch.
Test: m ANDROID_PGO_INSTRUMENT=ALL
Change-Id: I84fda4f1ac4f00ac26869507c6f5640b4ec9f6f3
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
... as a workaround for build system does not currently infer non-LTO
usage from Android.mk.
Test: m
Bug: 77320844
Change-Id: Iefe5d08b907133b4cdf1516efee73b2c0161f77e
mapSysfsString return code is checked for negativity after being casted
to unsigned enum type, which will always be false. This is obviously
unintended behaviour.
Fixes tautological-unsigned-enum-zero-compare warning.
Bug: 72331526
Test: m
Change-Id: Icec76d7a1121cb56fd9d05feb70cede69954c322
If the kernel does not implement a power_supply class device of type
battery, do not report fake data, instead report the following by
default:
* batteryPresent = false (instead of true),
* charging status = unknown (instead of charging),
* capacity = 0 (instead of 100%),
* health = unknown (instead of good),
* AC charger online not modified (instead of forcing true)
If no charger and no battery devices are supplied by the kernel, the
AC charger online property will no longer be forced to true. Devices
that are always plugged into AC power should either implement a
power_supply class charger device or implement a Health HAL that sets
properties appropriately.
Bug: 34507420
Test: manual: gce_x6_phone (no battery or charger),
boots and stays booted, inspect properties
Merged-In: I14cb3b685e8130428e417e7d08c4246f7415210a
Change-Id: I64bd4431af10f3d232f36fcf8d356b6d88b08013
These are custom paths from early Android devices that the framework used to
read, and that code was copied into healthd. Removed because this is not
defined in upstream kernel.
Change-Id: I375a8a62610c1235d82c1f27568437b16e0f96a8
Fixes: 72824944
Test: health 2.0 VTS test
This reverts commit 1bc572dfe8.
The presubmit test that (incorrectly) fails on the original commit
has been marked @FlakyTest and a bug is failed on Assistant.
Bug: 34507420
Test: manual: gce_x6_phone (no battery or charger),
boots and stays booted, inspect properties,
presubmit tests on gce_x86
Change-Id: I5509bf5de9fceffdd5fd8abc3f1f4f6101119248
... 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
This reverts commit de610c9a0e.
Reason for revert: May trigger flakiness in CTS ActivityManagerAssistantStackTests.
Change-Id: I02f831048f7802d91331e67bd9006860e4572b92
If the kernel does not implement a power_supply class device of type
battery, do not report fake data, instead report the following by
default:
* batteryPresent = false (instead of true),
* charging status = unknown (instead of charging),
* capacity = 0 (instead of 100%),
* health = unknown (instead of good),
* AC charger online not modified (instead of forcing true)
If no charger and no battery devices are supplied by the kernel, the
AC charger online property will no longer be forced to true. Devices
that are always plugged into AC power should either implement a
power_supply class charger device or implement a Health HAL that sets
properties appropriately.
Bug: 34507420
Test: manual: gce_x6_phone (no battery or charger),
boots and stays booted, inspect properties
Change-Id: I14cb3b685e8130428e417e7d08c4246f7415210a
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
The invocation is wrapped so that clients of -impl doesn't
have to call healthd_board_init directly.
Test: health VTS test
Test: charger_test
Bug: 69268160
Change-Id: I61f820b80ce6b03fe51ca05d07ed7e09ca369d2d
... to class implementation::Health. Expose APIs
InitInstance(), GetImplmentation()
for its setter and getter.
Clients that statically links to android.hardware
.health@2.0-impl (e.g. charger, recovery)
should use InitInstance().
Test: health VTS tests
Bug: 63702641
Change-Id: I51b9b976d0b723dac1a03e5113d5d9e84300c0e9
It is not used elsewhere, so a local variable is
sufficient.
Also fix a shared lib order in soong file.
Test: health VTS test
Bug: 63702641
Change-Id: I53cc208d8dd388fc89119c0044c5e30acf0740fb
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
Revert "Update for expanding @2.0::HealthInfo."
BatteryService does not use these fields for posting
sticky intents.
This reverts commit be17a4f235.
Test: boots
Bug: 63702641
Change-Id: I4df61645ab38a8e205ee21efc86bbef3e39674ab
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
Refactor drawing code into separate class, and allow for split screen
drawing with offset.
Cherry picked from commit 7f386dcab9
Bug: 63541890
Test: Verify charging mode animation
Change-Id: I6c089460f55b8c2f75f4aa3153a5736f6f434b51
Refactor drawing code into separate class, and allow for split screen
drawing with offset.
Bug: 63541890
Test: Verify charging mode animation
Change-Id: I6c089460f55b8c2f75f4aa3153a5736f6f434b51
Binder currently may service an incoming oneway transaction whenever
an outbound oneway call is made (if there is already a pending
incoming oneway call waiting). The unexpected nested method call
blocks forever on a recursive mutex acquire because healthd is single-
threaded. The binder behavior is considered a bug and may change in
the future. For now, work around this in healthd.
Make a local copy of the listeners list, then drop the lock and
perform the outbound calls on the local copy of the list.
Bug: 38201220
Test: Marlin with modified client calling scheduleUpdate() repeatedly
Change-Id: If35c2847556245921e2aff808ff747bb60356811
Binder currently may service an incoming oneway transaction whenever
an outbound oneway call is made (if there is already a pending
incoming oneway call waiting). The unexpected nested method call
blocks forever on a recursive mutex acquire because healthd is single-
threaded. The binder behavior is considered a bug and may change in
the future. For now, work around this in healthd.
Make a local copy of the listeners list, then drop the lock and
perform the outbound calls on the local copy of the list.
Bug: 38201220
Test: Marlin with modified client calling scheduleUpdate() repeatedly
Change-Id: If35c2847556245921e2aff808ff747bb60356811
scheduleUpdate forces a healthd battery update,
which will notify all listeners.
Test: Manual (strace -p $healthd_pid)
Bug: 32645990
Change-Id: I8b19f79b633ca8988f0e3dd5be14757f6421ddcb
This method is still used by prebuilts, but making it private to start
the process of removing it from everywhere.
Test: pass
Bug: 35363681
Change-Id: I4d53f68d10c9abcca32023c4d930e99912afa697
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.
Test: builds
Bug: 33844934
Change-Id: I9a1fd3ba598bf058b6212bd416ecdf90ea329539
Preserve last Android reboot reason as recorded by android_reboot()
prior to entering charger mode. For example, a thermal shutdown that
reboots to charger mode leaves that reason in place, for user
notification purposes at next Android startup.
Bug: 30994946
Test: manual
Change-Id: I003f57bfff29a471bb647d2cf6b0986ff428985a