summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2017-04-22 02:37:19 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-04-22 02:37:19 +0200
commit0965c583efda6e1feeeed8fe1899c4e9365e022c (patch)
treeef0e1a4370d8bd3bd9ce6389bb41d9e7d5bb8126 /recovery.cpp
parentMerge "Minor clean up to minadbd_services.cpp" am: fa7d55a7e3 am: 235a2cc1c7 am: 33a8900d2b (diff)
parentMerge "Reboot the device on user build after the install fails" am: d6f436849d am: 4849c87033 (diff)
downloadandroid_bootable_recovery-0965c583efda6e1feeeed8fe1899c4e9365e022c.tar
android_bootable_recovery-0965c583efda6e1feeeed8fe1899c4e9365e022c.tar.gz
android_bootable_recovery-0965c583efda6e1feeeed8fe1899c4e9365e022c.tar.bz2
android_bootable_recovery-0965c583efda6e1feeeed8fe1899c4e9365e022c.tar.lz
android_bootable_recovery-0965c583efda6e1feeeed8fe1899c4e9365e022c.tar.xz
android_bootable_recovery-0965c583efda6e1feeeed8fe1899c4e9365e022c.tar.zst
android_bootable_recovery-0965c583efda6e1feeeed8fe1899c4e9365e022c.zip
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/recovery.cpp b/recovery.cpp
index b24efa963..99126eedc 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -1593,14 +1593,22 @@ int main(int argc, char **argv) {
}
}
- if (!sideload_auto_reboot && (status == INSTALL_ERROR || status == INSTALL_CORRUPT)) {
- copy_logs();
+ if (status == INSTALL_ERROR || status == INSTALL_CORRUPT) {
ui->SetBackground(RecoveryUI::ERROR);
+ if (!ui->IsTextVisible()) {
+ sleep(5);
+ }
}
Device::BuiltinAction after = shutdown_after ? Device::SHUTDOWN : Device::REBOOT;
- if ((status != INSTALL_SUCCESS && status != INSTALL_SKIPPED && !sideload_auto_reboot) ||
- ui->IsTextVisible()) {
+ // 1. If the recovery menu is visible, prompt and wait for commands.
+ // 2. If the state is INSTALL_NONE, wait for commands. (i.e. In user build, manually reboot into
+ // recovery to sideload a package.)
+ // 3. sideload_auto_reboot is an option only available in user-debug build, reboot the device
+ // without waiting.
+ // 4. In all other cases, reboot the device. Therefore, normal users will observe the device
+ // reboot after it shows the "error" screen for 5s.
+ if ((status == INSTALL_NONE && !sideload_auto_reboot) || ui->IsTextVisible()) {
Device::BuiltinAction temp = prompt_and_wait(device, status);
if (temp != Device::NO_ACTION) {
after = temp;