aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2013-11-04 12:15:54 -0800
committerWink Saville <wink@google.com>2013-11-04 12:15:54 -0800
commit6d3c836bb8991e9cf7ffb322ebabf48c2446126d (patch)
tree7373fb5019c524a8912eb87df138dfdeb1a3aebf
parenta3cfd73ab9b464c93624839d2415981a00a44299 (diff)
downloadtelephony-6d3c836bb8991e9cf7ffb322ebabf48c2446126d.tar.gz
Do not display dialog when PUK attempts remaining is 0.
When using MMI codes to set a new pin and the attempts remaining becomes zero the lock screen, KeyguardSimPukView, will be handling resetting the PIN using the PUK. Therefore we set the MmiCode state to CANCELLED which causes the dialog to be dismissed. If we don't do this then after setting the new PIN from the lock screen the dialog will still be present indicating the user still needs to set the PIN. Bug: 9928717 Change-Id: Ic7dc51ba684a1fd623f2cab0a89f40ef8ff491d5
-rw-r--r--src/java/com/android/internal/telephony/cdma/CdmaMmiCode.java6
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmMmiCode.java7
2 files changed, 11 insertions, 2 deletions
diff --git a/src/java/com/android/internal/telephony/cdma/CdmaMmiCode.java b/src/java/com/android/internal/telephony/cdma/CdmaMmiCode.java
index 07c137b503..3cb8bc7bff 100644
--- a/src/java/com/android/internal/telephony/cdma/CdmaMmiCode.java
+++ b/src/java/com/android/internal/telephony/cdma/CdmaMmiCode.java
@@ -315,7 +315,11 @@ public final class CdmaMmiCode extends Handler implements MmiCode {
}
// Get the No. of retries remaining to unlock PUK/PUK2
int attemptsRemaining = msg.arg1;
- if (attemptsRemaining >= 0) {
+ if (attemptsRemaining <= 0) {
+ Rlog.d(LOG_TAG, "onSetComplete: PUK locked,"
+ + " cancel as lock screen will handle this");
+ mState = State.CANCELLED;
+ } else if (attemptsRemaining > 0) {
Rlog.d(LOG_TAG, "onSetComplete: attemptsRemaining="+attemptsRemaining);
sb.append(mContext.getResources().getQuantityString(
com.android.internal.R.plurals.pinpuk_attempts,
diff --git a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
index 1dd958fed1..c2bafbe442 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
@@ -1030,7 +1030,12 @@ public final class GsmMmiCode extends Handler implements MmiCode {
}
// Get the No. of retries remaining to unlock PUK/PUK2
int attemptsRemaining = msg.arg1;
- if (attemptsRemaining >= 0) {
+ if (attemptsRemaining <= 0) {
+ Rlog.d(LOG_TAG, "onSetComplete: PUK locked,"
+ + " cancel as lock screen will handle this");
+ mState = State.CANCELLED;
+ } else if (attemptsRemaining > 0) {
+ Rlog.d(LOG_TAG, "onSetComplete: attemptsRemaining="+attemptsRemaining);
sb.append(mContext.getResources().getQuantityString(
com.android.internal.R.plurals.pinpuk_attempts,
attemptsRemaining, attemptsRemaining));