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

Commit 39f4239d authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan Committed by Simon Shields
Browse files

KeyguardSimPinView: don't send dummy request to get remaining pin

I'm not sure of the behavior on QCOM RILs, but on Broadcom RIL
(and probably other RILs), this will eat into the user's PIN
remaining tries. Given that the user is only given ~3 tries, this
is a very bad idea.

In addition, if onAttachedToWindow is called multiple times before
the RIL replies, this can completely delete the retry quota leading
straight to the PUK screen.

Change-Id: I339f1b6d79d543ae8930a7bb95acf823fd5ae20e
parent a938a847
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -315,6 +315,8 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
            mSecurityMessageDisplay.setMessage(getPinPasswordErrorMessage(
                    mRemainingAttempts, true), true);
            return;
        } else {
            mSecurityMessageDisplay.setMessage(R.string.kg_sim_pin_instructions, true);
        }

        int count = TelephonyManager.getDefault().getSimCount();
@@ -334,17 +336,6 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
        mSecurityMessageDisplay.setMessage(msg, true);
        mSimImageView.setImageTintList(ColorStateList.valueOf(color));

        new CheckSimPin("", mSubId) {
            void onSimCheckResponse(final int result, final int attemptsRemaining) {
                Log.d(LOG_TAG, "onSimCheckResponse " + " dummy One result" + result +
                        " attemptsRemaining=" + attemptsRemaining);
                if (attemptsRemaining >= 0) {
                    mRemainingAttempts = attemptsRemaining;
                    mSecurityMessageDisplay.setMessage(
                            getPinPasswordErrorMessage(attemptsRemaining, true), true);
                }
            }
        }.start();
    }
}