diff options
| author | 2016-12-13 12:07:09 -0800 | |
|---|---|---|
| committer | 2016-12-13 14:53:49 -0800 | |
| commit | e92de95261f45ff9f8b7374eddca63e17866592a (patch) | |
| tree | a3ad9afa1312a42c22d25e55e3711158cc1ea11d | |
| parent | 52a9e0e1ddef258b3d18f901fb9a7884a244ac39 (diff) | |
Keyguard: Don't lock if SIM is NOT_READY
Fixes an issue with MVNOs where the lockscreen
would show in response to a virtual SIM switch.
Now we no longer lock with NOT_READY.
Change-Id: I520200311a5ae3218f1743b1fc9a568c39933ebf
Fixes: 33386149
Bug: 30997251
Test: Set up secure lockscreen, insert Fi SIM, dial *#*#346398#*#*, verify screen does not lock, eject SIM, verify screen locks.
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 54cd77b11e0f..be7a8beb4d05 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -17,6 +17,8 @@ package com.android.systemui.keyguard; import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT; + +import static com.android.internal.telephony.IccCardConstants.State.ABSENT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.SOME_AUTH_REQUIRED_AFTER_USER_REQUEST; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT; @@ -443,7 +445,11 @@ public class KeyguardViewMediator extends SystemUI { resetStateLocked(); } } - onSimNotReadyLocked(); + if (simState == ABSENT) { + // MVNO SIMs can become transiently NOT_READY when switching networks, + // so we should only lock when they are ABSENT. + onSimAbsentLocked(); + } } break; case PIN_REQUIRED: @@ -470,7 +476,7 @@ public class KeyguardViewMediator extends SystemUI { + "show permanently disabled message in lockscreen."); resetStateLocked(); } - onSimNotReadyLocked(); + onSimAbsentLocked(); } break; case READY: @@ -484,22 +490,20 @@ public class KeyguardViewMediator extends SystemUI { default: if (DEBUG_SIM_STATES) Log.v(TAG, "Unspecific state: " + simState); synchronized (KeyguardViewMediator.this) { - onSimNotReadyLocked(); + onSimAbsentLocked(); } break; } } - private void onSimNotReadyLocked() { + private void onSimAbsentLocked() { if (isSecure() && mLockWhenSimRemoved) { mLockWhenSimRemoved = false; MetricsLogger.action(mContext, MetricsEvent.ACTION_LOCK_BECAUSE_SIM_REMOVED, mShowing); if (!mShowing) { - if (DEBUG_SIM_STATES) Log.d(TAG, "SIM removed, showing keyguard"); + Log.i(TAG, "SIM removed, showing keyguard"); doKeyguardLocked(null); - } else { - resetStateLocked(); } } } @@ -1246,7 +1250,7 @@ public class KeyguardViewMediator extends SystemUI { // if the setup wizard hasn't run yet, don't show final boolean requireSim = !SystemProperties.getBoolean("keyguard.no_require_sim", false); final boolean absent = SubscriptionManager.isValidSubscriptionId( - mUpdateMonitor.getNextSubIdForState(IccCardConstants.State.ABSENT)); + mUpdateMonitor.getNextSubIdForState(ABSENT)); final boolean disabled = SubscriptionManager.isValidSubscriptionId( mUpdateMonitor.getNextSubIdForState(IccCardConstants.State.PERM_DISABLED)); final boolean lockedOrMissing = mUpdateMonitor.isSimPinSecure() |