summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2016-12-14 00:55:36 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-12-14 00:55:41 +0000
commit3a39fe6bed33f8f28ac0ffe447057af9ab962a3f (patch)
tree2ad09b69be2a647a697a7502364ae4e4561f1b08
parentf755dfb89e8524cc5df399fe1ae2459c8a13489a (diff)
parente92de95261f45ff9f8b7374eddca63e17866592a (diff)
Merge "Keyguard: Don't lock if SIM is NOT_READY" into nyc-mr2-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java20
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()