summaryrefslogtreecommitdiffstats
path: root/healthd
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2014-11-18 22:36:32 +0700
committerSteve Kondik <steve@cyngn.com>2015-10-30 16:58:58 -0700
commitefe54f8d53c50718cc6fd48b59f0a06399edd1a0 (patch)
treebf6bcef2dc2cf95028781bf2e25095c2bd104248 /healthd
parent20711f93debf634e441856f693407ec20b77b1a8 (diff)
downloadsystem_core-efe54f8d53c50718cc6fd48b59f0a06399edd1a0.tar.gz
system_core-efe54f8d53c50718cc6fd48b59f0a06399edd1a0.tar.bz2
system_core-efe54f8d53c50718cc6fd48b59f0a06399edd1a0.zip
charger: allow home button to wake
A squashed commit of the following: commit 6ce21d726a967b2cc942476758b9ab3851ff39f1 Author: Pawit Pornkitprasan <p.pawit@gmail.com> Date: Sun Feb 3 22:21:32 2013 +0700 charger: do not suspend when handling home When using Google's suspend implementation, home press should also wake the device from suspend Change-Id: I51f3e45c5cb418b0b3718e7223a1336876379043 commit 75a7cf84df719d8cf5cd77093b3f9fee3c09017e Author: Pawit Pornkitprasan <p.pawit@gmail.com> Date: Sat Jul 21 22:09:37 2012 +0700 charger: allow home button to wake On certain devices (e.g. galaxysmtd), the user expects the physical home button to be able to wake the device as well as the power button. Change-Id: If764f36aba3810dfa5233af8baf0a740b04889e0 Change-Id: I362b227e26bc864a2cad471df799bce2d682ecee
Diffstat (limited to 'healthd')
-rw-r--r--healthd/healthd_mode_charger.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp
index e4e16322e..d82559c84 100644
--- a/healthd/healthd_mode_charger.cpp
+++ b/healthd/healthd_mode_charger.cpp
@@ -639,6 +639,11 @@ static void process_key(struct charger *charger, int code, int64_t now)
}
}
}
+ } else {
+ if (key->pending) {
+ request_suspend(false);
+ kick_animation(charger->batt_anim);
+ }
}
key->pending = false;
@@ -647,6 +652,7 @@ static void process_key(struct charger *charger, int code, int64_t now)
static void handle_input_state(struct charger *charger, int64_t now)
{
process_key(charger, KEY_POWER, now);
+ process_key(charger, KEY_HOME, now);
if (charger->next_key_check != -1 && now > charger->next_key_check)
charger->next_key_check = -1;