Merge "Set mNextServedView as null only when current served view lost focus" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-03-14 00:26:57 +00:00
committed by Android (Google) Code Review

View File

@@ -165,10 +165,16 @@ public final class ImeFocusController {
if (!getImmDelegate().isCurrentRootView(view.getViewRootImpl())) { if (!getImmDelegate().isCurrentRootView(view.getViewRootImpl())) {
return; return;
} }
if (mServedView == view || !view.hasImeFocus() || !view.hasWindowFocus()) { if (!view.hasImeFocus() || !view.hasWindowFocus()) {
return; return;
} }
mNextServedView = hasFocus ? view : null; if (DEBUG) Log.d(TAG, "onViewFocusChanged, view=" + view + ", mServedView=" + mServedView);
if (hasFocus) {
mNextServedView = view;
} else if (view == mServedView) {
mNextServedView = null;
}
mViewRootImpl.dispatchCheckFocus(); mViewRootImpl.dispatchCheckFocus();
} }