diff options
author | Andreas Blaesius <skate4life@gmx.de> | 2015-04-26 02:28:14 +0200 |
---|---|---|
committer | Tom Marshall <tdm@cyngn.com> | 2015-11-25 15:35:47 -0800 |
commit | f49b3e382af61e47f7652be03b7f989e72d03e3c (patch) | |
tree | 1b4fc4b36fd152c3035a2d13dd5e4d2d9d669146 | |
parent | 22d36ae1a1fc4c540f308ead224509613425f511 (diff) | |
download | bootable_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.mk | 4 | ||||
-rw-r--r-- | device.cpp | 4 | ||||
-rw-r--r-- | recovery.cpp | 5 |
3 files changed, 13 insertions, 0 deletions
@@ -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 @@ -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: |