summaryrefslogtreecommitdiffstats
path: root/otautil/sysutil.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2020-03-13 22:25:02 +0100
committerTianjie Xu <xunchang@google.com>2020-03-14 00:09:48 +0100
commit00c4aba9bf428717fc00e26a03e97401eca76ee8 (patch)
tree9e972783e02a3969c3e38aaf1a687f07f56b779c /otautil/sysutil.cpp
parentMerge "Merge stage-aosp-master to aosp-master - DO NOT MERGE" (diff)
downloadandroid_bootable_recovery-00c4aba9bf428717fc00e26a03e97401eca76ee8.tar
android_bootable_recovery-00c4aba9bf428717fc00e26a03e97401eca76ee8.tar.gz
android_bootable_recovery-00c4aba9bf428717fc00e26a03e97401eca76ee8.tar.bz2
android_bootable_recovery-00c4aba9bf428717fc00e26a03e97401eca76ee8.tar.lz
android_bootable_recovery-00c4aba9bf428717fc00e26a03e97401eca76ee8.tar.xz
android_bootable_recovery-00c4aba9bf428717fc00e26a03e97401eca76ee8.tar.zst
android_bootable_recovery-00c4aba9bf428717fc00e26a03e97401eca76ee8.zip
Diffstat (limited to '')
-rw-r--r--otautil/sysutil.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/otautil/sysutil.cpp b/otautil/sysutil.cpp
index 6cd46c6a9..b3ead9736 100644
--- a/otautil/sysutil.cpp
+++ b/otautil/sysutil.cpp
@@ -219,14 +219,18 @@ MemMapping::~MemMapping() {
ranges_.clear();
}
-bool Reboot(std::string_view target) {
+void Reboot(std::string_view target) {
std::string cmd = "reboot," + std::string(target);
// Honor the quiescent mode if applicable.
if (target != "bootloader" && target != "fastboot" &&
android::base::GetBoolProperty("ro.boot.quiescent", false)) {
cmd += ",quiescent";
}
- return android::base::SetProperty(ANDROID_RB_PROPERTY, cmd);
+ if (!android::base::SetProperty(ANDROID_RB_PROPERTY, cmd)) {
+ LOG(FATAL) << "Reboot failed";
+ }
+
+ while (true) pause();
}
bool Shutdown(std::string_view target) {