Merge "Prevent re-entrant calls to onPause" into tm-dev am: d39f0f7cfd am: afc8080c60
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19034153 Change-Id: I4e46ac00adc83f343d7d65e31ae35d4f5ecb6c85 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -59,6 +59,7 @@ public class KeyguardPasswordViewController
|
||||
private final boolean mShowImeAtScreenOn;
|
||||
private EditText mPasswordEntry;
|
||||
private ImageView mSwitchImeButton;
|
||||
private boolean mPaused;
|
||||
|
||||
private final OnEditorActionListener mOnEditorActionListener = (v, actionId, event) -> {
|
||||
// Check if this was the result of hitting the enter key
|
||||
@@ -202,6 +203,7 @@ public class KeyguardPasswordViewController
|
||||
@Override
|
||||
public void onResume(int reason) {
|
||||
super.onResume(reason);
|
||||
mPaused = false;
|
||||
if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) {
|
||||
showInput();
|
||||
}
|
||||
@@ -223,6 +225,11 @@ public class KeyguardPasswordViewController
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
if (mPaused) {
|
||||
return;
|
||||
}
|
||||
mPaused = true;
|
||||
|
||||
if (!mPasswordEntry.isVisibleToUser()) {
|
||||
// Reset all states directly and then hide IME when the screen turned off.
|
||||
super.onPause();
|
||||
|
||||
Reference in New Issue
Block a user