summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeverly Tai <beverlyt@google.com>2023-09-19 20:54:47 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-10-11 22:49:25 +0000
commitcb7e9c7549a2a076ec00db15e3da0d21b31b0b1c (patch)
tree4052f7554f9d3cbbc1b9053bd3bb161079e993d0
parentaf8827252ba25d0287e638862c22b6dfefd2b8d2 (diff)
downloadbase-cb7e9c7549a2a076ec00db15e3da0d21b31b0b1c.tar.gz
Updated: always show the keyguard on device lockdown
Additionally, don't hide keyguard when it's disabled if the user has locked down the device. Manual test steps: 1. Enable app pinning and disable "Ask for PIN before unpinning" setting 2. Pin an app (ie: Settings) 3. Lockdown from the power menu 4. Observe: user is brought to the keyguard, primary auth is required to enter the device. => After entering correct credential, the device is still in app pinning mode. => After entering an incorrect credential, the keyguard remains showing and the user can attempt again up to the limit Bug: 300463732 Bug: 218495634 Test: atest KeyguardViewMediatorTest Test: manual (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d9c7c85c52c007fdedb177b9f5f98821d0a76090) Merged-In: I70fdae80f717712b3dfc9df54b9649959b4bb8f0 Change-Id: I70fdae80f717712b3dfc9df54b9649959b4bb8f0
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 0a38793cc2b5..8d1169335d8d 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -763,6 +763,13 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
}
}
}
+
+ @Override
+ public void onStrongAuthStateChanged(int userId) {
+ if (mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
+ doKeyguardLocked(null);
+ }
+ }
};
ViewMediatorCallback mViewMediatorCallback = new ViewMediatorCallback() {
@@ -1924,6 +1931,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
mExternallyEnabled = enabled;
if (!enabled && mShowing) {
+ if (mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
+ Log.d(TAG, "keyguardEnabled(false) overridden by user lockdown");
+ return;
+ }
// hiding keyguard that is showing, remember to reshow later
if (DEBUG) Log.d(TAG, "remembering to reshow, hiding keyguard, "
+ "disabling status bar expansion");
@@ -2144,8 +2155,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
* Enable the keyguard if the settings are appropriate.
*/
private void doKeyguardLocked(Bundle options) {
- // if another app is disabling us, don't show
- if (!mExternallyEnabled) {
+ // if another app is disabling us, don't show unless we're in lockdown mode
+ if (!mExternallyEnabled
+ && !mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
if (DEBUG) Log.d(TAG, "doKeyguard: not showing because externally disabled");
mNeedToReshowWhenReenabled = true;