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

Commit d1d60c3a authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Fix SIM PIN listener registration

User correct lifecycle methods for listener regristion,
otherwise error messages would show up on the shared text field

Test: add/remove locked sim card
Test: solve sim challenge, go to bouncer
Fixes: 130906933
Change-Id: I5327c447b770da1148c3e3ef19c6a75e69832a90
parent 0a71ae95
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -135,7 +135,6 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
            return;
        }


        // Sending empty PIN here to query the number of remaining PIN attempts
        new CheckSimPin("", mSubId) {
            void onSimCheckResponse(final int result, final int attemptsRemaining) {
@@ -216,20 +215,15 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
    }

    @Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mUpdateMonitorCallback);
        resetState();
    }
    public void showUsabilityHint() {

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mUpdateMonitorCallback);
    }

    @Override
    public void showUsabilityHint() {
    public void onResume(int reason) {
        super.onResume(reason);
        KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mUpdateMonitorCallback);
        resetState();
    }

    @Override
@@ -239,6 +233,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
            mSimUnlockProgressDialog.dismiss();
            mSimUnlockProgressDialog = null;
        }
        KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mUpdateMonitorCallback);
    }

    /**