Merge "[Sim Bouncer] Show sim pin view." into tm-d1-dev
This commit is contained in:
@@ -635,13 +635,13 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
case TelephonyManager.SIM_STATE_PUK_REQUIRED:
|
case TelephonyManager.SIM_STATE_PUK_REQUIRED:
|
||||||
synchronized (KeyguardViewMediator.this) {
|
synchronized (KeyguardViewMediator.this) {
|
||||||
mSimWasLocked.append(slotId, true);
|
mSimWasLocked.append(slotId, true);
|
||||||
|
mPendingPinLock = true;
|
||||||
if (!mShowing) {
|
if (!mShowing) {
|
||||||
if (DEBUG_SIM_STATES) Log.d(TAG,
|
if (DEBUG_SIM_STATES) Log.d(TAG,
|
||||||
"INTENT_VALUE_ICC_LOCKED and keygaurd isn't "
|
"INTENT_VALUE_ICC_LOCKED and keygaurd isn't "
|
||||||
+ "showing; need to show keyguard so user can enter sim pin");
|
+ "showing; need to show keyguard so user can enter sim pin");
|
||||||
doKeyguardLocked(null);
|
doKeyguardLocked(null);
|
||||||
} else {
|
} else {
|
||||||
mPendingPinLock = true;
|
|
||||||
resetStateLocked();
|
resetStateLocked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2984,6 +2984,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
pw.print(" mPendingReset: "); pw.println(mPendingReset);
|
pw.print(" mPendingReset: "); pw.println(mPendingReset);
|
||||||
pw.print(" mPendingLock: "); pw.println(mPendingLock);
|
pw.print(" mPendingLock: "); pw.println(mPendingLock);
|
||||||
pw.print(" wakeAndUnlocking: "); pw.println(mWakeAndUnlocking);
|
pw.print(" wakeAndUnlocking: "); pw.println(mWakeAndUnlocking);
|
||||||
|
pw.print(" mPendingPinLock: "); pw.println(mPendingPinLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -185,6 +185,31 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
|
|||||||
verify(mStatusBarKeyguardViewManager, atLeast(1)).show(null);
|
verify(mStatusBarKeyguardViewManager, atLeast(1)).show(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestableLooper.RunWithLooper(setAsMainLooper = true)
|
||||||
|
public void restoreBouncerWhenSimLockedAndKeyguardIsGoingAway_initiallyNotShowing() {
|
||||||
|
// When showing and provisioned
|
||||||
|
mViewMediator.onSystemReady();
|
||||||
|
when(mUpdateMonitor.isDeviceProvisioned()).thenReturn(true);
|
||||||
|
mViewMediator.setShowingLocked(false);
|
||||||
|
|
||||||
|
// and a SIM becomes locked and requires a PIN
|
||||||
|
mViewMediator.mUpdateCallback.onSimStateChanged(
|
||||||
|
1 /* subId */,
|
||||||
|
0 /* slotId */,
|
||||||
|
TelephonyManager.SIM_STATE_PIN_REQUIRED);
|
||||||
|
|
||||||
|
// and the keyguard goes away
|
||||||
|
mViewMediator.setShowingLocked(false);
|
||||||
|
when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(false);
|
||||||
|
mViewMediator.mUpdateCallback.onKeyguardVisibilityChanged(false);
|
||||||
|
|
||||||
|
TestableLooper.get(this).processAllMessages();
|
||||||
|
|
||||||
|
// then make sure it comes back
|
||||||
|
verify(mStatusBarKeyguardViewManager, atLeast(1)).show(null);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBouncerPrompt_deviceLockedByAdmin() {
|
public void testBouncerPrompt_deviceLockedByAdmin() {
|
||||||
// GIVEN no trust agents enabled and biometrics aren't enrolled
|
// GIVEN no trust agents enabled and biometrics aren't enrolled
|
||||||
|
|||||||
Reference in New Issue
Block a user