Loading core/java/android/os/RecoverySystem.java +13 −1 Original line number Diff line number Diff line Loading @@ -22,9 +22,12 @@ import android.annotation.SystemApi; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.UserManager; import android.text.TextUtils; import android.util.Log; import android.view.Display; import android.view.WindowManager; import libcore.io.Streams; Loading Loading @@ -570,7 +573,16 @@ public class RecoverySystem { // Having set up the BCB (bootloader control block), go ahead and reboot PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); pm.reboot(PowerManager.REBOOT_RECOVERY_UPDATE); String reason = PowerManager.REBOOT_RECOVERY_UPDATE; // On TV, reboot quiescently if the screen is off if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)) { WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); if (wm.getDefaultDisplay().getState() != Display.STATE_ON) { reason += ",quiescent"; } } pm.reboot(reason); throw new IOException("Reboot failed (no permissions?)"); } Loading services/core/java/com/android/server/power/PowerManagerService.java +9 −4 Original line number Diff line number Diff line Loading @@ -3122,10 +3122,6 @@ public final class PowerManagerService extends SystemService if (reason == null) { reason = ""; } if (reason.equals(PowerManager.REBOOT_RECOVERY) || reason.equals(PowerManager.REBOOT_RECOVERY_UPDATE)) { reason = "recovery"; } // If the reason is "quiescent", it means that the boot process should proceed // without turning on the screen/lights. Loading @@ -3134,6 +3130,15 @@ public final class PowerManagerService extends SystemService if (reason.equals(PowerManager.REBOOT_QUIESCENT)) { sQuiescent = true; reason = ""; } else if (reason.endsWith("," + PowerManager.REBOOT_QUIESCENT)) { sQuiescent = true; reason = reason.substring(0, reason.length() - PowerManager.REBOOT_QUIESCENT.length() - 1); } if (reason.equals(PowerManager.REBOOT_RECOVERY) || reason.equals(PowerManager.REBOOT_RECOVERY_UPDATE)) { reason = "recovery"; } if (sQuiescent) { Loading Loading
core/java/android/os/RecoverySystem.java +13 −1 Original line number Diff line number Diff line Loading @@ -22,9 +22,12 @@ import android.annotation.SystemApi; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.UserManager; import android.text.TextUtils; import android.util.Log; import android.view.Display; import android.view.WindowManager; import libcore.io.Streams; Loading Loading @@ -570,7 +573,16 @@ public class RecoverySystem { // Having set up the BCB (bootloader control block), go ahead and reboot PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); pm.reboot(PowerManager.REBOOT_RECOVERY_UPDATE); String reason = PowerManager.REBOOT_RECOVERY_UPDATE; // On TV, reboot quiescently if the screen is off if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)) { WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); if (wm.getDefaultDisplay().getState() != Display.STATE_ON) { reason += ",quiescent"; } } pm.reboot(reason); throw new IOException("Reboot failed (no permissions?)"); } Loading
services/core/java/com/android/server/power/PowerManagerService.java +9 −4 Original line number Diff line number Diff line Loading @@ -3122,10 +3122,6 @@ public final class PowerManagerService extends SystemService if (reason == null) { reason = ""; } if (reason.equals(PowerManager.REBOOT_RECOVERY) || reason.equals(PowerManager.REBOOT_RECOVERY_UPDATE)) { reason = "recovery"; } // If the reason is "quiescent", it means that the boot process should proceed // without turning on the screen/lights. Loading @@ -3134,6 +3130,15 @@ public final class PowerManagerService extends SystemService if (reason.equals(PowerManager.REBOOT_QUIESCENT)) { sQuiescent = true; reason = ""; } else if (reason.endsWith("," + PowerManager.REBOOT_QUIESCENT)) { sQuiescent = true; reason = reason.substring(0, reason.length() - PowerManager.REBOOT_QUIESCENT.length() - 1); } if (reason.equals(PowerManager.REBOOT_RECOVERY) || reason.equals(PowerManager.REBOOT_RECOVERY_UPDATE)) { reason = "recovery"; } if (sQuiescent) { Loading