Commit graph

95 commits

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