From d1d60c3ac3a7baef52fb957b65aee2871c915a1d Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Fri, 19 Apr 2019 15:03:51 -0700 Subject: [PATCH] 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 --- .../android/keyguard/KeyguardSimPinView.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java index 0d8a3db67a1c6..fb3a586677aa9 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java @@ -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,22 +215,17 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView { } @Override - protected void onAttachedToWindow() { - super.onAttachedToWindow(); + public void showUsabilityHint() { + + } + + @Override + public void onResume(int reason) { + super.onResume(reason); KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mUpdateMonitorCallback); resetState(); } - @Override - protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); - KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mUpdateMonitorCallback); - } - - @Override - public void showUsabilityHint() { - } - @Override public void onPause() { // dismiss the dialog. @@ -239,6 +233,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView { mSimUnlockProgressDialog.dismiss(); mSimUnlockProgressDialog = null; } + KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mUpdateMonitorCallback); } /**