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
diff --git a/init/reboot.cpp b/init/reboot.cpp
index 7167672..13cebcc 100644
--- a/init/reboot.cpp
+++ b/init/reboot.cpp
@@ -38,6 +38,7 @@
#include <thread>
#include <vector>
+#include <InitProperties.sysprop.h>
#include <android-base/chrono_utils.h>
#include <android-base/file.h>
#include <android-base/logging.h>
@@ -743,8 +744,8 @@
// actions. We should make sure, that all of them are propagated before
// proceeding with userspace reboot. Synchronously setting kUserspaceRebootInProgress property
// is not perfect, but it should do the trick.
- if (property_set(kUserspaceRebootInProgress, "1") != 0) {
- return Error() << "Failed to set property " << kUserspaceRebootInProgress;
+ if (!android::sysprop::InitProperties::userspace_reboot_in_progress(true)) {
+ return Error() << "Failed to set sys.init.userspace_reboot.in_progress property";
}
EnterShutdown();
std::vector<Service*> stop_first;