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
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
ev_init() and ev_iterate_available_keys() now take std::function
callback functions.
Test: mmma system/core/healthd
Change-Id: I8231b57ba816fcba8f698dd7145724021e235664
In order to automatically use the /sys/class/power_supply/bms/charge_full
path for reading learned capacity of the battery, the BMS power supply
(Battery Management System) needs to be considered a battery.
Test: Manual
Change-Id: I66e5751547c3dbdc8de0bb3893367cc6f2c9d733
Subsequently moves the default board hooks to hardware/interface/health
where the new HAL is defined.
This change removes 'healthd's dependency on libhealthd.<target> static hal.
The dependency has now been *temporarily* moved to the new HAL
implementation in hardware/interfaces/health. 'charger' continues to depend
the static HAL.
Test: Tested healthd with and without a board specific health HAL on
Angler.
Bug: b/32724915
Change-Id: I35b56bacde7ded0517bc960f35538d6ca46e6b06
Signed-off-by: Sandeep Patil <sspatil@google.com>
This splits healthd code into 2 pieces as described below.
charger - statically linked executable in /sbin
- responsible for charger-mode UI
- battery/charger monitoring in recovery/charger-mode.
healthd - dynamically linked (*mostly*) executable in /system/bin
- responsible for battery / charger monitoring in Android
- runs 'batteryproperties' service.
Both currently use libhealthd STATIC HALs. However, this now paves
way for the healthd (android) HAL to be a shared library that can
be trebelized.
text data bss dec hex filename
733356 15312 33864 782532 bf0c4 root/sbin/charger
55943 10392 192 66527 103df system/bin/healthd
789299 25704 34056 849059 cf4a3 (TOTALS)
Test: Tested recovery, charge-only and android boot with new binaries
with and without STATIC HAL.
Change-Id: I80f94948dda44d466f172d234b3fcc9064ef2476
Signed-off-by: Sandeep Patil <sspatil@google.com>
This renames the old '/sbin/healthd' to '/sbin/charger'
which is to be only used in recovery and charger-only mode.
.. and adds a new dynamically linked executable in /system/bin/healthd
to be used as 'healthd' in Android.
text data bss dec hex filename
817404 36704 37960 892068 d9ca4 root/sbin/charger {was healthd}
72717 11064 12984 96765 179fd system/bin/healthd {*new*}
890121 47768 50944 988833 f16a1 (TOTALS)
Corresponding changes in recovery and charger-only .rc files are
required change how 'charger' is launched in each mode.
Update the seclable for healthd with the launch path in init.rc
Test: Boot tested and verified all 3 modes (recovery, charge-only,
android)
Change-Id: I4ada27a4c113258c5be1fd10adb0f58232b10024
Signed-off-by: Sandeep Patil <sspatil@google.com>
The charger code lands in 'libhealthd_charger' and androoid/framework
facing code is now compiled into 'libhealtdh_android' (formerly
libhealthd_internal).
This is a pre-cursor to eventually splitting healthd into 2 binaries,
viz ..
1. /sbin/charger - statically linked binary to be used *only* in recovery
and charge-only mode(s).
2. /system/bin/healthd - dynamically linked binary to be used *only* in
Android.
The static board hal (i.e libhealthd.<target>) will then be compiled
twice for charger and healthd seperately, paving the way for us to
seperate out the HAL for Android
Test: Boot tested and verified 'healthd' works in recovery,
charger-only mode and Android.
Change-Id: If45213ddd14c00ea3b8e1759cfd99286ca1ef2ea
Signed-off-by: Sandeep Patil <sspatil@google.com>