OSDN Git Service

SystemUI:will display incorrect SIM pin code
authoryongga <yongga@codeaurora.org>
Thu, 14 Jan 2016 09:46:52 +0000 (17:46 +0800)
committerLinux Build Service Account <lnxbuild@localhost>
Wed, 24 Aug 2016 14:16:09 +0000 (08:16 -0600)
It will display incorrect SIM pin code even though
Input correct PIN code after unlock the first SIM PIN

Condition of judgment for dispaly message has error.
Add condition of judgment for dispaly message.

Change-Id: I7efb88617aa43ca653ffe0518d01a9007828cc9a
CRs-Fixed: 960325

packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java

index 83118d8..96b36db 100755 (executable)
@@ -52,6 +52,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
     private CheckSimPin mCheckSimPinThread;
     private boolean mShowDefaultMessage = true;
     private int mRemainingAttempts = -1;
+    private int mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
     private AlertDialog mRemainingAttemptsDialog;
     private int mSubId;
     private int mSlotId;
@@ -258,6 +259,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
                         @Override
                         public void run() {
                             mRemainingAttempts = attemptsRemaining;
+                            mResult = result;
                             if (mSimUnlockProgressDialog != null) {
                                 mSimUnlockProgressDialog.hide();
                             }
@@ -266,6 +268,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
                             if (result == PhoneConstants.PIN_RESULT_SUCCESS) {
                                 KeyguardUpdateMonitor.getInstance(getContext())
                                         .reportSimUnlocked(mSubId);
+                                mResult = PhoneConstants.PIN_PASSWORD_INCORRECT;
                                 mRemainingAttempts = -1;
                                 mShowDefaultMessage = true;
                                 if (mCallback != null) {
@@ -320,8 +323,10 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
             return;
         }
         if (mRemainingAttempts >= 0) {
-            mSecurityMessageDisplay.setMessage(getPinPasswordErrorMessage(
-                    mRemainingAttempts, true), true);
+            if (mResult != PhoneConstants.PIN_RESULT_SUCCESS)
+                mSecurityMessageDisplay.setMessage(
+                        getPinPasswordErrorMessage(mRemainingAttempts, true),
+                        true);
             return;
         }
 
@@ -349,6 +354,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
                         " attemptsRemaining=" + attemptsRemaining);
                 if (attemptsRemaining >= 0) {
                     mRemainingAttempts = attemptsRemaining;
+                    mResult = result;
                     mSecurityMessageDisplay.setMessage(
                             getPinPasswordErrorMessage(attemptsRemaining, true), true);
                 }