setting fake properties.
healthd used to check for registered charger drivers to determine if the
device is an always-plugged device with no battery. This patch changes
it to check for battery instead.
Change-Id: Ie4ff5d3f21dc1a83a780a41eb0c929f66b86d631
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
With Type-C PD, VBUS can no longer be assumed to
to be at 5V. Read the "voltage_max" field from the
power_supply class node and export it through
BatteryProperties service.
Bug: 25229483
Change-Id: I04e32d9783a21bab375f1724758a9eeace2a047c
recovery needs to know whether the battery is charged.
Bug: 26879394
Change-Id: Ie2a1d06e81878efa3ff432c2015d409a625e473e
(cherry picked from commit aedf6038dc)
Boards can opt to have charger mode be passive, with no screen UI or key
processing, the same as for recovery mode, via BOARD_CHARGER_NO_UI. The
minui and associated libs and charging image files are not built into the
executable in this case.
Always select charger No UI operation for Brillo devices.
Bug: 27170356
Change-Id: Ibe71498743353b01ce5b6521e42ed94d75547547
and print a warning message containing the type
when the battery monitor fails to recognize a power supply.
Change-Id: I02ebd89736f7444f8bf7f28550afeec82d57e107
Call addService using a reference to a strong pointer to the service object,
such that the proper IBinder object is ref counted, instead of passing the
object's this pointer.
Bug: None
Change-Id: I72cac08c835a17b8cc263b2dc34864420b7a2841
Use 1972 as a right delineation. Otherwise use half way point
between the monotonic and realtime. Treat correction factor as
unsigned, ensure that any wrapping to a negative value is
dropped or set to EPOCH. Acknowledge that we can get a more
accurate time track by acquiring the time rather than relying on
healthd timestamp.
Bug: 26331432
Change-Id: I09075fca58676a30cf7d87baf2d4b0f53795abaa
CL in [1] changes the minui API of res_create_multi_display_surface()
(bootable/recovery/minui/minui.h). Track the change accordingly.
[1] commit b723f4f38f53a38502abb1a63165ac0749bc9cd9
Change-Id: If9684019105ff91d5ade5b69e88849af766c2a19
See the new types added here :
https://chromium-review.googlesource.com/304660
Add support for these.
Signed-off-by: Benson Leung <bleung@google.com>
Change-Id: I12c51e0611692a763a7f1cda57c77ad83d7aa7ea
With Type-C PD, VBUS can no longer be assumed to
to be at 5V. Read the "voltage_max" field from the
power_supply class node and export it through
BatteryProperties service.
Bug: 25229483
Change-Id: I04e32d9783a21bab375f1724758a9eeace2a047c
Devices which have no battery and are always plugged in will not have
any battery property initialized. This causes the 'stable power' to
never be switched which is required for updating apps.
This change recognizes such a device and manually sets the battery to
100% and charger status to connected to AC mains. It will also fake the
battery temperature.
Bug: 24258855
Change-Id: I98e5ed0dbeb7f2ab6d3802cd7e0f3a269bd8f31f
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Devices which have no battery and are always plugged in will not have
any battery property initialized. This causes the 'stable power' to
never be switched which is required for updating apps.
This change recognizes such a device and manually sets the battery to
100% and charger status to connected to AC mains. It will also fake the
battery temperature.
Bug: 24258855
Change-Id: I98e5ed0dbeb7f2ab6d3802cd7e0f3a269bd8f31f
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
(cherry pick from commit acb1ddf56c)
Aid monotonic to realtime logging synchronization correction in
the Android ecosystem by providing a periodic notification. We
now have the following messages in the kernel logs:
- PM: suspend entry %Y-%m-%d %H:%M:%S.%09q UTC
- PM: suspend exit %Y-%m-%d %H:%M:%S.%09q UTC
- Suspended for %s.%03q seconds
- healthd: battery l=100 ... %Y-%m-%d %H:%M:%S.%09q UTC
Alter klogd to resynchronize on healthd messages as well.
NB: Time using strftime format, %q is a reference to fractional
second as introduced into log_time strptime method.
Bug: 21868540
Change-Id: I854afc0a07dff9c7f26d2b2f68990e52bf90e300
Aid monotonic to realtime logging synchronization correction in
the Android ecosystem by providing a periodic notification. We
now have the following messages in the kernel logs:
- PM: suspend entry %Y-%m-%d %H:%M:%S.%09q UTC
- PM: suspend exit %Y-%m-%d %H:%M:%S.%09q UTC
- Suspended for %s.%03q seconds
- healthd: battery l=100 ... %Y-%m-%d %H:%M:%S.%09q UTC
Alter klogd to resynchronize on healthd messages as well.
NB: Time using strftime format, %q is a reference to fractional
second as introduced into log_time strptime method.
Bug: 21868540
Change-Id: I854afc0a07dff9c7f26d2b2f68990e52bf90e300
In charger-mode, power off/on screen as required, for efficient
charging.
Turn on screen on power-key press rather than on key-release.
On charge-cable removal, kick animation to show the correct battery
level.
Change-Id: I74eaf8681466c44dbd76a820adf154053e0fc43a
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Signed-off-by: Jenny TC <jenny.tc@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>
Existing code allows charger-mode to exit to Android even with 0%
battery.
This might lead to more battery discharge while booting to Android,
especially if only USB-charger is connected, and thus certain
features/components not functioning as expected in Android.
This patch adds a configurable parameter to improve the user experience
by preventing the charger exit till battery capacity is good enough to
boot Android
Change-Id: I56a283243551373e962ac562f25eaf11f07666c3
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Signed-off-by: Jenny TC <jenny.tc@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>
Adds a callback to the healthdHAL which can check for device specific
properties to decide if the screen should turn on.
Change-Id: I543e7729ecb291157df4d3be1bd718f8af01ac40
Signed-off-by: Ruchi Kandoi<kandoiruchi@google.com>
If charger is connected and battery capacity is 0, charging animation should
run. The device would be booted up even if capacity is 0 in off-mode charging.
At that time, it would take some time to be 1 from 0 for capacity if you
use USB charger.
Bug: 17606689
Change-Id: I37e0f1b6ab0ee1f6d833882e169bf3ea06cf2399
To allow healthd/charger info to appear in systems where the loglevel
has been bumped to squelch chatty drivers.
Change-Id: I4ab135765700d7584a1ce5d972ea473d77f299f8
Logic for this check was inadvertently reversed when porting this from
the charger daemon to healthd. Request suspend if a charegr is connected,
else stay out of suspend waiting for a charger connect or power off if
none.
Bug: 17112463
Change-Id: Iffdb6dbcd0d0a2a614ff8f50bf5f2e22e1ad552f
connected to fake battery.
Detects if the device is attached to a fake battery if yes, healthd
reports 42% battery charge and 42.2 degrees temperature.
Change-Id: I2508fd91c8d3848ea64f57ab59d20be1c2817913
At present, charging animation runs irrespective of whether charger is
connected or not. When the charger is disconnected, device does not
shutdown for 10sec. Charger animation during this period should be
avoided.
Change-Id: I34dc5028522ca199d50a1a1b684b035b2d81ef68
setprop persist.sys.battery.capacity 77
setprop persist.sys.battery.temperature 123
and reboot to cause a fixed battery level of 77% and temperature of 12.3C
to be reported to Android.
Typically used on power evaluation boards without batteries connected.
Bug: 14839868
Change-Id: Ibae5e16429d05891cb0787d74a2fe93b07013699
The minui library has changed to no longer use libpixelflinger. It
also offers a more efficient way of storing and loading frames of
animation; use it to represent the battery-full state images.
Also removes the unused battery_charge.png image.
Bug: 12131110
Change-Id: I6cc8b19f36a806c99cda30cc47b5968daf6b333b
* Replace unnecessary warnings about missing attributes with a more
informative message when no battery devices provided by the system.
* Turn off periodic battery checks when no battery devices (thereby
reducing unnecessary kernel log spam).
* Replace battery properties in log messages with a more informative
message when no battery is provided or the battery is removed.
Change-Id: I68a514aa7315ae2b5d22cb8861d3c9b1b38035a1
Previously because /sbin/healthd does not exist on the build host, make
always tries to rebuild the symlink even in an already-up-to-date tree.
Change-Id: I41201282281476b14eaf4c7d9b2e09fe367c1422
* Add healthd charger mode ops
* Check for executable invocation as "charger", set charger mode if so
* Incorporate charger executable as healthd charger mode
Change-Id: I4a44e7a4c3a65ae9be94491f7f498aa48d4f8a84
* add ops for different "modes" of healthd operation: android vs. recovery
* recovery mode selected by runstring options -r
* binder/Android communication moved to android mode
* recovery mode ops avoiding binder service registration
* "no service manager" flag removed; now handled by android vs. other modes
Change-Id: I3d8c89bf96a18a6a00cc85306f9a07d3f408f2a0
Make it easier to later separate out binder-related code.
Add helper functions healthd_battery_update(), healthd_get_property() to
allow these operations without needing references to the BatteryMonitor
object.
Change-Id: Ie584bf53e5178ce0a098d0d940d6c311fdff62d4
Adding support for batteryChargeCounter and batteryCurrentNow as parameters
likely to be useful for power consumption analysis.
Change-Id: Ib23b05d3c31c22ece0d21e55cc481c1b5dabe59e
Allow health HAL to select specific paths to be used, overriding
default search for arbitrary power supplies with the named paths.
Change-Id: I5f724739f58ef56087ab592b7403fc083db8f173
uA and uAh units are converted to mA and mAh.
If current_now is present, add it to the heartbeat log (c=nnn).
Change-Id: I2b5fe7b4505c98ca2d11c3f94564c1c38493c8b9
Initially moving battery health monitoring here.
Command line flag -n tells healthd not to use (or wait for) servicemanager
in this execution, for charger and recovery modes.
Change-Id: I1720594724af0c068497b359f9c6ad65aeaa1519