From efe54f8d53c50718cc6fd48b59f0a06399edd1a0 Mon Sep 17 00:00:00 2001 From: Pawit Pornkitprasan Date: Tue, 18 Nov 2014 22:36:32 +0700 Subject: charger: allow home button to wake A squashed commit of the following: commit 6ce21d726a967b2cc942476758b9ab3851ff39f1 Author: Pawit Pornkitprasan 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 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 --- healthd/healthd_mode_charger.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'healthd') 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; -- cgit v1.2.3