Commit graph

89 commits

Author SHA1 Message Date
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
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
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
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
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
db04a49a6f healthd: init members of BatteryMonitor.
Bug: 26879394
Change-Id: I09a6c78137f91a0c88bf4ba1e8890b4ec31dcf2c
2016-02-16 17:19:23 -08: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
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
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
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
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
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
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
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