diff options
author | Dmitri Plotnikov <dplotnikov@google.com> | 2017-04-18 17:28:26 +0200 |
---|---|---|
committer | Dmitri Plotnikov <dplotnikov@google.com> | 2017-04-19 23:43:08 +0200 |
commit | 8706a98aa635236a95795f0a0c122bb3e591a50d (patch) | |
tree | 133e90784e5115282067ed38c1e5919a3a033b7c /recovery.cpp | |
parent | Merge "Add 'system' to update_verifier's gid" (diff) | |
download | android_bootable_recovery-8706a98aa635236a95795f0a0c122bb3e591a50d.tar android_bootable_recovery-8706a98aa635236a95795f0a0c122bb3e591a50d.tar.gz android_bootable_recovery-8706a98aa635236a95795f0a0c122bb3e591a50d.tar.bz2 android_bootable_recovery-8706a98aa635236a95795f0a0c122bb3e591a50d.tar.lz android_bootable_recovery-8706a98aa635236a95795f0a0c122bb3e591a50d.tar.xz android_bootable_recovery-8706a98aa635236a95795f0a0c122bb3e591a50d.tar.zst android_bootable_recovery-8706a98aa635236a95795f0a0c122bb3e591a50d.zip |
Diffstat (limited to '')
-rw-r--r-- | recovery.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/recovery.cpp b/recovery.cpp index b24efa963..173baac16 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -209,6 +209,14 @@ bool is_ro_debuggable() { return android::base::GetBoolProperty("ro.debuggable", false); } +bool reboot(const std::string& command) { + std::string cmd = command; + if (android::base::GetBoolProperty("ro.boot.quiescent", false)) { + cmd += ",quiescent"; + } + return android::base::SetProperty(ANDROID_RB_PROPERTY, cmd); +} + static void redirect_stdio(const char* filename) { int pipefd[2]; if (pipe(pipefd) == -1) { @@ -1449,12 +1457,18 @@ int main(int argc, char **argv) { printf("reason is [%s]\n", reason); Device* device = make_device(); - ui = device->GetUI(); + if (android::base::GetBoolProperty("ro.boot.quiescent", false)) { + printf("Quiescent recovery mode.\n"); + ui = new StubRecoveryUI(); + } else { + ui = device->GetUI(); - if (!ui->Init(locale)) { - printf("Failed to initialize UI, use stub UI instead."); - ui = new StubRecoveryUI(); + if (!ui->Init(locale)) { + printf("Failed to initialize UI, use stub UI instead.\n"); + ui = new StubRecoveryUI(); + } } + // Set background string to "installing security update" for security update, // otherwise set it to "installing system update". ui->SetSystemUpdateText(security_update); @@ -1526,7 +1540,7 @@ int main(int argc, char **argv) { ui->Print("Retry attempt %d\n", retry_count); // Reboot and retry the update - if (!android::base::SetProperty(ANDROID_RB_PROPERTY, "reboot,recovery")) { + if (!reboot("reboot,recovery")) { ui->Print("Reboot failed\n"); } else { while (true) { @@ -1623,7 +1637,7 @@ int main(int argc, char **argv) { default: ui->Print("Rebooting...\n"); - android::base::SetProperty(ANDROID_RB_PROPERTY, "reboot,"); + reboot("reboot,"); break; } while (true) { |