Loading core/java/android/provider/Settings.java +6 −0 Original line number Diff line number Diff line Loading @@ -7119,6 +7119,11 @@ public final class Settings { */ public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; /** * Whether the Lockdown button should be shown in the power menu. * @hide */ public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu"; /** * This are the settings to be backed up. * Loading Loading @@ -7221,6 +7226,7 @@ public final class Settings { SCREENSAVER_COMPONENTS, SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_SLEEP, LOCKDOWN_IN_POWER_MENU, }; /** @hide */ Loading core/java/com/android/internal/widget/LockPatternUtils.java +7 −1 Original line number Diff line number Diff line Loading @@ -1614,7 +1614,8 @@ public class LockPatternUtils { STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW, SOME_AUTH_REQUIRED_AFTER_USER_REQUEST, STRONG_AUTH_REQUIRED_AFTER_LOCKOUT, STRONG_AUTH_REQUIRED_AFTER_TIMEOUT}) STRONG_AUTH_REQUIRED_AFTER_TIMEOUT, STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN}) @Retention(RetentionPolicy.SOURCE) public @interface StrongAuthFlags {} Loading Loading @@ -1650,6 +1651,11 @@ public class LockPatternUtils { */ public static final int STRONG_AUTH_REQUIRED_AFTER_TIMEOUT = 0x10; /** * Strong authentication is required because the user has triggered lockdown. */ public static final int STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN = 0x20; /** * Strong auth flags that do not prevent fingerprint from being accepted as auth. * Loading core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2367,12 +2367,14 @@ "silent" = silent mode "users" = list of users "restart" = restart device "lockdown" = Lock down device until the user authenticates --> <string-array translatable="false" name="config_globalActionsList"> <item>power</item> <item>restart</item> <item>bugreport</item> <item>users</item> <item>lockdown</item> </string-array> <!-- Number of milliseconds to hold a wake lock to ensure that drawing is fully Loading core/res/res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -526,8 +526,8 @@ <!-- label for item that launches voice assist in phone options dialog [CHAR LIMIT=15]--> <string name="global_action_voice_assist">Voice Assist</string> <!-- label for item that locks the phone and enforces that it can't be unlocked without entering a credential. [CHAR LIMIT=15] --> <string name="global_action_lockdown">Lock now</string> <!-- label for item that locks the phone and enforces that it can't be unlocked without strong authentication. [CHAR LIMIT=15] --> <string name="global_action_lockdown">Enter lockdown</string> <!-- Text to use when the number in a notification info is too large (greater than status_bar_notification_info_maxnum, defined in Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +9 −2 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ package com.android.systemui.globalactions; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import com.android.internal.R; import com.android.internal.colorextraction.ColorExtractor; import com.android.internal.colorextraction.ColorExtractor.GradientColors; Loading Loading @@ -310,7 +312,10 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, DialogIn } else if (GLOBAL_ACTION_KEY_SETTINGS.equals(actionKey)) { mItems.add(getSettingsAction()); } else if (GLOBAL_ACTION_KEY_LOCKDOWN.equals(actionKey)) { if (Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.LOCKDOWN_IN_POWER_MENU, 0) != 0) { mItems.add(getLockdownAction()); } } else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) { mItems.add(getVoiceAssistAction()); } else if (GLOBAL_ACTION_KEY_ASSIST.equals(actionKey)) { Loading Loading @@ -575,7 +580,9 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, DialogIn @Override public void onPress() { new LockPatternUtils(mContext).requireCredentialEntry(UserHandle.USER_ALL); new LockPatternUtils(mContext) .requireStrongAuth(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN, UserHandle.USER_ALL); try { WindowManagerGlobal.getWindowManagerService().lockNow(null); } catch (RemoteException e) { Loading Loading
core/java/android/provider/Settings.java +6 −0 Original line number Diff line number Diff line Loading @@ -7119,6 +7119,11 @@ public final class Settings { */ public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles"; /** * Whether the Lockdown button should be shown in the power menu. * @hide */ public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu"; /** * This are the settings to be backed up. * Loading Loading @@ -7221,6 +7226,7 @@ public final class Settings { SCREENSAVER_COMPONENTS, SCREENSAVER_ACTIVATE_ON_DOCK, SCREENSAVER_ACTIVATE_ON_SLEEP, LOCKDOWN_IN_POWER_MENU, }; /** @hide */ Loading
core/java/com/android/internal/widget/LockPatternUtils.java +7 −1 Original line number Diff line number Diff line Loading @@ -1614,7 +1614,8 @@ public class LockPatternUtils { STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW, SOME_AUTH_REQUIRED_AFTER_USER_REQUEST, STRONG_AUTH_REQUIRED_AFTER_LOCKOUT, STRONG_AUTH_REQUIRED_AFTER_TIMEOUT}) STRONG_AUTH_REQUIRED_AFTER_TIMEOUT, STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN}) @Retention(RetentionPolicy.SOURCE) public @interface StrongAuthFlags {} Loading Loading @@ -1650,6 +1651,11 @@ public class LockPatternUtils { */ public static final int STRONG_AUTH_REQUIRED_AFTER_TIMEOUT = 0x10; /** * Strong authentication is required because the user has triggered lockdown. */ public static final int STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN = 0x20; /** * Strong auth flags that do not prevent fingerprint from being accepted as auth. * Loading
core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2367,12 +2367,14 @@ "silent" = silent mode "users" = list of users "restart" = restart device "lockdown" = Lock down device until the user authenticates --> <string-array translatable="false" name="config_globalActionsList"> <item>power</item> <item>restart</item> <item>bugreport</item> <item>users</item> <item>lockdown</item> </string-array> <!-- Number of milliseconds to hold a wake lock to ensure that drawing is fully Loading
core/res/res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -526,8 +526,8 @@ <!-- label for item that launches voice assist in phone options dialog [CHAR LIMIT=15]--> <string name="global_action_voice_assist">Voice Assist</string> <!-- label for item that locks the phone and enforces that it can't be unlocked without entering a credential. [CHAR LIMIT=15] --> <string name="global_action_lockdown">Lock now</string> <!-- label for item that locks the phone and enforces that it can't be unlocked without strong authentication. [CHAR LIMIT=15] --> <string name="global_action_lockdown">Enter lockdown</string> <!-- Text to use when the number in a notification info is too large (greater than status_bar_notification_info_maxnum, defined in Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +9 −2 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ package com.android.systemui.globalactions; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import com.android.internal.R; import com.android.internal.colorextraction.ColorExtractor; import com.android.internal.colorextraction.ColorExtractor.GradientColors; Loading Loading @@ -310,7 +312,10 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, DialogIn } else if (GLOBAL_ACTION_KEY_SETTINGS.equals(actionKey)) { mItems.add(getSettingsAction()); } else if (GLOBAL_ACTION_KEY_LOCKDOWN.equals(actionKey)) { if (Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.LOCKDOWN_IN_POWER_MENU, 0) != 0) { mItems.add(getLockdownAction()); } } else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) { mItems.add(getVoiceAssistAction()); } else if (GLOBAL_ACTION_KEY_ASSIST.equals(actionKey)) { Loading Loading @@ -575,7 +580,9 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, DialogIn @Override public void onPress() { new LockPatternUtils(mContext).requireCredentialEntry(UserHandle.USER_ALL); new LockPatternUtils(mContext) .requireStrongAuth(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN, UserHandle.USER_ALL); try { WindowManagerGlobal.getWindowManagerService().lockNow(null); } catch (RemoteException e) { Loading