diff options
author | Nikita Ioffe <ioffe@google.com> | 2019-11-14 01:21:24 +0000 |
---|---|---|
committer | Nikita Ioffe <ioffe@google.com> | 2019-11-15 20:07:58 +0000 |
commit | 23dbd6dc11a6e783d96b7447975bf50c4de45cb4 (patch) | |
tree | 0427d54fad983731aa0d8cadffef81124bad632a /init/builtins.cpp | |
parent | dc4bd2714cf8a1ae4b606eafac56e12a0f77955e (diff) |
Make userspace_reboot.in_progress sysprop-as-api
sys.init.userspace_reboot.in_progress will be used to notify all
the processes (including vendor ones) that userspace reboot is
happening, hence it should be treated as stable public api.
All other sys.init.userspace_reboot.* props will be internal to /system
partition and don't require any stability guarantees.
Test: builds
Test: adb reboot userspace
Bug: 135984674
Change-Id: Ifb64a6bfae2de76bac67edea68df44e33c9cfe2d
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 8f5814536..485806b90 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -45,6 +45,7 @@ #include <memory> #include <ApexProperties.sysprop.h> +#include <InitProperties.sysprop.h> #include <android-base/chrono_utils.h> #include <android-base/file.h> #include <android-base/logging.h> @@ -1222,7 +1223,9 @@ static Result<void> do_finish_userspace_reboot(const BuiltinArguments&) { boot_clock::time_point now = boot_clock::now(); property_set("sys.init.userspace_reboot.last_finished", std::to_string(now.time_since_epoch().count())); - property_set(kUserspaceRebootInProgress, "0"); + if (!android::sysprop::InitProperties::userspace_reboot_in_progress(false)) { + return Error() << "Failed to set sys.init.userspace_reboot.in_progress property"; + } return {}; } |