aboutsummaryrefslogtreecommitdiffstats
path: root/ui.h
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2011-10-31 09:34:15 -0700
committerDoug Zongker <dougz@android.com>2011-10-31 15:51:07 -0700
commitdaefc1d442fb421606680feb9aeb59c133f4c427 (patch)
tree71b64ebdd66540aca7a523c73a47626ca519d039 /ui.h
parentb88aea8a89f9d3344022cdfe895397baac6c05e7 (diff)
downloadbootable_recovery-daefc1d442fb421606680feb9aeb59c133f4c427.zip
bootable_recovery-daefc1d442fb421606680feb9aeb59c133f4c427.tar.gz
bootable_recovery-daefc1d442fb421606680feb9aeb59c133f4c427.tar.bz2
C++ class for device-specific code
Replace the device-specific functions with a class. Move some of the key handling (for log visibility toggling and rebooting) into the UI class. Fix up the key handling so there is less crosstalk between the immediate keys and the queued keys (an increasing annoyance on button-limited devices). Change-Id: I698f6fd21c67a1e55429312a0484b6c393cad46f
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 6150bfd..3ca99a6 100644
--- a/ui.h
+++ b/ui.h
@@ -64,6 +64,13 @@ class RecoveryUI {
// Erase any queued-up keys.
virtual void FlushKeys() = 0;
+ // Called on each keypress, even while operations are in progress.
+ // Return value indicates whether an immediate operation should be
+ // triggered (toggling the display, rebooting the device), or if
+ // the key should be enqueued for use by the main thread.
+ enum KeyAction { ENQUEUE, TOGGLE, REBOOT };
+ virtual KeyAction CheckKey(int key) = 0;
+
// --- menu display ---
// Display some header text followed by a menu of items, which appears