Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18281968 authored by Ruthwar Kumar Ambeer's avatar Ruthwar Kumar Ambeer Committed by Gerrit - the friendly Code Review server
Browse files

SIM PIN Retry attempts display on Bootup.

When SIM state is changed to ABSENT/NOT READY, Closing Keygaurd
is not required Explicitely in M as it is handled by default.
Hence re designed the logic to avoid exceptions.

Change-Id: I8024b6ddd75c2630734e8d750d83f88c994e165a
parent 7d737651
Loading
Loading
Loading
Loading
+7 −17
Original line number Diff line number Diff line
@@ -59,12 +59,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
        @Override
        public void onSimStateChanged(int subId, int slotId, State simState) {
           if (DEBUG) Log.v(TAG, "onSimStateChanged(subId=" + subId + ",state=" + simState + ")");
           switch (simState) {
               case NOT_READY:
               case ABSENT:
                   closeKeyGuard();
                   break;
           }
           resetState();
       };
    };

@@ -255,7 +250,12 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
                            }
                            resetPasswordText(true /* animate */);
                            if (result == PhoneConstants.PIN_RESULT_SUCCESS) {
                                closeKeyGuard();
                                KeyguardUpdateMonitor.getInstance(getContext())
                                        .reportSimUnlocked(mSubId);
                                mRemainingAttempts = -1;
                                if (mCallback != null) {
                                    mCallback.dismiss(true);
                                }
                            } else {
                                mShowDefaultMessage = false;
                                if (result == PhoneConstants.PIN_PASSWORD_INCORRECT) {
@@ -298,16 +298,6 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
        return false;
    }

    private void closeKeyGuard() {
        if (DEBUG) Log.d(TAG, "closeKeyGuard: Verification Completed, closing Keyguard.");
        mRemainingAttempts = -1;
        KeyguardUpdateMonitor.getInstance(getContext())
                         .reportSimUnlocked(mSubId);
        mCallback.dismiss(true);
        mShowDefaultMessage = true;
        reset();
    }

    private void showDefaultMessage() {
        KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
        mSubId = monitor.getNextSubIdForState(IccCardConstants.State.PIN_REQUIRED);