Commit graph

284 commits

Author SHA1 Message Date
Steven Moreland
1b13eea81f Added libhealthd-headers.
Test: use with BOARD_VNDK_VERSION=current
Change-Id: Icece8e543307498f349d7f4914ec5be6d97e98fc
2017-07-10 16:05:51 -07:00
Todd Poynor
51741d2f50 Merge "healthd: notify listeners using local copy of list, drop lock"
am: e29a6cda31

Change-Id: I94c6b076148c65e82ef13fc75b4be15b3e930901
2017-06-29 22:29:36 +00:00
Todd Poynor
8bd30b3cf3 healthd: notify listeners using local copy of list, drop lock
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
2017-06-29 22:25:40 +00:00
Mark Salyzyn
ca0c0bb96e Merge changes Ibe1feb39,I05be83e4,If1422e4d am: a4f086ab20
am: 3a156e6c2b

Change-Id: I8c75910845dbf6dfbb50ad38eb234dcd68dce70f
2017-06-27 21:55:26 +00:00
Todd Poynor
a1f4cddfea healthd: notify listeners using local copy of list, drop lock
am: fd68370074

Change-Id: I8b8c8bb2b2eede878bb44afcaa08f73142a10d64
2017-06-27 21:52:29 +00:00
Mark Salyzyn
3a156e6c2b Merge changes Ibe1feb39,I05be83e4,If1422e4d
am: a4f086ab20

Change-Id: I7e5d431c992f9860ca7b42ca81edfbfd1d8e0a1c
2017-06-27 21:52:06 +00:00
Todd Poynor
fd68370074 healthd: notify listeners using local copy of list, drop lock
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
2017-06-27 11:58:17 -07:00
Mark Salyzyn
26f1dd764c healthd: check console-ramoops-0
On later kernels /sys/fs/pstore/console-ramoops becomes
/sys/fs/pstore/console-ramoops-0

Test: none
Bug: 63058217
Change-Id: I05be83e40dfc1730ed62b74a146123cdb8573ca6
2017-06-27 09:28:57 -07:00
Yueyao Zhu
8e5671f55c Merge "healthd: add battery health status values from JEITA spec" am: 5dd87c4ef6
am: 7a79592e4e

Change-Id: Ife13b29af4f44d3d6f5cc7b00435f4c6a57e0d2b
2017-06-21 19:29:25 +00:00
Yueyao Zhu
9bbfbf7ffe healthd: add battery health status values from JEITA spec
Some vendors implement JEITA battery health spec.

Bug: 35780570
Test: build and boot
Change-Id: I532cd0fbdbcae0a32879de7d7930f3ccb8605ffd
2017-06-20 18:08:51 -07:00
Adam Lesinski
f04daccae9 Merge "healthd: Implement scheduleUpdate" am: 6edabc75ab am: c0405200b8
am: 50094d9865

Change-Id: I75976e5d4d4a38fb0fcb9e0cb5bf33a5786b146d
2017-03-23 01:12:17 +00:00
Adam Lesinski
c0405200b8 Merge "healthd: Implement scheduleUpdate"
am: 6edabc75ab

Change-Id: I80082322b77cbd74b70b4d3c25e172d1c51f6072
2017-03-23 00:48:48 +00:00
Adam Lesinski
3dec1aa66d healthd: Implement scheduleUpdate
scheduleUpdate forces a healthd battery update,
which will notify all listeners.
Test: Manual (strace -p $healthd_pid)
Bug: 32645990

Change-Id: I8b19f79b633ca8988f0e3dd5be14757f6421ddcb
2017-03-22 12:15:11 -07:00
Steven Moreland
aa47993b23 Merge "libutils: String\d+ make std_string private" am: 76850afa52 am: 2ebb1e5404
am: 4ba3f784ef

Change-Id: I14f003992db222ef285551c6d9a8ffe71620f70d
2017-03-11 09:07:23 +00:00
Steven Moreland
2ebb1e5404 Merge "libutils: String\d+ make std_string private"
am: 76850afa52

Change-Id: I1d8278c7545c67a916977983d38ea82756a17403
2017-03-11 08:59:48 +00:00
Steven Moreland
2aac335128 libutils: String\d+ make std_string private
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
2017-03-10 22:51:55 -08:00
TreeHugger Robot
068e00b3c9 Merge "Revert "Add BMS as a Battery type"" 2017-03-06 23:34:59 +00:00
Yueyao Zhu
8d17bc6a7a Revert "Add BMS as a Battery type"
This reverts commit f13c6ff50a.

Bug: 34166515
Change-Id: I102d3ee071f214deba1a72738af62b6f6b7c52f4
2017-03-06 21:42:35 +00:00
Chris Phoenix
68f4085e07 health HAL uses "default" service name
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
2017-02-23 19:32:29 +00:00
Jin Qian
72adf11daf healthd: return battery status property
Bug: 34198239
Change-Id: Ib0f312c15eb75ba7482f4f0b3f30ba2feae2c209
2017-02-07 21:41:05 +00:00
Todd Poynor
c8183bb071 healthd: charger mode use reboot(), not android_reboot()
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
2017-02-02 04:00:54 +00:00
Tao Bao
3d34631dbe Merge "healthd: Track the API change of minui/minui.h." am: fb8c70cf4b am: 93e35655c4 am: bf90005832
am: a2285a6a3e

Change-Id: I6573b527bd7d405203d2e8fd063358ad031065a1
2017-01-25 00:59:02 +00:00
Tao Bao
bf90005832 Merge "healthd: Track the API change of minui/minui.h." am: fb8c70cf4b
am: 93e35655c4

Change-Id: Ic77cd6f293d2875e251def1e75aff33a612d7077
2017-01-25 00:56:07 +00:00
Tao Bao
92c260159a healthd: Track the API change of minui/minui.h.
ev_init() and ev_iterate_available_keys() now take std::function
callback functions.

Test: mmma system/core/healthd
Change-Id: I8231b57ba816fcba8f698dd7145724021e235664
2017-01-18 23:02:45 -08:00
Adam Lesinski
f13c6ff50a Add BMS as a Battery type
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
2016-12-09 19:23:46 -08:00
Nick Vaccaro
9291de89b9 healthd: Show animation before waiting on timer
am: 6f8314900f

Change-Id: I4fd5665ff1b7ce646aa0b515aeb38152a340d8a1
2016-11-29 21:40:59 +00:00
Nick Vaccaro
485c647432 resolve merge conflicts of e3083de to nyc-mr1-dev-plus-aosp
Change-Id: Iba35210bc2133d79b2ba8ceb63e355507c7c0f03
2016-11-29 11:28:26 -08:00
Damien Bargiacchi
fdce0878f1 Always show the battery percentage unless it is unknown
am: 3f0250c3cc

Change-Id: If5027f2fc94aaf1f2db1d6df79866185e2cfe86d
2016-11-29 19:10:58 +00:00
Nick Vaccaro
1e811fca22 resolve merge conflicts of 1f1a6fd to nyc-mr1-dev-plus-aosp
Change-Id: Ic07b6db6f47d2157aef0d04d025ba747d0a4247d
2016-11-28 14:58:30 -08:00
Yifan Hong
62e840fc44 Split libhidl into base and transport.
Bug: 32756130

Test: mma
Change-Id: I1b897d3984b0faf636d40b862b14872ce5d5aa9b
2016-11-17 14:45:11 -08:00
Sandeep Patil
a3681954b4 healthd: start using the new Health hal
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>
2016-11-10 15:19:24 -08:00
Sandeep Patil
526f8cf339 healthd: refactor healthd code to split into 'charger' and 'healthd'
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>
2016-11-08 07:36:07 -08:00
Sandeep Patil
6012db553c healthd: build 'charger' and 'healthd' binaries
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>
2016-11-08 07:36:07 -08:00
Sandeep Patil
fca8244080 healthd: refactor to split charger and framework facing code
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>
2016-11-08 07:35:55 -08:00
Nick Vaccaro
c3c947a7bc healthd: Show animation before waiting on timer am: 6f8314900f
am: 2ed637210e

Change-Id: Ibb768d6760a13a9b25a40fabd0fcf8cb283fdba9
2016-10-27 04:02:17 +00:00
Nick Vaccaro
6f8314900f healthd: Show animation before waiting on timer
Don't wait for first timer to expire before starting animation.

Bug: 32368190
Change-Id: If023e3a9f1dd0c3982c899bcf22e5335f9319f72
2016-10-26 19:41:21 -07:00
Tom Cherry
836a404525 resolve merge conflicts of 4897bb5 to nyc-mr2-dev-plus-aosp
Change-Id: Iacad26a1b27d032e7abd1c7c23a8ee87d61d0aa4
2016-10-24 22:15:12 -07:00
Nick Vaccaro
4897bb57e4 Enable CHARGER_ENABLE_SUSPEND to allow suspend
am: e3083dec0f

Change-Id: I58f35c426ccd6030664743c3f49adbc5af7102b2
2016-10-25 04:25:04 +00:00
TreeHugger Robot
085c91bedd Merge "Enable CHARGER_ENABLE_SUSPEND to allow suspend" into cw-f-dev 2016-10-25 04:16:25 +00:00
Damien Bargiacchi
2f65bf3e37 Always show the battery percentage unless it is unknown am: 3f0250c3cc
am: 44437259dd

Change-Id: I5f18055d0d04e642ebcc9fea4b713c1dc3298cfc
2016-10-25 01:36:50 +00:00
Damien Bargiacchi
44437259dd Always show the battery percentage unless it is unknown
am: 3f0250c3cc

Change-Id: I6e759572904fb7f505528812266fc48ecc8afd49
2016-10-25 01:33:50 +00:00
TreeHugger Robot
cd542213e8 Merge "Always show the battery percentage unless it is unknown" into cw-f-dev 2016-10-25 01:28:06 +00:00
Damien Bargiacchi
3f0250c3cc Always show the battery percentage unless it is unknown
Bug: 29547343
Change-Id: I55630be8033cd8074628a892960b5fafe0c83338
2016-10-24 16:45:29 -07:00
Nick Vaccaro
e204690ae7 resolve merge conflicts of 7c5aeb0 to nyc-mr2-dev-plus-aosp
Test: make healthd
Change-Id: I6dd20f5da5d2a9858d49db5556d8956a67ebf962
2016-10-24 14:07:35 -07:00
Nick Vaccaro
e3083dec0f Enable CHARGER_ENABLE_SUSPEND to allow suspend
Fixed a bug in makefile that was keeping CHARGER_ENABLE_SUSPEND from
getting properly set, so healthd was not trying to put kernel into
suspend.

Bug: 32162033
Change-Id: If054d7996fa5734285cbcd7d497492570076c141
2016-10-24 13:58:49 -07:00
Nick Vaccaro
1f1a6fdac8 healthd: allow override of wake interval timing
Devices can now override DEFAULT_PERIODIC_CHORES_INTERVAL_FAST
and DEFAULT_PERIODIC_CHORES_INTERVAL_SLOW by defining a value for
BOARD_PERIODIC_CHORES_INTERVAL_FAST and/or BOARD_PERIODIC_CHORES_INTERVAL_SLOW
in the device's BoardConfig.mk file.

Bug: 32162033
Change-Id: I956fd4760893ae6c2eb3a3af586353d4d66daf25
2016-10-21 19:39:05 -07:00
Tim Murray
b9ede3dbba healthd: move binder fd to not use EPOLLWAKEUP am: e89ea5eb85
am: 098babc7c8

Change-Id: I9ff934ef70aa89c02edcc8687249655ad86d806f
2016-10-21 21:53:49 +00:00
Tim Murray
098babc7c8 healthd: move binder fd to not use EPOLLWAKEUP
am: e89ea5eb85

Change-Id: I2e5a55d3bc381baa679e39e63d37164f76ffdcfc
2016-10-21 21:49:50 +00:00
Tim Murray
e89ea5eb85 healthd: move binder fd to not use EPOLLWAKEUP
The binder fd doesn't need to use EPOLLWAKEUP and shouldn't; if it does,
it will prevent suspend unnecessarily.

bug 32180327

Change-Id: I292f1ada0c698290f6bd5518b237867ed69ec391
2016-10-21 09:11:49 -07:00
Elliott Hughes
7948a33f2c resolve merge conflicts of a4398c1 to stage-aosp-master am: 195669febc
am: b2ab1c43cb

Change-Id: I412943235ad6cd908aca04c56aa19a3d2bbb5413
2016-10-14 02:55:55 +00:00
Elliott Hughes
da46b392f1 Move off std::sto* function which abort on failure.
Bug: http://b/31403370
Test: builds, boots, libbase tests pass
Change-Id: I89cd7ca3d8f1c8a1bad0ddf3043439449d19a293
2016-10-13 15:34:05 -07:00
Damien Bargiacchi
afd59e2f11 resolve merge conflicts of 565ba02 to nyc-mr1-dev-plus-aosp
Change-Id: Ic2152775c96dc28f808fc7b97433f8c3d2135948
2016-09-13 08:37:37 -07:00
Damien Bargiacchi
565ba02b89 Allow customization of charger animation
Allow the charging animation to be customized with a configuration file
and custom assets.

 - Add a parser to parse a custom configuration file.
 - Add support for showing a clock and the battery percentage.
 - Expand feature that conditionally shows animation frames using min_level
   and level_only to min_level and max_level

BUG: 29547343
Change-Id: Ia33f4bb37dc7d4c7fa6507a63481e93bf0bf9738
2016-09-12 21:07:27 -07:00
Damien Bargiacchi
ada99f91b0 Update to new minui text API
am: 0ee524de68

Change-Id: I19341d2639b6efeb13eddaae1083252eeafc77fc
2016-08-24 20:45:17 +00:00
Damien Bargiacchi
0ee524de68 Update to new minui text API
Change-Id: Ic753564a397b90a9ba54660c78bec9c1a1ef583d
2016-08-18 17:33:32 -07:00
Chih-Hung Hsieh
119d41c18e Merge \"Fix clang-tidy performance warnings in healthd.\"
am: b66b16b39a

Change-Id: I1263c6557128d71dd4208d6a4d6974572d8362a3
2016-07-28 06:24:24 +00:00
Chih-Hung Hsieh
4df105635b Fix clang-tidy performance warnings in healthd.
* Use const reference type for parameters to avoid unnecessary copy.

Bug: 30407689
Change-Id: I926ea7b6e9e020a228c812b7e23087a2b7ed9809
Test: build with WITH_TIDY=1
2016-07-27 16:05:50 -07:00
Chih-Hung Hsieh
65828a0ec9 Merge \"Fix misc-macro-parentheses warnings in system/core.\"
am: 495541c5bb

Change-Id: I021b653779c5119398c31ee354372366ba029328
2016-06-22 22:39:07 +00:00
Treehugger Robot
495541c5bb Merge "Fix misc-macro-parentheses warnings in system/core." 2016-06-22 22:35:02 +00:00
Chih-Hung Hsieh
cdb2ca5d9f Fix misc-macro-parentheses warnings in system/core.
Add parentheses around macro arguments used beside operators.
Bug: 28705665

Change-Id: I9226f319e283be640eddc31687f75b51a8ef0ac6
2016-06-22 14:33:13 -07:00
Dmitry Shmidt
9f6b80c9c8 resolve merge conflicts of a617e33 to stage-aosp-master
Change-Id: I0d1e6b1771eebc38f7eea5a942395c5f8ff6a5ac
2016-06-20 12:58:37 -07:00
Michael Scott
3217c5c7d9 batterymonitor: simplify readFromFile and use std::string buffers
In readFromFile() when a newline is not found in the data, we reset
the initial character of the buffer to \0, but leave the count as is
(something >0 in this case).

Later in getBooleanField() we could erroneously treat a response as
"true" because count would be >0 and the initial value of buf would
be != '0' (set to \0 in this case).

To fixup error paths such as this, we can simplify readFromFile
by using android::base functions: ReadFromFileString() and Trim().

NOTES:
- Converted char * buffers used with readFromFile to std::string
- Removed unused variable btech from BatteryMonitor::update

Testing Done:
- Build healthd and recovery for angler device
- Confirm that known values are being read correctly from kernel
  sysfs.

Change-Id: I238bbff097543767f352aa084bf0acbc1324baca
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2016-06-20 15:01:02 +00:00
Ruchi Kandoi
6e394f0f6c healthd: Check if battery device exists instead of charger drivers before setting fake properties. am: 9cb3d3ccf4
am: f2ca669e80

* commit 'f2ca669e80078254ad3aceac800161b3266d3195':
  healthd: Check if battery device exists instead of charger drivers before setting fake properties.

Change-Id: I8115836dbd81264634dd7ab84bc360ac610a030b
2016-05-17 18:23:04 +00:00
Ruchi Kandoi
9cb3d3ccf4 healthd: Check if battery device exists instead of charger drivers before
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>
(cherry picked from commit fabd490f58)
2016-05-16 08:58:35 -07:00
Christopher Wiley
447ae54e3f Merge "Export libbinder headers from libhealhd.default" am: c2241b9
am: a10b760

* commit 'a10b760d28ee0327d84dd73a16a83927d695eb56':
  Export libbinder headers from libhealhd.default

Change-Id: Idad9032e89102e912240a3d26955d3f7893e0694
2016-04-18 17:15:08 +00:00
Christopher Wiley
8ac71c7fc6 Export libbinder headers from libhealhd.default
Consumers of libhealthd.default will need these headers.

Bug: 27804373
Change-Id: I59e8526e3491f0db528d1277b8e2f4b68ce85805
Test: Compiles.
2016-04-18 09:33:53 -07:00
Treehugger Robot
54cba246b8 Merge "healthd: Explicitly reference headers from libbinder" am: 911982d
am: c2fd0b6

* commit 'c2fd0b6e8966c554eb78d012cefd9d9685871700':
  healthd: Explicitly reference headers from libbinder

Change-Id: Ia3f2c9fad18f712c1089c119b247702a54c19f6e
2016-04-12 21:09:08 +00:00
Christopher Wiley
22399089ef healthd: Explicitly reference headers from libbinder
When creating static libs with healthd logic, explicitly
reference libbinder to pick up its header include paths.

Bug: 27804373
Test: healthd libs compile when libbinder's header include
      paths change.

Change-Id: I1014eb0b73d06815c42a527c4ea7e63c35ca3530
2016-04-12 13:07:18 -07:00
Ruchi Kandoi
8df54e7721 healthd: Add charge counter for BatteryProperties.
am: 3f9886b

* commit '3f9886bb0bce7297c676907ded51c402d7b61654':
  healthd: Add charge counter for BatteryProperties.

Change-Id: I4fbdeebcd50acae22712dde8a2192475051c9d96
2016-04-08 01:19:36 +00:00
Ruchi Kandoi
3f9886bb0b healthd: Add charge counter for BatteryProperties.
Bug: 27174034
Change-Id: I26de33714bb353faadb159d898f0b2142c76c657
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-04-07 23:10:14 +00:00
Ruchi Kandoi
89e2d4dc67 Merge "healthd: Check if battery device exists instead of charger drivers before setting fake properties."
am: ed608b30b5

* commit 'ed608b30b5cb1d998f4d7a56cd0f85aa2bca5c5a':
  healthd: Check if battery device exists instead of charger drivers before setting fake properties.
2016-03-09 02:44:03 +00:00
Ruchi Kandoi
fabd490f58 healthd: Check if battery device exists instead of charger drivers before
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>
2016-03-08 22:28:25 +00:00
Ruchi Kandoi
39510201a3 Merge "healthd: Correct the scaling factor for maxVoltage and maxCurrent." into nyc-dev
am: 1d043484d4

* commit '1d043484d409d4d18eaf13aa1086f51fcee73587':
  healthd: Correct the scaling factor for maxVoltage and maxCurrent.
2016-02-26 21:29:48 +00:00
Ruchi Kandoi
5c09ec1726 healthd: Correct the scaling factor for maxVoltage and maxCurrent.
Change-Id: I93a4c916d0c742710c00c0b15d8d1de6b8f8d1c2
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-02-26 10:09:28 -08:00
Badhri Jagan Sridharan
ef375c6583 Merge "healthd: Read the max power supply voltage" into nyc-dev
am: df09aefc16

* commit 'df09aefc1603903429d8fa7c4838a38a7c6dc8d3':
  healthd: Read the max power supply voltage
2016-02-25 20:30:12 +00:00
Badhri Jagan Sridharan
40e1df4488 healthd: Read the max power supply voltage
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
2016-02-25 12:15:54 -08:00
Yabin Cui
b0580d710f healthd: support reading charge status from BatteryMonitor.
recovery needs to know whether the battery is charged.

Bug: 26879394
Change-Id: Ie2a1d06e81878efa3ff432c2015d409a625e473e
(cherry picked from commit aedf6038dc)
2016-02-23 11:01:21 -08:00
Yabin Cui
f6dbc6d4b8 healthd: separate libbatterymonitor for use in recovery.
Bug: 26879394

Change-Id: I97b5b4994c42988ce43f5085b8b4b25e9e80c9fa
(cherry picked from commit e98e177a34)
2016-02-23 10:52:43 -08:00
Yabin Cui
ac3387b71b healthd: init members of BatteryMonitor.
Bug: 26879394
Change-Id: I09a6c78137f91a0c88bf4ba1e8890b4ec31dcf2c
(cherry picked from commit db04a49a6f)
2016-02-23 10:46:38 -08:00
Ruchi Kandoi
bb8ae5d769 Merge "healthd: Remove warning by clang compiler." am: 08c8b53800
am: 78ed1935e1

* commit '78ed1935e1508326afb22be4dd7f9961922347fb':
  healthd: Remove warning by clang compiler.
2016-02-23 17:41:11 +00:00
Ruchi Kandoi
e9320b7c92 healthd: Remove warning by clang compiler.
Bug: 27265206
Change-Id: I8f2ec1391952de4a9cdefce0433535608a1e9b59
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-02-22 13:59:31 -08:00
Yabin Cui
f8eaff2dd9 Merge "healthd: support reading charge status from BatteryMonitor." am: d633106d3e
am: 0007c4efbe

* commit '0007c4efbe412148ebaf77a964226575a02e3af0':
  healthd: support reading charge status from BatteryMonitor.
2016-02-22 19:25:58 +00:00
Yabin Cui
aedf6038dc healthd: support reading charge status from BatteryMonitor.
recovery needs to know whether the battery is charged.

Bug: 26879394
Change-Id: Ie2a1d06e81878efa3ff432c2015d409a625e473e
2016-02-19 18:03:23 -08:00
James Hawkins
22b6f7a559 resolve merge conflicts of 0f5d443d0c to nyc-dev-plus-aosp
Change-Id: I850bda0808ae17ade5bc0e667211a599d284d6e3
2016-02-19 11:10:30 -08:00
James Hawkins
bd04bb0d29 Merge "system/core: Cleanup direct calls to opendir by containing in a std::unique_ptr." 2016-02-19 17:49:13 +00:00
Yabin Cui
fb516c2e63 Merge "healthd: separate libbatterymonitor for use in recovery." am: 219806bc7a
am: a90f7761bf

* commit 'a90f7761bf5a73cd6d75fb4b482a1ec08447e1a7':
  healthd: separate libbatterymonitor for use in recovery.
2016-02-19 17:43:08 +00:00
Yabin Cui
e98e177a34 healthd: separate libbatterymonitor for use in recovery.
Bug: 26879394

Change-Id: I97b5b4994c42988ce43f5085b8b4b25e9e80c9fa
2016-02-18 22:14:25 -08:00
James Hawkins
588a2cad7f system/core: Cleanup direct calls to opendir by containing in a
std::unique_ptr.

Bug: 26643633
Change-Id: Ia3491fdbff086558da694ae949cf08e4c89d0307
2016-02-18 14:52:46 -08:00
Todd Poynor
fecc5d6b51 Merge "healthd: Add "No UI" operation for charger mode" am: fdd26c961d
am: 6355bc8d5b

* commit '6355bc8d5b140d43557223c8969a05e0566d0117':
  healthd: Add "No UI" operation for charger mode
2016-02-17 21:48:53 +00:00
Todd Poynor
7c5a3e12a4 healthd: Add "No UI" operation for charger mode
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
2016-02-17 21:35:03 +00:00
Yabin Cui
7e84cbd999 Merge "healthd: init members of BatteryMonitor."
am: 2773d4f96a

* commit '2773d4f96a8e9f06710e36f7c33459eeaa5cb23a':
  healthd: init members of BatteryMonitor.
2016-02-17 18:37:53 +00:00
Yabin Cui
db04a49a6f healthd: init members of BatteryMonitor.
Bug: 26879394
Change-Id: I09a6c78137f91a0c88bf4ba1e8890b4ec31dcf2c
2016-02-16 17:19:23 -08:00
Elliott Hughes
96e3d1b5c1 Merge "Add support for USB_HVDCP chargers" am: ba3014c914
am: a902887970

* commit 'a9028879707d58f286014c4a6a9c6b53f61c2806':
  Add support for USB_HVDCP chargers
2016-02-04 02:35:19 +00:00
Johan Redestig
3282861b68 Add support for USB_HVDCP chargers
and print a warning message containing the type
when the battery monitor fails to recognize a power supply.

Change-Id: I02ebd89736f7444f8bf7f28550afeec82d57e107
2016-02-03 13:45:54 +01:00
Todd Poynor
d054a9517c Merge "healthd: BatteryPropertiesRegistrar binder service ref count fixup" am: 36ba2fad01
am: 4a129d5a45

* commit '4a129d5a45241345934107cea3662fa72721d383':
  healthd: BatteryPropertiesRegistrar binder service ref count fixup
2016-01-28 21:38:32 +00:00
Todd Poynor
e55356486f healthd: BatteryPropertiesRegistrar binder service ref count fixup
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
2016-01-28 21:10:21 +00:00
Mark Salyzyn
580933efcd Merge "logd: isMonotonic improvements" am: 554630f94e
am: e4a625a844

* commit 'e4a625a84498b0749986be85a521be85088ca5f0':
  logd: isMonotonic improvements
2015-12-30 21:38:02 +00:00
Mark Salyzyn
10b82b6834 logd: isMonotonic improvements
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
2015-12-29 11:34:29 -08:00
Tao Bao
88c264cfeb Merge "healthd: Track the API change of res_create_multi_display_surface()." am: a2f1e65d13
am: 604622cb8c

* commit '604622cb8c417f054fc3721fe94052ca89aea046':
  healthd: Track the API change of res_create_multi_display_surface().
2015-12-18 22:32:41 +00:00
Tao Bao
0db80236f3 healthd: Track the API change of res_create_multi_display_surface().
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
2015-12-16 11:38:14 -08:00
Qiwen Zhao
7ac8cacdfe Merge remote-tracking branch \'origin/mnc-dr2-dev\' into mnc-dr2-dev-plus-aosp
am: 09aa2f9b2c

* commit '09aa2f9b2c34339878dfd218d1c6e09644a108b0':
  Fix build break with uninitialized boost_fd.
  Improve cpuset support for surfaceflinger.
  liblog: printable do not escape tabs
  libutils: Add UNEXPECTED_NULL status_t
2015-11-19 16:30:32 +00:00
Ruchi Kandoi
e99972ac49 Merge "healthd: Support new PD and USB Type C types" am: ab75edb4ad am: 741df1263e
am: 6b1c15d7ff

* commit '6b1c15d7ffe95bc43cc160e3f81b6bf1f4629159':
  healthd: Support new PD and USB Type C types
2015-11-13 17:48:43 +00:00
Ruchi Kandoi
741df1263e Merge "healthd: Support new PD and USB Type C types"
am: ab75edb4ad

* commit 'ab75edb4ad01b518cb5c96a5a3d4ad344bc4ce26':
  healthd: Support new PD and USB Type C types
2015-11-13 17:39:54 +00:00
Benson Leung
8a4eef60e1 healthd: Support new PD and USB Type C types
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
2015-11-12 18:12:43 -08:00
Badhri Jagan Sridharan
42d9133a23 healthd: Read the max power supply voltage
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
2015-11-02 10:23:44 -08:00
Dan Albert
f362600488 Merge "Don\'t use libstdc++." am: f4e2045319 am: a9d3ab44e5
am: e506932fe9

* commit 'e506932fe91d81985b7af56f95bd6fbedeb064dc':
  Don't use libstdc++.
2015-10-23 16:20:10 +00:00
Dan Albert
e506932fe9 Merge "Don\'t use libstdc++." am: f4e2045319
am: a9d3ab44e5

* commit 'a9d3ab44e54129d92ef75488c28bd7f8c33cde72':
  Don't use libstdc++.
2015-10-23 16:16:22 +00:00
Dan Albert
a9d3ab44e5 Merge "Don\'t use libstdc++."
am: f4e2045319

* commit 'f4e204531933027000bd58a5a3366510fb471a27':
  Don't use libstdc++.
2015-10-23 16:13:12 +00:00
Dan Albert
82a6c845b0 Don't use libstdc++.
No one should be using libstdc++. All the cool projects use libc++.

Change-Id: Ifa357f0dcaba0b57e1af583baf2e40332c2b58d9
2015-10-23 08:46:20 -07:00
Ian Pedowitz
585ab65c58 Adding comment removed from failed merge (6acb240c)
Change-Id: Iace4c8512c6a4a26d36b98a5a3144e6836db1904
2015-10-12 19:01:00 -07:00
Ruchi Kandoi
6acb240c53 am 43ed8e15: am 08cf0e55: Merge "healthd: Adds fake battery properties for devices with no battery." into mnc-dr-dev
* commit '43ed8e152214094c453048948877b1b4c7b29e23':
  healthd: Adds fake battery properties for devices with no battery.
2015-10-13 00:20:08 +00:00
Ruchi Kandoi
42a981ddee healthd: Adds fake battery properties for devices with no battery.
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>
2015-10-12 14:31:58 -07:00
Ruchi Kandoi
f18ec9f227 healthd: Adds fake battery properties for devices with no battery.
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>
2015-10-09 13:18:09 -07:00
Mark Salyzyn
bc193c53ec healthd: logd: add timestamp to kernel logged battery messages
(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
2015-08-27 10:14:10 -07:00
Ruchi Kandoi
ef1bb411cb am 62729a1d: am 565e4c6a: Merge "healthd: Adds cycle_count, current_now and full_charge properties."
* commit '62729a1d195cd27b353da24be21bd0a855884431':
  healthd: Adds cycle_count, current_now and full_charge properties.
2015-08-26 03:47:33 +00:00
Ruchi Kandoi
9e8eb9930b am 62729a1d: am 565e4c6a: Merge "healthd: Adds cycle_count, current_now and full_charge properties."
* commit '62729a1d195cd27b353da24be21bd0a855884431':
  healthd: Adds cycle_count, current_now and full_charge properties.
2015-08-26 00:22:11 +00:00
Ruchi Kandoi
cc338801e4 healthd: Adds cycle_count, current_now and full_charge properties.
Bug: 22981343
Change-Id: I4b942b891f61e6bf12e3b23f4e0ada5b7f14fd83
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2015-08-24 13:01:16 -07:00
Mark Salyzyn
2be6ebbedb am e49aba54: am 95e7cb5b: Merge "healthd: logd: add timestamp to kernel logged battery messages"
* commit 'e49aba5413419bbc4f87889edd9a12956a932ef8':
  healthd: logd: add timestamp to kernel logged battery messages
2015-08-12 14:29:05 +00:00
Mark Salyzyn
1763d1aa78 am e49aba54: am 95e7cb5b: Merge "healthd: logd: add timestamp to kernel logged battery messages"
* commit 'e49aba5413419bbc4f87889edd9a12956a932ef8':
  healthd: logd: add timestamp to kernel logged battery messages
2015-08-12 14:29:01 +00:00
Mark Salyzyn
acb1ddf56c healthd: logd: add timestamp to kernel logged battery messages
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
2015-07-28 16:52:58 -07:00
Adrian Roos
d5fe6675a7 Show charging speed on Keyguard
Bug: 8099739
Change-Id: I2e5c21dd7ec028ce47fb03ab71e74f7fccaa9e36
2015-07-13 17:33:07 -07:00
Elliott Hughes
bbc7ca24da resolved conflicts for merge of 6e9b28b2 to master
Change-Id: Icd1bbc33283c504691934256a4cf5989868d3caf
2015-04-15 12:15:00 -07:00
Elliott Hughes
9e85ea1403 Move away from gr_surface.
Change-Id: Icfa81b18e5c99e3ffc5c55aba1d435eb26eb8680
2015-04-15 10:25:55 -07:00
Chih-Hung Hsieh
c49ceca278 Fix print format mismatch in 64-bit mode.
Change-Id: I7f0b0ed87e4e544517be66418ff76596a084976f
2015-02-24 10:50:41 -08:00
Elliott Hughes
35d70a2767 am 0e0fbdd1: am 492dd1e5: Merge "Remove obsolete BUILD_TINY_ANDROID check from healthd makefile"
* commit '0e0fbdd1fcef71e653ad2d988649f6259b304fc2':
  Remove obsolete BUILD_TINY_ANDROID check from healthd makefile
2015-01-24 16:58:25 +00:00
Elliott Hughes
0e0fbdd1fc am 492dd1e5: Merge "Remove obsolete BUILD_TINY_ANDROID check from healthd makefile"
* commit '492dd1e5c1c47bc8a804b58bed941c8eaa94d9a3':
  Remove obsolete BUILD_TINY_ANDROID check from healthd makefile
2015-01-24 05:33:56 +00:00
Trevor Drake
27d53d3d86 Remove obsolete BUILD_TINY_ANDROID check from healthd makefile
Change-Id: I7e23236e7725891d07368dd8ea8d667014d7dc78
2015-01-24 04:26:16 +00:00
Andreas Gampe
906ee0d757 am 38c3386a: resolved conflicts for merge of 03be4928 to lmp-mr1-dev-plus-aosp
* commit '38c3386a6cd44789f540fb9700c284345e7269e3':
  Healthd: Remove unused variables
2014-11-25 20:03:41 +00:00
Andreas Gampe
38c3386a6c resolved conflicts for merge of 03be4928 to lmp-mr1-dev-plus-aosp
Change-Id: I7c72ed2c54ceae19c9dfe8b2e1707f869faad110
2014-11-25 11:45:46 -08:00
Andreas Gampe
c0970d31f3 Healthd: Remove unused variables
For build-system CFLAGS clean-up, remove unused variables.

Change-Id: Ifc5884518bfdb744ea9823b98db544dbe59c20d2
2014-11-24 18:48:55 -08:00
Marco Nelissen
52b8898056 am e11d81b3: Merge "Update calls to IInterface::asBinder()"
* commit 'e11d81b37c119ec3d67c1fe60779d510d21e6a14':
  Update calls to IInterface::asBinder()
2014-11-17 18:24:57 +00:00
Marco Nelissen
99f00d5ff3 Update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
2014-11-17 10:06:42 -08:00
Marco Nelissen
26279a9ef1 Update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Idcf82bb8c0b4b141475abb5330b08409dc14a600
2014-11-14 14:01:40 -08:00
Ruchi Kandoi
9a11aaabf1 Charger: Improve screen on/off scenarios
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>
2014-10-22 22:01:27 +00:00
Ruchi Kandoi
a84b1f64cc Charger: Add a Charger to Android transition threshold
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>
2014-10-22 22:01:07 +00:00
Ruchi Kandoi
bdf11c76a3 healthd: Add callback for screen_on to the healthdHAL
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>
2014-09-26 14:37:17 -07:00
Ruchi Kandoi
ce6bfc93a1 am 301a907f: Merge "healthd: charger: Run animation even if capacity is 0" into lmp-dev
* commit '301a907f28570ff1627e30a37069e6c5ab6a4b75':
  healthd: charger: Run animation even if capacity is 0
2014-09-24 17:11:43 +00:00
Devin Kim
9b0d442385 healthd: charger: Run animation even if capacity is 0
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
2014-09-23 17:09:28 -07:00
Todd Poynor
ebeb0c0ea6 healthd: use warning level for info logs
To allow healthd/charger info to appear in systems where the loglevel
has been bumped to squelch chatty drivers.

Change-Id: I4ab135765700d7584a1ce5d972ea473d77f299f8
2014-09-23 15:05:07 -07:00
Todd Poynor
342a2264b9 healthd: charger: fix check for charger connected to enter suspend
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
2014-08-18 14:32:14 -07:00
Ruchi Kandoi
a78fc23491 healthd: Reports arbitrary numbers for capacity and temperature when
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
2014-07-11 01:19:28 +00:00
Colin Cross
d2b5bfa0cd healthd: fix 64-bit build
int64_t needs to be printed with PRId64

Change-Id: If59b60bac71856e4266d459d159a570961e7340a
2014-07-01 10:56:34 -07:00
Todd Poynor
a7300274fd charger: leave screen off when entered with very low battery
Change-Id: I28e3d6adaf4bb59d14eca7103d7b063d54a41c75
2014-06-30 13:25:53 -07:00
Riley Andrews
6bd4588d65 resolved conflicts for merge of 079c637f to master
Change-Id: Iab9a857026de954d7497d6b0eaf3751d2d3904c7
2014-06-23 15:20:51 -07:00
Ruchi Kandoi
9015eaa30f healthd: Avoid animation while not charging.
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
2014-06-23 11:16:36 -07:00
Ruchi Kandoi
4614f5097c resolved conflicts for merge of de7bdc94 to master
Change-Id: I6dc10c8220c0984b31a05534b576ca25afdf5383
2014-06-20 11:46:40 -07:00
Ruchi Kandoi
04db8a55b8 healthd: UEVENT_MSG_LEN is changed from 1048 to 2048 in compliance with
BUFFER_LEN in the kobject_uevent in kernel.

Change-Id: Ia9f4b520847d40fe4e032875dfb79bd063bc723d
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2014-06-19 13:16:50 -07:00
Todd Poynor
3db03a5ab0 healthd: Set fixed battery level and temperature via properties
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
2014-05-22 01:56:15 +00:00
Todd Poynor
e14b37eb07 healthd: Add hooks for ENERGY_COUNTER property
Bug: 10118565
Change-Id: Ibabae2a78a600ae37ce9b91da0f5980ee94b05c2
2014-05-20 16:26:48 -07:00
Todd Poynor
8f132af495 healthd: Add ENERGY_COUNTER property placeholder, and 64-bit properties
Will add healthd HAL support for ENERGY_COUNTER, and support in some HALs,
in following CLs.

Change-Id: Ife2eaa30473be3a59183c6ce61fdaa61f32dd01b
2014-05-16 03:05:47 +00:00