aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2015-04-10 17:00:34 -0500
committerElliott Hughes2015-04-10 17:14:35 -0500
commit4af215b2c35b41e983753256ad6dbebbf879c982 (patch)
treef327758d07cdb58a8e4a06f236f82f8df9515992 /default_device.cpp
parent51697d2781501c30d8db6d2a8e6c2becebcffad8 (diff)
downloadplatform-bootable-recovery-4af215b2c35b41e983753256ad6dbebbf879c982.tar.gz
platform-bootable-recovery-4af215b2c35b41e983753256ad6dbebbf879c982.tar.xz
platform-bootable-recovery-4af215b2c35b41e983753256ad6dbebbf879c982.zip
Auto-detect whether to use the long-press UI.
Change-Id: Ie77a5584e301467c6a5e164d2c62d6f036b2c0c0
Diffstat (limited to 'default_device.cpp')
-rw-r--r--default_device.cpp29
1 files changed, 1 insertions, 28 deletions
diff --git a/default_device.cpp b/default_device.cpp
index d7dd4528..a9718668 100644
--- a/default_device.cpp
+++ b/default_device.cpp
@@ -17,33 +17,6 @@
17#include "device.h" 17#include "device.h"
18#include "screen_ui.h" 18#include "screen_ui.h"
19 19
20class DefaultDevice : public Device {
21 public:
22 DefaultDevice() : Device(new ScreenRecoveryUI) {
23 }
24
25 // TODO: make this handle more cases, and move the default implementation into Device too.
26 int HandleMenuKey(int key, int visible) {
27 if (visible) {
28 switch (key) {
29 case KEY_DOWN:
30 case KEY_VOLUMEDOWN:
31 return kHighlightDown;
32
33 case KEY_UP:
34 case KEY_VOLUMEUP:
35 return kHighlightUp;
36
37 case KEY_ENTER:
38 case KEY_POWER:
39 return kInvokeItem;
40 }
41 }
42
43 return kNoAction;
44 }
45};
46
47Device* make_device() { 20Device* make_device() {
48 return new DefaultDevice; 21 return new Device(new ScreenRecoveryUI);
49} 22}