Merge "Fix IME be dismissed abruptly" into sc-dev
This commit is contained in:
@@ -3372,9 +3372,9 @@ public final class ViewRootImpl implements ViewParent,
|
||||
}
|
||||
// TODO (b/131181940): Make sure this doesn't leak Activity with mActivityConfigCallback
|
||||
// config changes.
|
||||
final View focusedView = mView != null ? mView.findFocus() : null;
|
||||
if (hasWindowFocus) {
|
||||
mInsetsController.onWindowFocusGained(focusedView != null /* hasViewFocused */);
|
||||
mInsetsController.onWindowFocusGained(
|
||||
getFocusedViewOrNull() != null /* hasViewFocused */);
|
||||
} else {
|
||||
mInsetsController.onWindowFocusLost();
|
||||
}
|
||||
@@ -3423,7 +3423,8 @@ public final class ViewRootImpl implements ViewParent,
|
||||
|
||||
// Note: must be done after the focus change callbacks,
|
||||
// so all of the view state is set up correctly.
|
||||
mImeFocusController.onPostWindowFocus(focusedView, hasWindowFocus, mWindowAttributes);
|
||||
mImeFocusController.onPostWindowFocus(
|
||||
getFocusedViewOrNull(), hasWindowFocus, mWindowAttributes);
|
||||
|
||||
if (hasWindowFocus) {
|
||||
// Clear the forward bit. We can just do this directly, since
|
||||
@@ -6392,6 +6393,11 @@ public final class ViewRootImpl implements ViewParent,
|
||||
mView.dispatchTooltipHoverEvent(event);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private View getFocusedViewOrNull() {
|
||||
return mView != null ? mView.findFocus() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs synthesis of new input events from unhandled input events.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user