Merge "Remove PIN/PUK keyguard when SIM is removed/ready"

This commit is contained in:
Brad Ebinger
2017-09-01 21:06:27 +00:00
committed by Gerrit Code Review
2 changed files with 30 additions and 6 deletions

View File

@@ -59,8 +59,18 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
@Override @Override
public void onSimStateChanged(int subId, int slotId, State simState) { public void onSimStateChanged(int subId, int slotId, State simState) {
if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",state=" + simState + ")"); if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",state=" + simState + ")");
switch(simState) {
// If the SIM is removed, then we must remove the keyguard. It will be put up
// again when the PUK locked SIM is re-entered.
case ABSENT: {
KeyguardUpdateMonitor.getInstance(getContext()).reportSimUnlocked(mSubId);
mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser());
break;
}
default:
resetState(); resetState();
}; }
}
}; };
public KeyguardSimPinView(Context context) { public KeyguardSimPinView(Context context) {

View File

@@ -61,8 +61,22 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView {
@Override @Override
public void onSimStateChanged(int subId, int slotId, State simState) { public void onSimStateChanged(int subId, int slotId, State simState) {
if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",state=" + simState + ")"); if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",state=" + simState + ")");
switch(simState) {
// If the SIM is removed, then we must remove the keyguard. It will be put up
// again when the PUK locked SIM is re-entered.
case ABSENT:
// intentional fall-through
// If the SIM is unlocked via a key sequence through the emergency dialer, it will
// move into the READY state and the PUK lock keyguard should be removed.
case READY: {
KeyguardUpdateMonitor.getInstance(getContext()).reportSimUnlocked(mSubId);
mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser());
break;
}
default:
resetState(); resetState();
}; }
}
}; };
public KeyguardSimPukView(Context context) { public KeyguardSimPukView(Context context) {