summaryrefslogtreecommitdiffstats
path: root/otautil
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2019-05-28 18:17:51 +0200
committerandroid-build-merger <android-build-merger@google.com>2019-05-28 18:17:51 +0200
commit7d0545f14a707584a50f8aa93eb73966cfabba4c (patch)
tree10cea79238aaa7329865c8fecc1ea50d3b4409b8 /otautil
parentMerge "Some clean ups to the updater" (diff)
parentMerge "recovery: report compliant reboot reason (Part Deux)" (diff)
downloadandroid_bootable_recovery-7d0545f14a707584a50f8aa93eb73966cfabba4c.tar
android_bootable_recovery-7d0545f14a707584a50f8aa93eb73966cfabba4c.tar.gz
android_bootable_recovery-7d0545f14a707584a50f8aa93eb73966cfabba4c.tar.bz2
android_bootable_recovery-7d0545f14a707584a50f8aa93eb73966cfabba4c.tar.lz
android_bootable_recovery-7d0545f14a707584a50f8aa93eb73966cfabba4c.tar.xz
android_bootable_recovery-7d0545f14a707584a50f8aa93eb73966cfabba4c.tar.zst
android_bootable_recovery-7d0545f14a707584a50f8aa93eb73966cfabba4c.zip
Diffstat (limited to 'otautil')
-rw-r--r--otautil/include/otautil/sysutil.h4
-rw-r--r--otautil/sysutil.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/otautil/include/otautil/sysutil.h b/otautil/include/otautil/sysutil.h
index 48e9011e5..326db8644 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.
-// 'target' can be an empty string, which indicates booting into Android.
+// All unknown targets reboot into Android.
bool Reboot(std::string_view target);
// Triggers a shutdown.
-bool Shutdown();
+bool Shutdown(std::string_view target);
// 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 420db4cac..a8829858d 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() {
- // "shutdown" doesn't need a "reason" arg nor a comma.
- return android::base::SetProperty(ANDROID_RB_PROPERTY, "shutdown");
+bool Shutdown(std::string_view target) {
+ std::string cmd = "shutdown," + std::string(target);
+ return android::base::SetProperty(ANDROID_RB_PROPERTY, cmd);
}
std::vector<char*> StringVectorToNullTerminatedArray(const std::vector<std::string>& args) {