Loading policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +21 −13 Original line number Original line Diff line number Diff line Loading @@ -110,10 +110,14 @@ public class KeyguardUpdateMonitor { * the intent and provide a {@link SimCard.State} result. * the intent and provide a {@link SimCard.State} result. */ */ private static class SimArgs { private static class SimArgs { public final IccCard.State simState; public final IccCard.State simState; private SimArgs(Intent intent) { SimArgs(IccCard.State state) { simState = state; } static SimArgs fromIntent(Intent intent) { IccCard.State state; if (!TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(intent.getAction())) { if (!TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(intent.getAction())) { throw new IllegalArgumentException("only handles intent ACTION_SIM_STATE_CHANGED"); throw new IllegalArgumentException("only handles intent ACTION_SIM_STATE_CHANGED"); } } Loading @@ -124,27 +128,28 @@ public class KeyguardUpdateMonitor { if (IccCard.INTENT_VALUE_ABSENT_ON_PERM_DISABLED.equals( if (IccCard.INTENT_VALUE_ABSENT_ON_PERM_DISABLED.equals( absentReason)) { absentReason)) { this.simState = IccCard.State.PERM_DISABLED; state = IccCard.State.PERM_DISABLED; } else { } else { this.simState = IccCard.State.ABSENT; state = IccCard.State.ABSENT; } } } else if (IccCard.INTENT_VALUE_ICC_READY.equals(stateExtra)) { } else if (IccCard.INTENT_VALUE_ICC_READY.equals(stateExtra)) { this.simState = IccCard.State.READY; state = IccCard.State.READY; } else if (IccCard.INTENT_VALUE_ICC_LOCKED.equals(stateExtra)) { } else if (IccCard.INTENT_VALUE_ICC_LOCKED.equals(stateExtra)) { final String lockedReason = intent final String lockedReason = intent .getStringExtra(IccCard.INTENT_KEY_LOCKED_REASON); .getStringExtra(IccCard.INTENT_KEY_LOCKED_REASON); if (IccCard.INTENT_VALUE_LOCKED_ON_PIN.equals(lockedReason)) { if (IccCard.INTENT_VALUE_LOCKED_ON_PIN.equals(lockedReason)) { this.simState = IccCard.State.PIN_REQUIRED; state = IccCard.State.PIN_REQUIRED; } else if (IccCard.INTENT_VALUE_LOCKED_ON_PUK.equals(lockedReason)) { } else if (IccCard.INTENT_VALUE_LOCKED_ON_PUK.equals(lockedReason)) { this.simState = IccCard.State.PUK_REQUIRED; state = IccCard.State.PUK_REQUIRED; } else { } else { this.simState = IccCard.State.UNKNOWN; state = IccCard.State.UNKNOWN; } } } else if (IccCard.INTENT_VALUE_LOCKED_NETWORK.equals(stateExtra)) { } else if (IccCard.INTENT_VALUE_LOCKED_NETWORK.equals(stateExtra)) { this.simState = IccCard.State.NETWORK_LOCKED; state = IccCard.State.NETWORK_LOCKED; } else { } else { this.simState = IccCard.State.UNKNOWN; state = IccCard.State.UNKNOWN; } } return new SimArgs(state); } } public String toString() { public String toString() { Loading Loading @@ -279,8 +284,7 @@ public class KeyguardUpdateMonitor { mHandler.sendMessage(msg); mHandler.sendMessage(msg); } else if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(action)) { } else if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(action)) { mHandler.sendMessage(mHandler.obtainMessage( mHandler.sendMessage(mHandler.obtainMessage( MSG_SIM_STATE_CHANGE, MSG_SIM_STATE_CHANGE, SimArgs.fromIntent(intent))); new SimArgs(intent))); } else if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) { } else if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) { mHandler.sendMessage(mHandler.obtainMessage(MSG_RINGER_MODE_CHANGED, mHandler.sendMessage(mHandler.obtainMessage(MSG_RINGER_MODE_CHANGED, intent.getIntExtra(AudioManager.EXTRA_RINGER_MODE, -1), 0)); intent.getIntExtra(AudioManager.EXTRA_RINGER_MODE, -1), 0)); Loading Loading @@ -571,12 +575,16 @@ public class KeyguardUpdateMonitor { } } /** /** * Report that the user succesfully entered the sim pin or puk so we * Report that the user successfully entered the SIM PIN or PUK/SIM PIN so we * have the information earlier than waiting for the intent * have the information earlier than waiting for the intent * broadcast from the telephony code. * broadcast from the telephony code. * * NOTE: Because handleSimStateChange() invokes callbacks immediately without going * through mHandler, this *must* be called from the UI thread. */ */ public void reportSimUnlocked() { public void reportSimUnlocked() { mSimState = IccCard.State.READY; mSimState = IccCard.State.READY; handleSimStateChange(new SimArgs(mSimState)); } } public boolean isKeyguardBypassEnabled() { public boolean isKeyguardBypassEnabled() { Loading policy/src/com/android/internal/policy/impl/SimPukUnlockScreen.java +18 −14 Original line number Original line Diff line number Diff line Loading @@ -242,7 +242,9 @@ public class SimPukUnlockScreen extends LinearLayout implements KeyguardScreen, new CheckSimPuk(mPukText.getText().toString(), new CheckSimPuk(mPukText.getText().toString(), mPinText.getText().toString()) { mPinText.getText().toString()) { void onSimLockChangedResponse(boolean success) { void onSimLockChangedResponse(final boolean success) { mPinText.post(new Runnable() { public void run() { if (mSimUnlockProgressDialog != null) { if (mSimUnlockProgressDialog != null) { mSimUnlockProgressDialog.hide(); mSimUnlockProgressDialog.hide(); } } Loading @@ -257,6 +259,8 @@ public class SimPukUnlockScreen extends LinearLayout implements KeyguardScreen, mPinText.setText(""); mPinText.setText(""); } } } } }); } }.start(); }.start(); } } Loading policy/src/com/android/internal/policy/impl/SimUnlockScreen.java +19 −15 Original line number Original line Diff line number Diff line Loading @@ -214,7 +214,9 @@ public class SimUnlockScreen extends LinearLayout implements KeyguardScreen, Vie getSimUnlockProgressDialog().show(); getSimUnlockProgressDialog().show(); new CheckSimPin(mPinText.getText().toString()) { new CheckSimPin(mPinText.getText().toString()) { void onSimLockChangedResponse(boolean success) { void onSimLockChangedResponse(final boolean success) { mPinText.post(new Runnable() { public void run() { if (mSimUnlockProgressDialog != null) { if (mSimUnlockProgressDialog != null) { mSimUnlockProgressDialog.hide(); mSimUnlockProgressDialog.hide(); } } Loading @@ -230,6 +232,8 @@ public class SimUnlockScreen extends LinearLayout implements KeyguardScreen, Vie } } mCallback.pokeWakelock(); mCallback.pokeWakelock(); } } }); } }.start(); }.start(); } } Loading Loading
policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +21 −13 Original line number Original line Diff line number Diff line Loading @@ -110,10 +110,14 @@ public class KeyguardUpdateMonitor { * the intent and provide a {@link SimCard.State} result. * the intent and provide a {@link SimCard.State} result. */ */ private static class SimArgs { private static class SimArgs { public final IccCard.State simState; public final IccCard.State simState; private SimArgs(Intent intent) { SimArgs(IccCard.State state) { simState = state; } static SimArgs fromIntent(Intent intent) { IccCard.State state; if (!TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(intent.getAction())) { if (!TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(intent.getAction())) { throw new IllegalArgumentException("only handles intent ACTION_SIM_STATE_CHANGED"); throw new IllegalArgumentException("only handles intent ACTION_SIM_STATE_CHANGED"); } } Loading @@ -124,27 +128,28 @@ public class KeyguardUpdateMonitor { if (IccCard.INTENT_VALUE_ABSENT_ON_PERM_DISABLED.equals( if (IccCard.INTENT_VALUE_ABSENT_ON_PERM_DISABLED.equals( absentReason)) { absentReason)) { this.simState = IccCard.State.PERM_DISABLED; state = IccCard.State.PERM_DISABLED; } else { } else { this.simState = IccCard.State.ABSENT; state = IccCard.State.ABSENT; } } } else if (IccCard.INTENT_VALUE_ICC_READY.equals(stateExtra)) { } else if (IccCard.INTENT_VALUE_ICC_READY.equals(stateExtra)) { this.simState = IccCard.State.READY; state = IccCard.State.READY; } else if (IccCard.INTENT_VALUE_ICC_LOCKED.equals(stateExtra)) { } else if (IccCard.INTENT_VALUE_ICC_LOCKED.equals(stateExtra)) { final String lockedReason = intent final String lockedReason = intent .getStringExtra(IccCard.INTENT_KEY_LOCKED_REASON); .getStringExtra(IccCard.INTENT_KEY_LOCKED_REASON); if (IccCard.INTENT_VALUE_LOCKED_ON_PIN.equals(lockedReason)) { if (IccCard.INTENT_VALUE_LOCKED_ON_PIN.equals(lockedReason)) { this.simState = IccCard.State.PIN_REQUIRED; state = IccCard.State.PIN_REQUIRED; } else if (IccCard.INTENT_VALUE_LOCKED_ON_PUK.equals(lockedReason)) { } else if (IccCard.INTENT_VALUE_LOCKED_ON_PUK.equals(lockedReason)) { this.simState = IccCard.State.PUK_REQUIRED; state = IccCard.State.PUK_REQUIRED; } else { } else { this.simState = IccCard.State.UNKNOWN; state = IccCard.State.UNKNOWN; } } } else if (IccCard.INTENT_VALUE_LOCKED_NETWORK.equals(stateExtra)) { } else if (IccCard.INTENT_VALUE_LOCKED_NETWORK.equals(stateExtra)) { this.simState = IccCard.State.NETWORK_LOCKED; state = IccCard.State.NETWORK_LOCKED; } else { } else { this.simState = IccCard.State.UNKNOWN; state = IccCard.State.UNKNOWN; } } return new SimArgs(state); } } public String toString() { public String toString() { Loading Loading @@ -279,8 +284,7 @@ public class KeyguardUpdateMonitor { mHandler.sendMessage(msg); mHandler.sendMessage(msg); } else if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(action)) { } else if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(action)) { mHandler.sendMessage(mHandler.obtainMessage( mHandler.sendMessage(mHandler.obtainMessage( MSG_SIM_STATE_CHANGE, MSG_SIM_STATE_CHANGE, SimArgs.fromIntent(intent))); new SimArgs(intent))); } else if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) { } else if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) { mHandler.sendMessage(mHandler.obtainMessage(MSG_RINGER_MODE_CHANGED, mHandler.sendMessage(mHandler.obtainMessage(MSG_RINGER_MODE_CHANGED, intent.getIntExtra(AudioManager.EXTRA_RINGER_MODE, -1), 0)); intent.getIntExtra(AudioManager.EXTRA_RINGER_MODE, -1), 0)); Loading Loading @@ -571,12 +575,16 @@ public class KeyguardUpdateMonitor { } } /** /** * Report that the user succesfully entered the sim pin or puk so we * Report that the user successfully entered the SIM PIN or PUK/SIM PIN so we * have the information earlier than waiting for the intent * have the information earlier than waiting for the intent * broadcast from the telephony code. * broadcast from the telephony code. * * NOTE: Because handleSimStateChange() invokes callbacks immediately without going * through mHandler, this *must* be called from the UI thread. */ */ public void reportSimUnlocked() { public void reportSimUnlocked() { mSimState = IccCard.State.READY; mSimState = IccCard.State.READY; handleSimStateChange(new SimArgs(mSimState)); } } public boolean isKeyguardBypassEnabled() { public boolean isKeyguardBypassEnabled() { Loading
policy/src/com/android/internal/policy/impl/SimPukUnlockScreen.java +18 −14 Original line number Original line Diff line number Diff line Loading @@ -242,7 +242,9 @@ public class SimPukUnlockScreen extends LinearLayout implements KeyguardScreen, new CheckSimPuk(mPukText.getText().toString(), new CheckSimPuk(mPukText.getText().toString(), mPinText.getText().toString()) { mPinText.getText().toString()) { void onSimLockChangedResponse(boolean success) { void onSimLockChangedResponse(final boolean success) { mPinText.post(new Runnable() { public void run() { if (mSimUnlockProgressDialog != null) { if (mSimUnlockProgressDialog != null) { mSimUnlockProgressDialog.hide(); mSimUnlockProgressDialog.hide(); } } Loading @@ -257,6 +259,8 @@ public class SimPukUnlockScreen extends LinearLayout implements KeyguardScreen, mPinText.setText(""); mPinText.setText(""); } } } } }); } }.start(); }.start(); } } Loading
policy/src/com/android/internal/policy/impl/SimUnlockScreen.java +19 −15 Original line number Original line Diff line number Diff line Loading @@ -214,7 +214,9 @@ public class SimUnlockScreen extends LinearLayout implements KeyguardScreen, Vie getSimUnlockProgressDialog().show(); getSimUnlockProgressDialog().show(); new CheckSimPin(mPinText.getText().toString()) { new CheckSimPin(mPinText.getText().toString()) { void onSimLockChangedResponse(boolean success) { void onSimLockChangedResponse(final boolean success) { mPinText.post(new Runnable() { public void run() { if (mSimUnlockProgressDialog != null) { if (mSimUnlockProgressDialog != null) { mSimUnlockProgressDialog.hide(); mSimUnlockProgressDialog.hide(); } } Loading @@ -230,6 +232,8 @@ public class SimUnlockScreen extends LinearLayout implements KeyguardScreen, Vie } } mCallback.pokeWakelock(); mCallback.pokeWakelock(); } } }); } }.start(); }.start(); } } Loading