mirror of
https://github.com/followmsi/android_device_asus_deb.git
synced 2024-11-06 22:06:28 +00:00
use the default recovery UI
The key handling we use for deb is now the recovery default; we no longer need a subclass of ScreenRecoveryUI. Change-Id: I6ce2a48c66f3360a32c3aa8ba92f30d40c2bbe3f
This commit is contained in:
parent
ab3f53f809
commit
a0503cd905
1 changed files with 1 additions and 27 deletions
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue