From 85ff4ab9a408dfca36a2696aec2bc1476a82ecd7 Mon Sep 17 00:00:00 2001 From: Nikita Ioffe Date: Thu, 6 Feb 2020 23:33:42 +0000 Subject: [PATCH] Don't log userspace_reboot.started/finished properties from init Instead they will be logged from system_server. This CL just prepares grounds for logging CL to land. Test: adb reboot userspace Bug: 148767783 Change-Id: Ie9482ef735344ecfb0de8a37785d314a3c0417ff --- init/builtins.cpp | 12 ------------ init/reboot.cpp | 3 --- rootdir/init.rc | 2 +- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/init/builtins.cpp b/init/builtins.cpp index 742e0896d..dbfc3bafa 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -1309,17 +1309,6 @@ static Result do_enter_default_mount_ns(const BuiltinArguments& args) { } } -static Result do_finish_userspace_reboot(const BuiltinArguments&) { - LOG(INFO) << "Userspace reboot successfully finished"; - boot_clock::time_point now = boot_clock::now(); - SetProperty("sys.init.userspace_reboot.last_finished", - std::to_string(now.time_since_epoch().count())); - if (!android::sysprop::InitProperties::userspace_reboot_in_progress(false)) { - return Error() << "Failed to set sys.init.userspace_reboot.in_progress property"; - } - return {}; -} - // Builtin-function-map start const BuiltinFunctionMap& GetBuiltinFunctionMap() { constexpr std::size_t kMax = std::numeric_limits::max(); @@ -1341,7 +1330,6 @@ const BuiltinFunctionMap& GetBuiltinFunctionMap() { {"exec_background", {1, kMax, {false, do_exec_background}}}, {"exec_start", {1, 1, {false, do_exec_start}}}, {"export", {2, 2, {false, do_export}}}, - {"finish_userspace_reboot", {0, 0, {false, do_finish_userspace_reboot}}}, {"hostname", {1, 1, {true, do_hostname}}}, {"ifup", {1, 1, {true, do_ifup}}}, {"init_user0", {0, 0, {false, do_init_user0}}}, diff --git a/init/reboot.cpp b/init/reboot.cpp index 8b239fe7f..a01970af5 100644 --- a/init/reboot.cpp +++ b/init/reboot.cpp @@ -731,9 +731,6 @@ static Result UnmountAllApexes() { static Result DoUserspaceReboot() { LOG(INFO) << "Userspace reboot initiated"; - boot_clock::time_point now = boot_clock::now(); - SetProperty("sys.init.userspace_reboot.last_started", - std::to_string(now.time_since_epoch().count())); auto guard = android::base::make_scope_guard([] { // Leave shutdown so that we can handle a full reboot. LeaveShutdown(); diff --git a/rootdir/init.rc b/rootdir/init.rc index 5fbad75dd..4564d2679 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -1058,4 +1058,4 @@ on userspace-reboot-resume trigger boot on property:sys.boot_completed=1 && property:sys.init.userspace_reboot.in_progress=1 - finish_userspace_reboot + setprop sys.init.userspace_reboot.in_progress ""