summaryrefslogtreecommitdiffstats
path: root/ui.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-11 01:03:07 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-11 01:03:07 +0200
commit68dfb5a9365adfa5bfb3cc8834b07c2bd00f9799 (patch)
treef327758d07cdb58a8e4a06f236f82f8df9515992 /ui.cpp
parentam a90ba39b: am 51697d27: Merge "Switch minadb over to C++." (diff)
parentam f19007a5: Merge "Auto-detect whether to use the long-press UI." (diff)
downloadandroid_bootable_recovery-68dfb5a9365adfa5bfb3cc8834b07c2bd00f9799.tar
android_bootable_recovery-68dfb5a9365adfa5bfb3cc8834b07c2bd00f9799.tar.gz
android_bootable_recovery-68dfb5a9365adfa5bfb3cc8834b07c2bd00f9799.tar.bz2
android_bootable_recovery-68dfb5a9365adfa5bfb3cc8834b07c2bd00f9799.tar.lz
android_bootable_recovery-68dfb5a9365adfa5bfb3cc8834b07c2bd00f9799.tar.xz
android_bootable_recovery-68dfb5a9365adfa5bfb3cc8834b07c2bd00f9799.tar.zst
android_bootable_recovery-68dfb5a9365adfa5bfb3cc8834b07c2bd00f9799.zip
Diffstat (limited to 'ui.cpp')
-rw-r--r--ui.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui.cpp b/ui.cpp
index 064890ea4..dbe5c5164 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -278,6 +278,10 @@ bool RecoveryUI::IsLongPress() {
return result;
}
+bool RecoveryUI::HasThreeButtons() {
+ return has_power_key && has_up_key && has_down_key;
+}
+
void RecoveryUI::FlushKeys() {
pthread_mutex_lock(&key_queue_mutex);
key_queue_len = 0;
@@ -290,7 +294,7 @@ RecoveryUI::KeyAction RecoveryUI::CheckKey(int key, bool is_long_press) {
pthread_mutex_unlock(&key_queue_mutex);
// If we have power and volume up keys, that chord is the signal to toggle the text display.
- if (has_power_key && has_up_key) {
+ if (HasThreeButtons()) {
if (key == KEY_VOLUMEUP && IsKeyPressed(KEY_POWER)) {
return TOGGLE;
}