Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +3 −2 Original line number Diff line number Diff line Loading @@ -3668,7 +3668,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mLogger.logSimState(subId, slotId, state); boolean becameAbsent = false; if (!SubscriptionManager.isValidSubscriptionId(subId)) { if (!SubscriptionManager.isValidSubscriptionId(subId) && state != TelephonyManager.SIM_STATE_UNKNOWN) { mLogger.w("invalid subId in handleSimStateChange()"); /* Only handle No SIM(ABSENT) and Card Error(CARD_IO_ERROR) due to * handleServiceStateChange() handle other case */ Loading Loading @@ -3703,7 +3704,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab data.subId = subId; data.slotId = slotId; } if ((changed || becameAbsent) && state != TelephonyManager.SIM_STATE_UNKNOWN) { if ((changed || becameAbsent) || state == TelephonyManager.SIM_STATE_UNKNOWN) { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +3 −0 Original line number Diff line number Diff line Loading @@ -697,6 +697,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, } } break; case TelephonyManager.SIM_STATE_UNKNOWN: mPendingPinLock = false; break; default: if (DEBUG_SIM_STATES) Log.v(TAG, "Unspecific state: " + simState); break; Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -2800,6 +2800,16 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { ); } @Test public void testOnSimStateChanged_Unknown() { KeyguardUpdateMonitorCallback keyguardUpdateMonitorCallback = spy( KeyguardUpdateMonitorCallback.class); mKeyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback); mKeyguardUpdateMonitor.handleSimStateChange(-1, 0, TelephonyManager.SIM_STATE_UNKNOWN); verify(keyguardUpdateMonitorCallback).onSimStateChanged(-1, 0, TelephonyManager.SIM_STATE_UNKNOWN); } private void verifyFingerprintAuthenticateNeverCalled() { verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), any()); verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), anyInt(), Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +3 −2 Original line number Diff line number Diff line Loading @@ -3668,7 +3668,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab mLogger.logSimState(subId, slotId, state); boolean becameAbsent = false; if (!SubscriptionManager.isValidSubscriptionId(subId)) { if (!SubscriptionManager.isValidSubscriptionId(subId) && state != TelephonyManager.SIM_STATE_UNKNOWN) { mLogger.w("invalid subId in handleSimStateChange()"); /* Only handle No SIM(ABSENT) and Card Error(CARD_IO_ERROR) due to * handleServiceStateChange() handle other case */ Loading Loading @@ -3703,7 +3704,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab data.subId = subId; data.slotId = slotId; } if ((changed || becameAbsent) && state != TelephonyManager.SIM_STATE_UNKNOWN) { if ((changed || becameAbsent) || state == TelephonyManager.SIM_STATE_UNKNOWN) { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +3 −0 Original line number Diff line number Diff line Loading @@ -697,6 +697,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, } } break; case TelephonyManager.SIM_STATE_UNKNOWN: mPendingPinLock = false; break; default: if (DEBUG_SIM_STATES) Log.v(TAG, "Unspecific state: " + simState); break; Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -2800,6 +2800,16 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase { ); } @Test public void testOnSimStateChanged_Unknown() { KeyguardUpdateMonitorCallback keyguardUpdateMonitorCallback = spy( KeyguardUpdateMonitorCallback.class); mKeyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback); mKeyguardUpdateMonitor.handleSimStateChange(-1, 0, TelephonyManager.SIM_STATE_UNKNOWN); verify(keyguardUpdateMonitorCallback).onSimStateChanged(-1, 0, TelephonyManager.SIM_STATE_UNKNOWN); } private void verifyFingerprintAuthenticateNeverCalled() { verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), any()); verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), anyInt(), Loading