Commit graph

135 commits

Author SHA1 Message Date
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