summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Blaesius <skate4life@gmx.de>2015-04-26 02:28:14 +0200
committerTom Marshall <tdm@cyngn.com>2015-11-25 15:35:47 -0800
commitf49b3e382af61e47f7652be03b7f989e72d03e3c (patch)
tree1b4fc4b36fd152c3035a2d13dd5e4d2d9d669146
parent22d36ae1a1fc4c540f308ead224509613425f511 (diff)
downloadbootable_recovery-f49b3e382af61e47f7652be03b7f989e72d03e3c.zip
bootable_recovery-f49b3e382af61e47f7652be03b7f989e72d03e3c.tar.gz
bootable_recovery-f49b3e382af61e47f7652be03b7f989e72d03e3c.tar.bz2
recovery: Allow devices to reboot to download mode
Change-Id: Ib6ccf98ed68efacbb3b8c8238945da60b23a20d7
-rw-r--r--Android.mk4
-rw-r--r--device.cpp4
-rw-r--r--recovery.cpp5
3 files changed, 13 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 83d31f0..2797d5a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -124,6 +124,10 @@ ifeq ($(TARGET_USE_MDTP), true)
LOCAL_CFLAGS += -DUSE_MDTP
endif
+ifeq ($(BOARD_HAS_DOWNLOAD_MODE), true)
+ LOCAL_CFLAGS += -DDOWNLOAD_MODE
+endif
+
ifneq ($(BOARD_RECOVERY_BLDRMSG_OFFSET),)
LOCAL_CFLAGS += -DBOARD_RECOVERY_BLDRMSG_OFFSET=$(BOARD_RECOVERY_BLDRMSG_OFFSET)
endif
diff --git a/device.cpp b/device.cpp
index c8b7954..0ac6b3f 100644
--- a/device.cpp
+++ b/device.cpp
@@ -18,7 +18,11 @@
static const char* MENU_ITEMS[] = {
"Reboot system now",
+#ifdef DOWNLOAD_MODE
+ "Reboot to download mode",
+#else
"Reboot to bootloader",
+#endif
"Apply update",
"Wipe data/factory reset",
"Wipe cache partition",
diff --git a/recovery.cpp b/recovery.cpp
index cdf1de3..e36e7d9 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -1521,8 +1521,13 @@ main(int argc, char **argv) {
break;
case Device::REBOOT_BOOTLOADER:
+#ifdef DOWNLOAD_MODE
+ ui->Print("Rebooting to download mode...\n");
+ property_set(ANDROID_RB_PROPERTY, "reboot,download");
+#else
ui->Print("Rebooting to bootloader...\n");
property_set(ANDROID_RB_PROPERTY, "reboot,bootloader");
+#endif
break;
default: