From e8ca1b86347992d3c92db8e7a25ee77a6280787b Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Fri, 13 Mar 2020 14:25:02 -0700 Subject: Consolidate the wait in recovery's reboot After a reboot function call, we should always wait for it to finish without executing other instructions. Bug: 151110322 Test: build Change-Id: I1dda291a0835ff96df7eaf42eba1a38267a3beeb (cherry picked from commit 00c4aba9bf428717fc00e26a03e97401eca76ee8) --- otautil/sysutil.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'otautil/sysutil.cpp') 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) { -- cgit v1.2.3