Loading init/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ cc_library_static { whole_static_libs: [ "libcap", "com.android.sysprop.apex", "com.android.sysprop.init", ], header_libs: ["bootimg_headers"], proto: { Loading init/builtins.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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 {}; } Loading init/reboot.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -743,8 +744,8 @@ static Result<void> DoUserspaceReboot() { // 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; Loading init/reboot.h +0 −2 Original line number Diff line number Diff line Loading @@ -22,8 +22,6 @@ namespace android { namespace init { static const constexpr char* kUserspaceRebootInProgress = "sys.init.userspace_reboot.in_progress"; // Parses and handles a setprop sys.powerctl message. void HandlePowerctlMessage(const std::string& command); Loading init/sysprop/Android.bp 0 → 100644 +7 −0 Original line number Diff line number Diff line sysprop_library { name: "com.android.sysprop.init", srcs: ["InitProperties.sysprop"], property_owner: "Platform", api_packages: ["android.sysprop"], recovery_available: true, } Loading
init/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ cc_library_static { whole_static_libs: [ "libcap", "com.android.sysprop.apex", "com.android.sysprop.init", ], header_libs: ["bootimg_headers"], proto: { Loading
init/builtins.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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 {}; } Loading
init/reboot.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -743,8 +744,8 @@ static Result<void> DoUserspaceReboot() { // 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; Loading
init/reboot.h +0 −2 Original line number Diff line number Diff line Loading @@ -22,8 +22,6 @@ namespace android { namespace init { static const constexpr char* kUserspaceRebootInProgress = "sys.init.userspace_reboot.in_progress"; // Parses and handles a setprop sys.powerctl message. void HandlePowerctlMessage(const std::string& command); Loading
init/sysprop/Android.bp 0 → 100644 +7 −0 Original line number Diff line number Diff line sysprop_library { name: "com.android.sysprop.init", srcs: ["InitProperties.sysprop"], property_owner: "Platform", api_packages: ["android.sysprop"], recovery_available: true, }