From 6f4e4db4f9e0911a07c6393d01e4380e844f7891 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Mon, 20 May 2019 10:36:16 -0700 Subject: recovery: report compliant reboot reason shutdown and reboot should have a corresponding sub-reason. Adding: "reboot,fastboot_menu" "reboot,recovery_menu" "reboot,recovery_ui" "shutdown,fastboot" "shutdown,recovery" "reboot,unknown#" Test: none Change-Id: Icf1ab0d462ec2de2272914a36994a095998d6186 --- recovery_main.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'recovery_main.cpp') diff --git a/recovery_main.cpp b/recovery_main.cpp index aba9c5d75..f78c1c788 100644 --- a/recovery_main.cpp +++ b/recovery_main.cpp @@ -471,7 +471,12 @@ int main(int argc, char** argv) { switch (ret) { case Device::SHUTDOWN: ui->Print("Shutting down...\n"); - Shutdown(); + Shutdown("recovery"); + break; + + case Device::SHUTDOWN_FROM_FASTBOOT: + ui->Print("Shutting down...\n"); + Shutdown("fastboot"); break; case Device::REBOOT_BOOTLOADER: @@ -520,9 +525,19 @@ int main(int argc, char** argv) { fastboot = false; break; + case Device::REBOOT: + ui->Print("Rebooting...\n"); + Reboot("recovery_menu"); + break; + + case Device::REBOOT_FROM_FASTBOOT: + ui->Print("Rebooting...\n"); + Reboot("fastboot_menu"); + break; + default: ui->Print("Rebooting...\n"); - Reboot(""); + Reboot("unknown" + std::to_string(ret)); break; } } -- cgit v1.2.3