Merge "Handle when sim state indicates that it is absent" into udc-dev am: ea97953353
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23846298 Change-Id: I151237a44d3334484f24af5a09d771f211b4ec93 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -296,6 +296,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
private static final ComponentName FALLBACK_HOME_COMPONENT = new ComponentName(
|
private static final ComponentName FALLBACK_HOME_COMPONENT = new ComponentName(
|
||||||
"com.android.settings", "com.android.settings.FallbackHome");
|
"com.android.settings", "com.android.settings.FallbackHome");
|
||||||
|
|
||||||
|
private static final List<Integer> ABSENT_SIM_STATE_LIST = Arrays.asList(
|
||||||
|
TelephonyManager.SIM_STATE_ABSENT,
|
||||||
|
TelephonyManager.SIM_STATE_UNKNOWN,
|
||||||
|
TelephonyManager.SIM_STATE_NOT_READY);
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final UserTracker mUserTracker;
|
private final UserTracker mUserTracker;
|
||||||
private final KeyguardUpdateMonitorLogger mLogger;
|
private final KeyguardUpdateMonitorLogger mLogger;
|
||||||
@@ -3698,8 +3703,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
mLogger.logSimState(subId, slotId, state);
|
mLogger.logSimState(subId, slotId, state);
|
||||||
|
|
||||||
boolean becameAbsent = false;
|
boolean becameAbsent = false;
|
||||||
if (!SubscriptionManager.isValidSubscriptionId(subId)
|
if (!SubscriptionManager.isValidSubscriptionId(subId)) {
|
||||||
&& state != TelephonyManager.SIM_STATE_UNKNOWN) {
|
|
||||||
mLogger.w("invalid subId in handleSimStateChange()");
|
mLogger.w("invalid subId in handleSimStateChange()");
|
||||||
/* Only handle No SIM(ABSENT) and Card Error(CARD_IO_ERROR) due to
|
/* Only handle No SIM(ABSENT) and Card Error(CARD_IO_ERROR) due to
|
||||||
* handleServiceStateChange() handle other case */
|
* handleServiceStateChange() handle other case */
|
||||||
@@ -3717,11 +3721,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
}
|
}
|
||||||
} else if (state == TelephonyManager.SIM_STATE_CARD_IO_ERROR) {
|
} else if (state == TelephonyManager.SIM_STATE_CARD_IO_ERROR) {
|
||||||
updateTelephonyCapable(true);
|
updateTelephonyCapable(true);
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
becameAbsent |= ABSENT_SIM_STATE_LIST.contains(state);
|
||||||
|
|
||||||
SimData data = mSimDatas.get(subId);
|
SimData data = mSimDatas.get(subId);
|
||||||
final boolean changed;
|
final boolean changed;
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
@@ -3734,7 +3738,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
data.subId = subId;
|
data.subId = subId;
|
||||||
data.slotId = slotId;
|
data.slotId = slotId;
|
||||||
}
|
}
|
||||||
if ((changed || becameAbsent) || state == TelephonyManager.SIM_STATE_UNKNOWN) {
|
if ((changed || becameAbsent)) {
|
||||||
for (int i = 0; i < mCallbacks.size(); i++) {
|
for (int i = 0; i < mCallbacks.size(); i++) {
|
||||||
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
|
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
|
||||||
if (cb != null) {
|
if (cb != null) {
|
||||||
|
|||||||
@@ -642,6 +642,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
|
|||||||
switch (simState) {
|
switch (simState) {
|
||||||
case TelephonyManager.SIM_STATE_NOT_READY:
|
case TelephonyManager.SIM_STATE_NOT_READY:
|
||||||
case TelephonyManager.SIM_STATE_ABSENT:
|
case TelephonyManager.SIM_STATE_ABSENT:
|
||||||
|
case TelephonyManager.SIM_STATE_UNKNOWN:
|
||||||
|
mPendingPinLock = false;
|
||||||
// only force lock screen in case of missing sim if user hasn't
|
// only force lock screen in case of missing sim if user hasn't
|
||||||
// gone through setup wizard
|
// gone through setup wizard
|
||||||
synchronized (KeyguardViewMediator.this) {
|
synchronized (KeyguardViewMediator.this) {
|
||||||
@@ -706,9 +708,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TelephonyManager.SIM_STATE_UNKNOWN:
|
|
||||||
mPendingPinLock = false;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
if (DEBUG_SIM_STATES) Log.v(TAG, "Unspecific state: " + simState);
|
if (DEBUG_SIM_STATES) Log.v(TAG, "Unspecific state: " + simState);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -2935,6 +2935,16 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
TelephonyManager.SIM_STATE_UNKNOWN);
|
TelephonyManager.SIM_STATE_UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testOnSimStateChanged_HandleSimStateNotReady() {
|
||||||
|
KeyguardUpdateMonitorCallback keyguardUpdateMonitorCallback = spy(
|
||||||
|
KeyguardUpdateMonitorCallback.class);
|
||||||
|
mKeyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback);
|
||||||
|
mKeyguardUpdateMonitor.handleSimStateChange(-1, 0, TelephonyManager.SIM_STATE_NOT_READY);
|
||||||
|
verify(keyguardUpdateMonitorCallback).onSimStateChanged(-1, 0,
|
||||||
|
TelephonyManager.SIM_STATE_NOT_READY);
|
||||||
|
}
|
||||||
|
|
||||||
private void verifyFingerprintAuthenticateNeverCalled() {
|
private void verifyFingerprintAuthenticateNeverCalled() {
|
||||||
verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), any());
|
verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), any());
|
||||||
verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), anyInt(),
|
verify(mFingerprintManager, never()).authenticate(any(), any(), any(), any(), anyInt(),
|
||||||
|
|||||||
Reference in New Issue
Block a user