Skip to content

Commit 05a6cbe

Browse files
committed
Fix a bug with IME blinking just after leaving the lock screen
Bug: 6286786 Change-Id: I9ee42482f7abffaefec31f0c4a661bef7c230137
1 parent 8fa2339 commit 05a6cbe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/java/android/view/inputmethod/InputMethodManager.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,9 @@ public void handleMessage(Message msg) {
405405
}
406406
// Check focus again in case that "onWindowFocus" is called before
407407
// handling this message.
408-
checkFocus(mHasBeenInactive);
408+
if (mServedView != null && mServedView.hasWindowFocus()) {
409+
checkFocus(mHasBeenInactive);
410+
}
409411
}
410412
}
411413
return;
@@ -1202,7 +1204,9 @@ private boolean checkFocusNoStartInput(boolean forceNewFocus) {
12021204
}
12031205
if (DEBUG) Log.v(TAG, "checkFocus: view=" + mServedView
12041206
+ " next=" + mNextServedView
1205-
+ " forceNewFocus=" + forceNewFocus);
1207+
+ " forceNewFocus=" + forceNewFocus
1208+
+ " package="
1209+
+ (mServedView != null ? mServedView.getContext().getPackageName() : "<none>"));
12061210

12071211
if (mNextServedView == null) {
12081212
finishInputLocked();

0 commit comments

Comments
 (0)