Auto-detect whether to use the long-press UI.

Change-Id: Ie77a5584e301467c6a5e164d2c62d6f036b2c0c0
This commit is contained in:
Elliott Hughes
2015-04-10 15:00:34 -07:00
parent 51697d2781
commit 4af215b2c3
6 changed files with 56 additions and 41 deletions

View File

@@ -17,33 +17,6 @@
#include "device.h"
#include "screen_ui.h"
class DefaultDevice : public Device {
public:
DefaultDevice() : Device(new ScreenRecoveryUI) {
}
// TODO: make this handle more cases, and move the default implementation into Device too.
int HandleMenuKey(int key, int visible) {
if (visible) {
switch (key) {
case KEY_DOWN:
case KEY_VOLUMEDOWN:
return kHighlightDown;
case KEY_UP:
case KEY_VOLUMEUP:
return kHighlightUp;
case KEY_ENTER:
case KEY_POWER:
return kInvokeItem;
}
}
return kNoAction;
}
};
Device* make_device() {
return new DefaultDevice;
return new Device(new ScreenRecoveryUI);
}