summaryrefslogtreecommitdiffstats
path: root/healthd
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2014-10-22 14:16:35 -0700
committerRuchi Kandoi <kandoiruchi@google.com>2014-10-22 22:01:27 +0000
commit9a11aaabf1ef8722c41d1057312be7a716badd66 (patch)
treea8b750252f338d03ef95a5a639e5108da91038c5 /healthd
parenta84b1f64ccc5dda8e31854d4fc206b6c3d27ec39 (diff)
downloadsystem_core-9a11aaabf1ef8722c41d1057312be7a716badd66.zip
system_core-9a11aaabf1ef8722c41d1057312be7a716badd66.tar.gz
system_core-9a11aaabf1ef8722c41d1057312be7a716badd66.tar.bz2
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>
Diffstat (limited to 'healthd')
-rw-r--r--healthd/healthd_mode_charger.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp
index 6cf9dff..e7fccab 100644
--- a/healthd/healthd_mode_charger.cpp
+++ b/healthd/healthd_mode_charger.cpp
@@ -537,11 +537,16 @@ static void process_key(struct charger *charger, int code, int64_t now)
* make sure we wake up at the right-ish time to check
*/
set_next_key_check(charger, key, POWER_ON_KEY_TIME);
+
+ /* Turn on the display and kick animation on power-key press
+ * rather than on key release
+ */
+ kick_animation(charger->batt_anim);
+ request_suspend(false);
}
} else {
/* if the power key got released, force screen state cycle */
if (key->pending) {
- request_suspend(false);
kick_animation(charger->batt_anim);
}
}
@@ -564,6 +569,11 @@ static void handle_power_supply_state(struct charger *charger, int64_t now)
return;
if (!charger->charger_connected) {
+
+ /* Last cycle would have stopped at the extreme top of battery-icon
+ * Need to show the correct level corresponding to capacity.
+ */
+ kick_animation(charger->batt_anim);
request_suspend(false);
if (charger->next_pwr_check == -1) {
charger->next_pwr_check = now + UNPLUGGED_SHUTDOWN_TIME;