Merge "Prevent re-entrant calls to onPause" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d39f0f7cfd
@@ -59,6 +59,7 @@ public class KeyguardPasswordViewController
|
|||||||
private final boolean mShowImeAtScreenOn;
|
private final boolean mShowImeAtScreenOn;
|
||||||
private EditText mPasswordEntry;
|
private EditText mPasswordEntry;
|
||||||
private ImageView mSwitchImeButton;
|
private ImageView mSwitchImeButton;
|
||||||
|
private boolean mPaused;
|
||||||
|
|
||||||
private final OnEditorActionListener mOnEditorActionListener = (v, actionId, event) -> {
|
private final OnEditorActionListener mOnEditorActionListener = (v, actionId, event) -> {
|
||||||
// Check if this was the result of hitting the enter key
|
// Check if this was the result of hitting the enter key
|
||||||
@@ -202,6 +203,7 @@ public class KeyguardPasswordViewController
|
|||||||
@Override
|
@Override
|
||||||
public void onResume(int reason) {
|
public void onResume(int reason) {
|
||||||
super.onResume(reason);
|
super.onResume(reason);
|
||||||
|
mPaused = false;
|
||||||
if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) {
|
if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) {
|
||||||
showInput();
|
showInput();
|
||||||
}
|
}
|
||||||
@@ -222,6 +224,11 @@ public class KeyguardPasswordViewController
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
|
if (mPaused) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mPaused = true;
|
||||||
|
|
||||||
if (!mPasswordEntry.isVisibleToUser()) {
|
if (!mPasswordEntry.isVisibleToUser()) {
|
||||||
// Reset all states directly and then hide IME when the screen turned off.
|
// Reset all states directly and then hide IME when the screen turned off.
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
|||||||
Reference in New Issue
Block a user