summaryrefslogtreecommitdiffstats
path: root/ui.h
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2012-12-18 18:14:06 +0100
committerAndroid Git Automerger <android-git-automerger@android.com>2012-12-18 18:14:06 +0100
commit2ad5d91b1c1b631563f502a54de69ef6773a55db (patch)
tree3d1afd2c9224f6edb3e343c2e4a3f00b785f0452 /ui.h
parentam 9028fb4d: Merge "Pass the correct pointer to munmap on failure." (diff)
parentam bb01d0c1: add NextCheckKeyIsLong() and EnqueueKey() methods (diff)
downloadandroid_bootable_recovery-2ad5d91b1c1b631563f502a54de69ef6773a55db.tar
android_bootable_recovery-2ad5d91b1c1b631563f502a54de69ef6773a55db.tar.gz
android_bootable_recovery-2ad5d91b1c1b631563f502a54de69ef6773a55db.tar.bz2
android_bootable_recovery-2ad5d91b1c1b631563f502a54de69ef6773a55db.tar.lz
android_bootable_recovery-2ad5d91b1c1b631563f502a54de69ef6773a55db.tar.xz
android_bootable_recovery-2ad5d91b1c1b631563f502a54de69ef6773a55db.tar.zst
android_bootable_recovery-2ad5d91b1c1b631563f502a54de69ef6773a55db.zip
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui.h b/ui.h
index acb57663e..aca7b7b87 100644
--- a/ui.h
+++ b/ui.h
@@ -19,6 +19,7 @@
#include <linux/input.h>
#include <pthread.h>
+#include <time.h>
// Abstract class for controlling the user interface during recovery.
class RecoveryUI {
@@ -79,6 +80,8 @@ class RecoveryUI {
enum KeyAction { ENQUEUE, TOGGLE, REBOOT, IGNORE };
virtual KeyAction CheckKey(int key);
+ virtual void NextCheckKeyIsLong(bool is_long_press);
+
// --- menu display ---
// Display some header text followed by a menu of items, which appears
@@ -95,6 +98,9 @@ class RecoveryUI {
// statements will be displayed.
virtual void EndMenu() = 0;
+protected:
+ void EnqueueKey(int key_code);
+
private:
// Key event input queue
pthread_mutex_t key_queue_mutex;
@@ -102,6 +108,7 @@ private:
int key_queue[256], key_queue_len;
char key_pressed[KEY_MAX + 1]; // under key_queue_mutex
int key_last_down; // under key_queue_mutex
+ clock_t key_down_time; // under key_queue_mutex
int rel_sum;
pthread_t input_t;