From 8c6ce78b96dab2b9eb9c97541f9695f2c304f853 Mon Sep 17 00:00:00 2001 From: Gavin Corkery Date: Mon, 20 Sep 2021 14:52:32 +0100 Subject: [PATCH] Check RescueParty before using SysUI reboot message RescueParty does not factory reset the device, but the reboot message shown during reboot is misleading. The logic is currently handled correctly outside of SysUI, but the RescueParty case is not considered when showSysuiReboot() is called. Instead, check whether RescueParty has triggered this reboot before calling into SysUI. Test: Manual. Trigger rescue party after boot, ensure reboot message says "Power off" rather than "Factory data reset" Bug: 197065751 Change-Id: Ibd2e776130f9c2cb437ec5515ea64e5d69a31bb8 --- .../core/java/com/android/server/power/ShutdownThread.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java index b03db66fde940..dcfb8b5e7b332 100644 --- a/services/core/java/com/android/server/power/ShutdownThread.java +++ b/services/core/java/com/android/server/power/ShutdownThread.java @@ -315,15 +315,15 @@ public final class ShutdownThread extends Thread { com.android.internal.R.string.reboot_to_update_reboot)); } } else if (mReason != null && mReason.equals(PowerManager.REBOOT_RECOVERY)) { - if (showSysuiReboot()) { - return null; - } else if (RescueParty.isAttemptingFactoryReset()) { + if (RescueParty.isAttemptingFactoryReset()) { // We're not actually doing a factory reset yet; we're rebooting // to ask the user if they'd like to reset, so give them a less // scary dialog message. pd.setTitle(context.getText(com.android.internal.R.string.power_off)); pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress)); pd.setIndeterminate(true); + } else if (showSysuiReboot()) { + return null; } else { // Factory reset path. Set the dialog message accordingly. pd.setTitle(context.getText(com.android.internal.R.string.reboot_to_reset_title));