From 704b27bd85a674cdec4d73fc46631b1446d2d3ca Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Thu, 20 Apr 2017 16:38:54 -0700 Subject: [PATCH] init: fix last_reboot_reason string This got moved when refactoring the reboot commands. Bug: 37540660 Test: verify bullhead's last_reboot_reason is correct Change-Id: I3b86496fc469ca41645df7e7ba8bb51dd25b6b38 (cherry picked from commit 47336cebc39270dce01611a9be689576f52e33ec) --- init/reboot.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/init/reboot.cpp b/init/reboot.cpp index c1edf7cee..c99751966 100644 --- a/init/reboot.cpp +++ b/init/reboot.cpp @@ -423,7 +423,6 @@ void DoReboot(unsigned int cmd, const std::string& reason, const std::string& re bool HandlePowerctlMessage(const std::string& command) { unsigned int cmd = 0; std::vector cmd_params = android::base::Split(command, ","); - std::string reason_string = cmd_params[0]; std::string reboot_target = ""; bool run_fsck = false; bool command_invalid = false; @@ -436,7 +435,6 @@ bool HandlePowerctlMessage(const std::string& command) { // The shutdown reason is PowerManager.SHUTDOWN_USER_REQUESTED. // Run fsck once the file system is remounted in read-only mode. run_fsck = true; - reason_string = cmd_params[1]; } } else if (cmd_params[0] == "reboot") { cmd = ANDROID_RB_RESTART2; @@ -467,6 +465,6 @@ bool HandlePowerctlMessage(const std::string& command) { return false; } - DoReboot(cmd, reason_string, reboot_target, run_fsck); + DoReboot(cmd, command, reboot_target, run_fsck); return true; }