summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lucas Dupin <dupin@google.com> 2020-02-27 17:33:55 -0800
committer Lucas Dupin <dupin@google.com> 2020-02-28 01:45:35 +0000
commit8833d1eb4c75ab8b6ed7712b2ab7ce48307d3f4e (patch)
tree78165dac8b93649743eed0ad6f58f70c428614cd
parent28a0b857f45a1e0273eb3d11a5cbd35c29d7e8b6 (diff)
Fix bouncer race condition
Bouncer would get stuck if authentication method changed after view inflation. Bug: 149773776 Bug: 149828540 Test: atest PlatformScenarioTests:android.platform.test.scenario.sysui.lockscreen.LockscreenWithInvalidPIN Change-Id: I39ee2ec2e2ba9b6cf7dfba6b8141efc8b380b48e
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
index ba8a1a945a77..3cf07d14cbf2 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -19,7 +19,9 @@ import static android.view.ViewRootImpl.NEW_INSETS_MODE_FULL;
import static android.view.ViewRootImpl.sNewInsetsMode;
import static android.view.WindowInsets.Type.ime;
import static android.view.WindowInsets.Type.systemBars;
+
import static com.android.systemui.DejankUtils.whitelistIpcs;
+
import static java.lang.Integer.max;
import android.app.Activity;
@@ -28,7 +30,6 @@ import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
-import android.graphics.Rect;
import android.metrics.LogMaker;
import android.os.Handler;
import android.os.Looper;
@@ -511,6 +512,8 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
boolean finish = false;
boolean strongAuth = false;
int eventSubtype = -1;
+ mCurrentSecuritySelection = whitelistIpcs(() ->
+ mSecurityModel.getSecurityMode(targetUserId));
if (mUpdateMonitor.getUserHasTrust(targetUserId)) {
finish = true;
eventSubtype = BOUNCER_DISMISS_EXTENDED_ACCESS;
@@ -518,13 +521,8 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
finish = true;
eventSubtype = BOUNCER_DISMISS_BIOMETRIC;
} else if (SecurityMode.None == mCurrentSecuritySelection) {
- SecurityMode securityMode = mSecurityModel.getSecurityMode(targetUserId);
- if (SecurityMode.None == securityMode) {
- finish = true; // no security required
- eventSubtype = BOUNCER_DISMISS_NONE_SECURITY;
- } else {
- showSecurityScreen(securityMode); // switch to the alternate security view
- }
+ finish = true; // no security required
+ eventSubtype = BOUNCER_DISMISS_NONE_SECURITY;
} else if (authenticated) {
switch (mCurrentSecuritySelection) {
case Pattern: