diff options
author | Jim Miller <jaggies@google.com> | 2013-11-05 14:22:36 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-11-05 14:22:36 -0800 |
commit | 7d304f6404b7917de6ac50ab3a0cac1dc40c50e6 (patch) | |
tree | bab8b126dc457ea651dd21555b150e3ad9287673 | |
parent | 79d81e68aa61fe7b00cdcba433f9f58f255cb368 (diff) | |
parent | 39724755a5c95a56d529a61fa68833027433d132 (diff) | |
download | frameworks_base-7d304f6404b7917de6ac50ab3a0cac1dc40c50e6.zip frameworks_base-7d304f6404b7917de6ac50ab3a0cac1dc40c50e6.tar.gz frameworks_base-7d304f6404b7917de6ac50ab3a0cac1dc40c50e6.tar.bz2 |
am 39724755: am 6bb4af27: am e19ed435: Merge "Add explicit refererences and logging to KeyguardSim/Puk" into klp-dev
* commit '39724755a5c95a56d529a61fa68833027433d132':
Add explicit refererences and logging to KeyguardSim/Puk
-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(); } } |