Skip to content

Commit

Permalink
recovery: Allow devices to reboot to download mode
Browse files Browse the repository at this point in the history
Change-Id: Ib6ccf98ed68efacbb3b8c8238945da60b23a20d7
  • Loading branch information
andi34 authored and Steve Kondik committed Sep 4, 2016
1 parent 114d4bf commit 0e55012
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,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
Expand Down
4 changes: 4 additions & 0 deletions device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions recovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1915,8 +1915,13 @@ int 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:
Expand Down

0 comments on commit 0e55012

Please sign in to comment.