From 02abde50851f66196c74d215150014f1378cb853 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 1 Apr 2014 09:45:24 -0700 Subject: remove DefaultDevice's UI subclass RecoveryUI (which is the superclass of ScreenRecoveryUI), provides a basic CheckKey method that is useful for devices that have KEY_POWER, KEY_VOLUMEUP, and KEY_VOLUMEDOWN. Stop overriding it with a less featureful method; with this no recovery UI customization is needed for most handheld devices (phones, tablets, etc.). Change-Id: I7d57cfaaef79afea8af4fc3dbc570afc61aeb5bc --- default_device.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'default_device.cpp') diff --git a/default_device.cpp b/default_device.cpp index 648eaec4e..1f181318e 100644 --- a/default_device.cpp +++ b/default_device.cpp @@ -31,20 +31,10 @@ static const char* ITEMS[] = {"reboot system now", "wipe cache partition", NULL }; -class DefaultUI : public ScreenRecoveryUI { - public: - virtual KeyAction CheckKey(int key) { - if (key == KEY_HOME) { - return TOGGLE; - } - return ENQUEUE; - } -}; - class DefaultDevice : public Device { public: DefaultDevice() : - ui(new DefaultUI) { + ui(new ScreenRecoveryUI) { } RecoveryUI* GetUI() { return ui; } @@ -61,6 +51,7 @@ class DefaultDevice : public Device { return kHighlightUp; case KEY_ENTER: + case KEY_POWER: return kInvokeItem; } } -- cgit v1.2.3 From 8d9d3d5cbe240d09db10d08956d152dce934e892 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 1 Apr 2014 13:20:23 -0700 Subject: add reboot-to-bootloader and power down options to recovery menu Useful when debugging or developing for recovery. Change-Id: Ic3ab42d5e848ad3488f1c575339b55e45c8a024b --- default_device.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'default_device.cpp') diff --git a/default_device.cpp b/default_device.cpp index 1f181318e..a25f05f8e 100644 --- a/default_device.cpp +++ b/default_device.cpp @@ -29,6 +29,8 @@ static const char* ITEMS[] = {"reboot system now", "apply update from ADB", "wipe data/factory reset", "wipe cache partition", + "reboot to bootloader", + "power down", NULL }; class DefaultDevice : public Device { @@ -65,6 +67,8 @@ class DefaultDevice : public Device { case 1: return APPLY_ADB_SIDELOAD; case 2: return WIPE_DATA; case 3: return WIPE_CACHE; + case 4: return REBOOT_BOOTLOADER; + case 5: return SHUTDOWN; default: return NO_ACTION; } } -- cgit v1.2.3 From b8344b6f5908935ac2e36109c7433fde34646620 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Wed, 22 Oct 2014 18:38:48 -0700 Subject: Make /cache/recovery/last_log available in recovery Create a new recovery UI option to allow the user to view /cache/recovery/last_log for their device. This gives enhanced debugging information which may be necessary when a failed OTA occurs. Bug: 18094012 Change-Id: Ic3228de96e9bfc2a0141c7aab4ce392a38140cf3 --- default_device.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'default_device.cpp') diff --git a/default_device.cpp b/default_device.cpp index a25f05f8e..97806ac58 100644 --- a/default_device.cpp +++ b/default_device.cpp @@ -31,6 +31,7 @@ static const char* ITEMS[] = {"reboot system now", "wipe cache partition", "reboot to bootloader", "power down", + "view recovery logs", NULL }; class DefaultDevice : public Device { @@ -69,6 +70,7 @@ class DefaultDevice : public Device { case 3: return WIPE_CACHE; case 4: return REBOOT_BOOTLOADER; case 5: return SHUTDOWN; + case 6: return READ_RECOVERY_LASTLOG; default: return NO_ACTION; } } -- cgit v1.2.3