diff options
author | Tom Marshall <tdm@cyngn.com> | 2015-02-03 09:56:57 -0800 |
---|---|---|
committer | Tom Marshall <tdm@cyngn.com> | 2015-11-25 15:35:47 -0800 |
commit | f028ccd3443a4526c245c8c664b37588be301eb2 (patch) | |
tree | 6608d58a19aa2821157b01b8754a8805a12ba7dd /recovery.cpp | |
parent | d644eb58fde7d39a416850af3caeb4cbce514ec8 (diff) | |
download | bootable_recovery-f028ccd3443a4526c245c8c664b37588be301eb2.zip bootable_recovery-f028ccd3443a4526c245c8c664b37588be301eb2.tar.gz bootable_recovery-f028ccd3443a4526c245c8c664b37588be301eb2.tar.bz2 |
recovery: Headless mode
Change-Id: I6b54bde65264aee99cb51a19436e82054b31fe74
Diffstat (limited to 'recovery.cpp')
-rw-r--r-- | recovery.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/recovery.cpp b/recovery.cpp index f1c65ce..a4a4a64 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -97,6 +97,7 @@ static OemLockOp oem_lock = OEM_LOCK_NONE; static const struct option OPTIONS[] = { { "send_intent", required_argument, NULL, 'i' }, { "update_package", required_argument, NULL, 'u' }, + { "headless", no_argument, NULL, 'h' }, { "wipe_data", no_argument, NULL, 'w' }, { "wipe_cache", no_argument, NULL, 'c' }, { "wipe_media", no_argument, NULL, 'm' }, @@ -1304,6 +1305,7 @@ main(int argc, char **argv) { bool show_text = false; bool sideload = false; bool sideload_auto_reboot = false; + bool headless = false; bool just_exit = false; bool shutdown_after = false; @@ -1312,6 +1314,7 @@ main(int argc, char **argv) { switch (arg) { case 'i': send_intent = optarg; break; case 'u': update_package = optarg; break; + case 'h': headless = true; break; case 'w': should_wipe_data = true; break; case 'c': should_wipe_cache = true; break; case 't': show_text = true; break; @@ -1485,7 +1488,15 @@ main(int argc, char **argv) { } Device::BuiltinAction after = shutdown_after ? Device::SHUTDOWN : Device::REBOOT; - if ((status != INSTALL_SUCCESS && !sideload_auto_reboot) || ui->IsTextVisible()) { + if (headless) { + ui->ShowText(true); + ui->SetHeadlessMode(); + finish_recovery(NULL); + for (;;) { + pause(); + } + } + else if ((status != INSTALL_SUCCESS && !sideload_auto_reboot) || ui->IsTextVisible()) { Device::BuiltinAction temp = prompt_and_wait(device, status); if (temp != Device::NO_ACTION) { after = temp; |