diff options
-rw-r--r-- | Android.mk | 4 | ||||
-rw-r--r-- | device.cpp | 54 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-b+sr+Latn/strings.xml | 8 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-be-rBY/strings.xml | 8 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-bs-rBA/strings.xml | 8 |
5 files changed, 56 insertions, 26 deletions
diff --git a/Android.mk b/Android.mk index 65d123a86..9a064f236 100644 --- a/Android.mk +++ b/Android.mk @@ -93,6 +93,10 @@ ifeq ($(TARGET_USERIMAGES_USE_EXT4), true) LOCAL_STATIC_LIBRARIES += libext4_utils_static libz endif +ifeq ($(AB_OTA_UPDATER),true) + LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 +endif + LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin ifeq ($(TARGET_RECOVERY_UI_LIB),) diff --git a/device.cpp b/device.cpp index 2465b0778..f8fbb8a49 100644 --- a/device.cpp +++ b/device.cpp @@ -16,6 +16,29 @@ #include "device.h" +#if defined(AB_OTA_UPDATER) + +static const char* MENU_ITEMS[] = { + "Reboot system now", + "Reboot to bootloader", + "Wipe data/factory reset", + "Mount /system", + "Run graphics test", + "Power off", + NULL, +}; + +static const Device::BuiltinAction MENU_ACTIONS[] = { + Device::REBOOT, + Device::REBOOT_BOOTLOADER, + Device::WIPE_DATA, + Device::MOUNT_SYSTEM, + Device::RUN_GRAPHICS_TEST, + Device::SHUTDOWN, +}; + +#else + static const char* MENU_ITEMS[] = { "Reboot system now", "Reboot to bootloader", @@ -27,27 +50,30 @@ static const char* MENU_ITEMS[] = { "View recovery logs", "Run graphics test", "Power off", - NULL + NULL, }; +static const Device::BuiltinAction MENU_ACTIONS[] = { + Device::REBOOT, + Device::REBOOT_BOOTLOADER, + Device::APPLY_ADB_SIDELOAD, + Device::APPLY_SDCARD, + Device::WIPE_DATA, + Device::WIPE_CACHE, + Device::MOUNT_SYSTEM, + Device::VIEW_RECOVERY_LOGS, + Device::RUN_GRAPHICS_TEST, + Device::SHUTDOWN, +}; + +#endif + const char* const* Device::GetMenuItems() { return MENU_ITEMS; } Device::BuiltinAction Device::InvokeMenuItem(int menu_position) { - switch (menu_position) { - case 0: return REBOOT; - case 1: return REBOOT_BOOTLOADER; - case 2: return APPLY_ADB_SIDELOAD; - case 3: return APPLY_SDCARD; - case 4: return WIPE_DATA; - case 5: return WIPE_CACHE; - case 6: return MOUNT_SYSTEM; - case 7: return VIEW_RECOVERY_LOGS; - case 8: return RUN_GRAPHICS_TEST; - case 9: return SHUTDOWN; - default: return NO_ACTION; - } + return menu_position < 0 ? NO_ACTION : MENU_ACTIONS[menu_position]; } int Device::HandleMenuKey(int key, int visible) { diff --git a/tools/recovery_l10n/res/values-b+sr+Latn/strings.xml b/tools/recovery_l10n/res/values-b+sr+Latn/strings.xml index c2d8f2239..6f433e39d 100644 --- a/tools/recovery_l10n/res/values-b+sr+Latn/strings.xml +++ b/tools/recovery_l10n/res/values-b+sr+Latn/strings.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="recovery_installing" msgid="2013591905463558223">"Ažuriranje sistema se instalira"</string> - <string name="recovery_erasing" msgid="7334826894904037088">"Briše se"</string> - <string name="recovery_no_command" msgid="4465476568623024327">"Nema komande"</string> + <string name="recovery_installing" msgid="4995089002339765600">"Instaliranje ažuriranja sistema..."</string> + <string name="recovery_erasing" msgid="3454811999717520920">"Brisanje..."</string> + <string name="recovery_no_command" msgid="3005798864326873414">"Nema komande."</string> <string name="recovery_error" msgid="5748178989622716736">"Greška!"</string> - <string name="recovery_installing_security" msgid="9184031299717114342">"Instalira se bezbednosno ažuriranje"</string> + <string name="recovery_installing_security" msgid="241961948312007086">"Instalira se bezbednosno ažuriranje…"</string> </resources> diff --git a/tools/recovery_l10n/res/values-be-rBY/strings.xml b/tools/recovery_l10n/res/values-be-rBY/strings.xml index 7c0954d31..5decf8130 100644 --- a/tools/recovery_l10n/res/values-be-rBY/strings.xml +++ b/tools/recovery_l10n/res/values-be-rBY/strings.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="recovery_installing" msgid="2013591905463558223">"Усталёўка абнаўлення сістэмы"</string> - <string name="recovery_erasing" msgid="7334826894904037088">"Сціранне"</string> - <string name="recovery_no_command" msgid="4465476568623024327">"Няма каманды"</string> + <string name="recovery_installing" msgid="4995089002339765600">"Усталёўка абнаўлення сістэмы..."</string> + <string name="recovery_erasing" msgid="3454811999717520920">"Выдаленне..."</string> + <string name="recovery_no_command" msgid="3005798864326873414">"Няма каманды"</string> <string name="recovery_error" msgid="5748178989622716736">"Памылка"</string> - <string name="recovery_installing_security" msgid="9184031299717114342">"Усталёўка абнаўлення сістэмы бяспекі"</string> + <string name="recovery_installing_security" msgid="241961948312007086">"Усталёўка абнаўлення сістэмы бяспекі..."</string> </resources> diff --git a/tools/recovery_l10n/res/values-bs-rBA/strings.xml b/tools/recovery_l10n/res/values-bs-rBA/strings.xml index 412cf0276..8b6202a1e 100644 --- a/tools/recovery_l10n/res/values-bs-rBA/strings.xml +++ b/tools/recovery_l10n/res/values-bs-rBA/strings.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="recovery_installing" msgid="2013591905463558223">"Ažuriranje sistema…"</string> - <string name="recovery_erasing" msgid="7334826894904037088">"Brisanje u toku"</string> - <string name="recovery_no_command" msgid="4465476568623024327">"Nema komande"</string> + <string name="recovery_installing" msgid="4995089002339765600">"Sistem se ažurira…"</string> + <string name="recovery_erasing" msgid="3454811999717520920">"Briše se…"</string> + <string name="recovery_no_command" msgid="3005798864326873414">"Nema komande."</string> <string name="recovery_error" msgid="5748178989622716736">"Greška!"</string> - <string name="recovery_installing_security" msgid="9184031299717114342">"Instaliranje sigurnosnog ažuriranja…"</string> + <string name="recovery_installing_security" msgid="241961948312007086">"Instaliranje sigurnosnog ažuriranja…"</string> </resources> |