diff options
Diffstat (limited to '')
-rw-r--r-- | otautil/sysutil.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/otautil/sysutil.cpp b/otautil/sysutil.cpp index e6385c4e9..ab1513088 100644 --- a/otautil/sysutil.cpp +++ b/otautil/sysutil.cpp @@ -28,8 +28,10 @@ #include <android-base/file.h> #include <android-base/logging.h> +#include <android-base/properties.h> #include <android-base/strings.h> #include <android-base/unique_fd.h> +#include <cutils/android_reboot.h> bool MemMapping::MapFD(int fd) { struct stat sb; @@ -201,3 +203,11 @@ MemMapping::~MemMapping() { }; ranges_.clear(); } + +bool reboot(const std::string& command) { + std::string cmd = command; + if (android::base::GetBoolProperty("ro.boot.quiescent", false)) { + cmd += ",quiescent"; + } + return android::base::SetProperty(ANDROID_RB_PROPERTY, cmd); +} |