diff options
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java | 16 | ||||
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java | 17 |
2 files changed, 20 insertions, 13 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java index e39622a..9accbb4 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java @@ -46,9 +46,10 @@ public class KeyguardSimPinView extends KeyguardAbsKeyInputView implements KeyguardSecurityView, OnEditorActionListener, TextWatcher { private static final String LOG_TAG = "KeyguardSimPinView"; private static final boolean DEBUG = KeyguardViewMediator.DEBUG; + public static final String TAG = "KeyguardSimPinView"; private ProgressDialog mSimUnlockProgressDialog = null; - private volatile boolean mSimCheckInProgress; + private CheckSimPin mCheckSimPinThread; private AlertDialog mRemainingAttemptsDialog; @@ -169,14 +170,17 @@ public class KeyguardSimPinView extends KeyguardAbsKeyInputView @Override public void run() { try { + Log.v(TAG, "call supplyPinReportResult()"); final int[] result = ITelephony.Stub.asInterface(ServiceManager .checkService("phone")).supplyPinReportResult(mPin); + Log.v(TAG, "supplyPinReportResult returned: " + result[0] + " " + result[1]); post(new Runnable() { public void run() { onSimCheckResponse(result[0], result[1]); } }); } catch (RemoteException e) { + Log.e(TAG, "RemoteException for supplyPinReportResult:", e); post(new Runnable() { public void run() { onSimCheckResponse(PhoneConstants.PIN_GENERAL_FAILURE, -1); @@ -229,9 +233,8 @@ public class KeyguardSimPinView extends KeyguardAbsKeyInputView getSimUnlockProgressDialog().show(); - if (!mSimCheckInProgress) { - mSimCheckInProgress = true; // there should be only one - new CheckSimPin(mPasswordEntry.getText().toString()) { + if (mCheckSimPinThread == null) { + mCheckSimPinThread = new CheckSimPin(mPasswordEntry.getText().toString()) { void onSimCheckResponse(final int result, final int attemptsRemaining) { post(new Runnable() { public void run() { @@ -263,11 +266,12 @@ public class KeyguardSimPinView extends KeyguardAbsKeyInputView mPasswordEntry.setText(""); } mCallback.userActivity(0); - mSimCheckInProgress = false; + mCheckSimPinThread = null; } }); } - }.start(); + }; + mCheckSimPinThread.start(); } } } diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java index 31518a1..6e9e83e 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java @@ -45,9 +45,10 @@ public class KeyguardSimPukView extends KeyguardAbsKeyInputView implements KeyguardSecurityView, OnEditorActionListener, TextWatcher { private static final String LOG_TAG = "KeyguardSimPukView"; private static final boolean DEBUG = KeyguardViewMediator.DEBUG; + public static final String TAG = "KeyguardSimPukView"; private ProgressDialog mSimUnlockProgressDialog = null; - private volatile boolean mCheckInProgress; + private CheckSimPuk mCheckSimPukThread; private String mPukText; private String mPinText; private StateMachine mStateMachine = new StateMachine(); @@ -220,15 +221,17 @@ public class KeyguardSimPukView extends KeyguardAbsKeyInputView @Override public void run() { try { + Log.v(TAG, "call supplyPukReportResult()"); final int[] result = ITelephony.Stub.asInterface(ServiceManager .checkService("phone")).supplyPukReportResult(mPuk, mPin); - + Log.v(TAG, "supplyPukReportResult returned: " + result[0] + " " + result[1]); post(new Runnable() { public void run() { onSimLockChangedResponse(result[0], result[1]); } }); } catch (RemoteException e) { + Log.e(TAG, "RemoteException for supplyPukReportResult:", e); post(new Runnable() { public void run() { onSimLockChangedResponse(PhoneConstants.PIN_GENERAL_FAILURE, -1); @@ -295,9 +298,8 @@ public class KeyguardSimPukView extends KeyguardAbsKeyInputView private void updateSim() { getSimUnlockProgressDialog().show(); - if (!mCheckInProgress) { - mCheckInProgress = true; - new CheckSimPuk(mPukText, mPinText) { + if (mCheckSimPukThread == null) { + mCheckSimPukThread = new CheckSimPuk(mPukText, mPinText) { void onSimLockChangedResponse(final int result, final int attemptsRemaining) { post(new Runnable() { public void run() { @@ -326,11 +328,12 @@ public class KeyguardSimPukView extends KeyguardAbsKeyInputView + " attemptsRemaining=" + attemptsRemaining); mStateMachine.reset(); } - mCheckInProgress = false; + mCheckSimPukThread = null; } }); } - }.start(); + }; + mCheckSimPukThread.start(); } } |