Commit graph

347 commits

Author SHA1 Message Date
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
Colin Cross
e1d5247e00 healthd: fix warnings
Fix a few warnings missed when turning on -Werror

Change-Id: I5728664a90d33b95ab3d6ea8823244c59643aedc
2014-05-15 17:49:06 -07:00
Mark Salyzyn
6f5b47f914 healthd: Turn on -Werror
Change-Id: I72caf38008ee7d842dfacd3f58add9bc8e4787e8
2014-05-15 15:46:15 -07:00
Natalie Silvanovich
3e6d3319b2 NULL check in registerListener
Prevents crash in batteryproperties. Now with two times as much NULL checking.

Bug: 13730158
Change-Id: Ica083da60c6543431c2d82d46aed48eaccc3b4b4
2014-04-30 15:49:37 -07:00
Sasha Levitskiy
e2acb82a94 am 43cb7ae6: am 4f362e43: am 835526fd: Merge "Cleanup: warning fixit."
* commit '43cb7ae6c31ced8cd518eab59dfea31ab1ade812':
  Cleanup: warning fixit.
2014-04-12 00:02:33 +00:00
Sasha Levitskiy
cdc1cfb3e5 Cleanup: warning fixit.
bootable/recovery has a dependent commit: I9adb470b04e4301989d128c9c3097b21b4dea431

Change-Id: Icf23e659265d71d5226d527c2b40cfbc132320ee
Signed-off-by: Sasha Levitskiy <sanek@google.com>
2014-04-11 16:15:46 -07:00
Paul Lawrence
347c8de285 healthd: Add battery capacity to getProperty
Add support for BATTERY_PROP_CAPACITY property in getProperty

Bug: 11985952
Change-Id: I905cda68f990fa96138a16a11c55f2d902d0bbc1
2014-03-20 18:16:14 -07:00
Doug Zongker
2f10b6bc23 am 706d57b2: am 769c6452: update minui library call
* commit '706d57b2948cc2eec22dc16394cf5582586b4237':
  update minui library call
2014-03-18 00:15:27 +00:00
Doug Zongker
ee6ef15e67 remove pixelflinger from healthd
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
2014-03-11 12:25:41 -07:00
Colin Cross
1c38f5d958 resolved conflicts for merge of 1fef485f to master
Change-Id: If402e68292a183064afe35cb77a4437682ee373a
2014-02-13 13:34:37 -08:00
Todd Poynor
cd7c10438a healthd: charger mode dump previous console from pstore
Change-Id: Id65ffe4f80aa870a1d1f3f3d67c3bb687490c27f
2013-12-10 22:22:43 +00:00
Todd Poynor
1c3d3cdea1 healthd: fix runstring option error reporting
Change-Id: I548d837afbde8a66826bb2cdb79ede7edda42b1f
2013-11-21 11:28:12 -08:00
Todd Poynor
c15e993467 healthd: remove/rearrange extra battery property handling
Change-Id: I6cc1570e23c1c1468f08579f633997e95327347a
2013-10-22 18:21:27 -07:00
Todd Poynor
9b53cf79af healthd: remove service batterypropreg
Change-Id: Iac24af6a59453686fca145d0814dc5ff045efcec
2013-10-22 17:56:21 -07:00
Todd Poynor
f0e2ac2642 healthd: rename service batterypropreg => batteryproperties
Part 1 of 2 (to avoid transitory runtime crashes).

Change-Id: I40d990ef7ee18cea99e5add39738bbe9fd5701ca
2013-10-22 17:50:59 -07:00
Todd Poynor
020369d872 healthd: BatteryService dumpstate support
Change-Id: Ia6938b7126751801310632c995af0f96e41f5f64
2013-10-22 16:32:54 -07:00
Todd Poynor
6dcc45ed6d healthd: Fixups for systems without batteries or removable batteries
* 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
2013-10-22 11:15:50 -07:00
Todd Poynor
2e227fbc5a healthd: start switchover to BatteryExtraProperties
Change-Id: I47a24d4284f502858ee929b2cda8881165ef4ef3
2013-09-30 15:36:44 -07:00
Ying Wang
c4d6ade839 Install the nonexistent-source symlink as a post-install step
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
2013-09-20 10:37:42 -07:00
Todd Poynor
fea5b4d44b healthd: move charger executable to healthd charger mode
* 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
2013-09-17 14:41:07 -07:00
Todd Poynor
c7464c9150 healthd: move Android communication code to separate source
* 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
2013-09-17 14:41:07 -07:00
Todd Poynor
98c23d82f0 healthd: add register event interface
Facilitates registering events from external source files.

Add epoll events param to callbacks.

Change-Id: Icf8fb0c62af11453cbcc92877ff2c3bc03b9bb1b
2013-09-17 14:41:07 -07:00
Todd Poynor
7b27f27d3d healthd: break link between BatteryMonitor and BatteryPropertiesRegistrar
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
2013-09-17 11:18:36 -07:00
Todd Poynor
47f284af49 am ee549d25: am ff9ec2d9: healthd: perform periodic chores when awake and on battery power
* commit 'ee549d256f50ca3078a8537fa5b32a3f86295ea5':
  healthd: perform periodic chores when awake and on battery power
2013-09-09 16:54:49 -07:00
Todd Poynor
ff9ec2d999 healthd: perform periodic chores when awake and on battery power
Monitor battery/charging status at normal awake rate when on battery
power.

Bug: 10650797
Change-Id: I914d24af4963ab9d52b03c0a2615ad653ced9b12
2013-09-09 14:49:53 -07:00
Todd Poynor
bc10211184 healthd: Add average current property
Change-Id: Ibc901fe1b550c0d72095ef5590e2db8962d1a7b2
2013-09-04 17:41:57 -07:00
Todd Poynor
c133b7198a healthd: read individual battery property value on demand
Adding support for batteryChargeCounter and batteryCurrentNow as parameters
likely to be useful for power consumption analysis.

Change-Id: Ib23b05d3c31c22ece0d21e55cc481c1b5dabe59e
2013-08-22 02:00:26 +00:00
Todd Poynor
f5d3012d2c healthd: Move power_supply attribute paths to healthd_config
Allow health HAL to select specific paths to be used, overriding
default search for arbitrary power supplies with the named paths.

Change-Id: I5f724739f58ef56087ab592b7403fc083db8f173
2013-08-14 02:27:54 +00:00
Todd Poynor
d65104ca31 healthd: switch to HAL static libraries
Change-Id: I5a802f9b9a8ad4782c4d0c6376a068aef32a70cb
2013-08-13 16:09:12 -07:00
Todd Poynor
a41611f638 healthd: fix botched logging call
Change-Id: Ibf5e28c657e0d9d193b266acd7b2912bebc3e71f
2013-08-12 12:18:36 -07:00
Todd Poynor
57fd0989cb healthd: preserve uA and uAh units for current_now and charge_counter
Change-Id: I20b3f47c541c4321b0593e504090ad6573b9cb01
2013-08-09 21:52:25 +00:00
Todd Poynor
9face5cad5 healthd: create healthd_board_init()
Subsume healthd_board_poll_intervals, make clear the call is for init-time
actions.

Change-Id: I9267e4ce7c62b78d2997a43822f20bfa13b54cd8
2013-08-08 12:26:36 -07:00
Todd Poynor
10b235e743 healthd: add health HAL support
Adds board-specific battery monitoring capabilities:

* processing of battery property values and additional charging logic.
* adjusted (or removed) polling intervals.
* replaced (or removed) battery status heartbeat in kernel log.

Change-Id: Ia77bca8dc92c6c2a51afa65d516cacca08da73ac
2013-08-07 18:57:37 -07:00
Todd Poynor
b45f1f5bd0 healthd: add optional current_now and charge_counter to tracked state
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
2013-08-07 18:34:34 +00:00
Todd Poynor
752faf2c18 healthd: Add system health monitoring daemon
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
2013-07-26 01:30:42 +00:00