diff options
author | Tao Bao <tbao@google.com> | 2019-05-23 03:52:21 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-05-23 03:52:21 +0200 |
commit | b491496fc3a16e0eec6791efc9a5c504e179031b (patch) | |
tree | 45ea6aa3e7a034f376969cbc45b5e0b9ab630e17 /otautil | |
parent | Merge "recovery: report compliant reboot reason" (diff) | |
parent | Merge "Revert "recovery: report compliant reboot reason"" (diff) | |
download | android_bootable_recovery-b491496fc3a16e0eec6791efc9a5c504e179031b.tar android_bootable_recovery-b491496fc3a16e0eec6791efc9a5c504e179031b.tar.gz android_bootable_recovery-b491496fc3a16e0eec6791efc9a5c504e179031b.tar.bz2 android_bootable_recovery-b491496fc3a16e0eec6791efc9a5c504e179031b.tar.lz android_bootable_recovery-b491496fc3a16e0eec6791efc9a5c504e179031b.tar.xz android_bootable_recovery-b491496fc3a16e0eec6791efc9a5c504e179031b.tar.zst android_bootable_recovery-b491496fc3a16e0eec6791efc9a5c504e179031b.zip |
Diffstat (limited to 'otautil')
-rw-r--r-- | otautil/include/otautil/sysutil.h | 4 | ||||
-rw-r--r-- | otautil/sysutil.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/otautil/include/otautil/sysutil.h b/otautil/include/otautil/sysutil.h index 326db8644..48e9011e5 100644 --- a/otautil/include/otautil/sysutil.h +++ b/otautil/include/otautil/sysutil.h @@ -102,11 +102,11 @@ class MemMapping { }; // Reboots the device into the specified target, by additionally handling quiescent reboot mode. -// All unknown targets reboot into Android. +// 'target' can be an empty string, which indicates booting into Android. bool Reboot(std::string_view target); // Triggers a shutdown. -bool Shutdown(std::string_view target); +bool Shutdown(); // Returns a null-terminated char* array, where the elements point to the C-strings in the given // vector, plus an additional nullptr at the end. This is a helper function that facilitates diff --git a/otautil/sysutil.cpp b/otautil/sysutil.cpp index a8829858d..420db4cac 100644 --- a/otautil/sysutil.cpp +++ b/otautil/sysutil.cpp @@ -229,9 +229,9 @@ bool Reboot(std::string_view target) { return android::base::SetProperty(ANDROID_RB_PROPERTY, cmd); } -bool Shutdown(std::string_view target) { - std::string cmd = "shutdown," + std::string(target); - return android::base::SetProperty(ANDROID_RB_PROPERTY, cmd); +bool Shutdown() { + // "shutdown" doesn't need a "reason" arg nor a comma. + return android::base::SetProperty(ANDROID_RB_PROPERTY, "shutdown"); } std::vector<char*> StringVectorToNullTerminatedArray(const std::vector<std::string>& args) { |