From f49b3e382af61e47f7652be03b7f989e72d03e3c Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Sun, 26 Apr 2015 02:28:14 +0200 Subject: recovery: Allow devices to reboot to download mode Change-Id: Ib6ccf98ed68efacbb3b8c8238945da60b23a20d7 --- Android.mk | 4 ++++ device.cpp | 4 ++++ recovery.cpp | 5 +++++ 3 files changed, 13 insertions(+) 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: -- cgit v1.1