Merge "use the default recovery UI"

This commit is contained in:
Doug Zongker 2013-09-04 22:22:12 +00:00 committed by Android (Google) Code Review
commit da01bf42be

View file

@ -34,37 +34,11 @@ const char* ITEMS[] = { "reboot system now",
"wipe cache partition",
NULL };
class DebUI : public ScreenRecoveryUI
{
public:
DebUI() :
consecutive_power_keys(0) {
}
virtual KeyAction CheckKey(int key) {
if (IsKeyPressed(KEY_POWER) && key == KEY_VOLUMEUP) {
return TOGGLE;
}
if (key == KEY_POWER) {
++consecutive_power_keys;
if (consecutive_power_keys >= 7) {
return REBOOT;
}
} else {
consecutive_power_keys = 0;
}
return ENQUEUE;
}
private:
int consecutive_power_keys;
};
class DebDevice : public Device
{
public:
DebDevice() :
ui(new DebUI) {
ui(new ScreenRecoveryUI) {
}
RecoveryUI* GetUI() { return ui; }