Merge "Fix 6507787: fix MMI PUK unlock procedure" into jb-dev

This commit is contained in:
Jim Miller
2012-06-15 15:19:16 -07:00
committed by Android (Google) Code Review
2 changed files with 24 additions and 1 deletions

View File

@@ -105,6 +105,8 @@ public class KeyguardUpdateMonitor {
protected static final int MSG_DPM_STATE_CHANGED = 309;
protected static final int MSG_USER_CHANGED = 310;
protected static final boolean DEBUG_SIM_STATES = DEBUG || false;
/**
* When we receive a
* {@link com.android.internal.telephony.TelephonyIntents#ACTION_SIM_STATE_CHANGED} broadcast,
@@ -292,6 +294,10 @@ public class KeyguardUpdateMonitor {
MSG_BATTERY_UPDATE, new BatteryStatus(status, level, plugged, health));
mHandler.sendMessage(msg);
} else if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(action)) {
if (DEBUG_SIM_STATES) {
Log.v(TAG, "action " + action + " state" +
intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE));
}
mHandler.sendMessage(mHandler.obtainMessage(
MSG_SIM_STATE_CHANGE, SimArgs.fromIntent(intent)));
} else if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) {
@@ -407,6 +413,7 @@ public class KeyguardUpdateMonitor {
}
if (state != IccCard.State.UNKNOWN && state != mSimState) {
if (DEBUG_SIM_STATES) Log.v(TAG, "dispatching state: " + state);
mSimState = state;
for (int i = 0; i < mSimStateCallbacks.size(); i++) {
mSimStateCallbacks.get(i).onSimStateChanged(state);

View File

@@ -202,8 +202,21 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
private Runnable mRecreateRunnable = new Runnable() {
public void run() {
updateScreen(mMode, true);
Mode mode = mMode;
// If we were previously in a locked state but now it's Unknown, it means the phone
// was previously locked because of SIM state and has since been resolved. This
// bit of code checks this condition and dismisses keyguard.
boolean dismissAfterCreation = false;
if (mode == Mode.UnlockScreen && getUnlockMode() == UnlockMode.Unknown) {
if (DEBUG) Log.v(TAG, "Switch to Mode.LockScreen because SIM unlocked");
mode = Mode.LockScreen;
dismissAfterCreation = true;
}
updateScreen(mode, true);
restoreWidgetState();
if (dismissAfterCreation) {
mKeyguardScreenCallback.keyguardDone(false);
}
}
};
@@ -307,6 +320,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
}
public void recreateMe(Configuration config) {
if (DEBUG) Log.v(TAG, "recreateMe()");
removeCallbacks(mRecreateRunnable);
post(mRecreateRunnable);
}
@@ -524,6 +538,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
public void reset() {
mIsVerifyUnlockOnly = false;
mForgotPattern = false;
if (DEBUG) Log.v(TAG, "reset()");
post(mRecreateRunnable);
}
@@ -673,6 +688,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase {
if (DEBUG_CONFIGURATION) Log.v(TAG, "**** re-creating lock screen since config changed");
saveWidgetState();
removeCallbacks(mRecreateRunnable);
if (DEBUG) Log.v(TAG, "recreating lockscreen because config changed");
post(mRecreateRunnable);
}