Skip to content

Commit 460f457

Browse files
satok16Android (Google) Code Review
authored andcommitted
Merge "Re-start input when the IME is deactivated but window is focused"
2 parents 4d992db + 31e4e14 commit 460f457

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,9 @@ public void handleMessage(Message msg) {
403403
mIInputContext.finishComposingText();
404404
} catch (RemoteException e) {
405405
}
406+
// Check focus again in case that "onWindowFocus" is called before
407+
// handling this message.
408+
checkFocus(mHasBeenInactive);
406409
}
407410
}
408411
return;
@@ -1173,13 +1176,17 @@ static void scheduleCheckFocusLocked(View view) {
11731176
}
11741177
}
11751178

1179+
private void checkFocus(boolean forceNewFocus) {
1180+
if (checkFocusNoStartInput(forceNewFocus)) {
1181+
startInputInner(null, 0, 0, 0);
1182+
}
1183+
}
1184+
11761185
/**
11771186
* @hide
11781187
*/
11791188
public void checkFocus() {
1180-
if (checkFocusNoStartInput(false)) {
1181-
startInputInner(null, 0, 0, 0);
1182-
}
1189+
checkFocus(false);
11831190
}
11841191

11851192
private boolean checkFocusNoStartInput(boolean forceNewFocus) {

0 commit comments

Comments
 (0)