Loading services/java/com/android/server/power/ShutdownThread.java +9 −3 Original line number Diff line number Diff line Loading @@ -150,9 +150,11 @@ public final class ShutdownThread extends Thread { sConfirmDialog = null; } if (mReboot && !mRebootSafeMode) { // See if the advanced reboot menu is enabled and check the keyguard state boolean advancedReboot = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ADVANCED_REBOOT, 0) == 1; // Determine if primary user is logged in boolean isPrimary = UserHandle.getCallingUserId() == UserHandle.USER_OWNER; // See if the advanced reboot menu is enabled (only if primary user) and check the keyguard state boolean advancedReboot = isPrimary ? advancedRebootEnabled(context) : false; KeyguardManager km = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); boolean locked = km.inKeyguardRestrictedInputMode(); Loading Loading @@ -219,6 +221,10 @@ public final class ShutdownThread extends Thread { } } private static boolean advancedRebootEnabled(Context context) { return Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ADVANCED_REBOOT, 0) == 1; } private static class CloseDialogReceiver extends BroadcastReceiver implements DialogInterface.OnDismissListener { private Context mContext; Loading Loading
services/java/com/android/server/power/ShutdownThread.java +9 −3 Original line number Diff line number Diff line Loading @@ -150,9 +150,11 @@ public final class ShutdownThread extends Thread { sConfirmDialog = null; } if (mReboot && !mRebootSafeMode) { // See if the advanced reboot menu is enabled and check the keyguard state boolean advancedReboot = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ADVANCED_REBOOT, 0) == 1; // Determine if primary user is logged in boolean isPrimary = UserHandle.getCallingUserId() == UserHandle.USER_OWNER; // See if the advanced reboot menu is enabled (only if primary user) and check the keyguard state boolean advancedReboot = isPrimary ? advancedRebootEnabled(context) : false; KeyguardManager km = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); boolean locked = km.inKeyguardRestrictedInputMode(); Loading Loading @@ -219,6 +221,10 @@ public final class ShutdownThread extends Thread { } } private static boolean advancedRebootEnabled(Context context) { return Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ADVANCED_REBOOT, 0) == 1; } private static class CloseDialogReceiver extends BroadcastReceiver implements DialogInterface.OnDismissListener { private Context mContext; Loading