Merge "Only track focused next served view in onViewFocusChanged" into rvc-dev am: 37b8baa3a8

Change-Id: Ia6668e1f16d3ec4f8e22223eaea5762de2680150
This commit is contained in:
TreeHugger Robot
2020-04-03 15:59:56 +00:00
committed by Automerger Merge Worker

View File

@@ -170,10 +170,15 @@ public final class ImeFocusController {
} }
if (DEBUG) Log.d(TAG, "onViewFocusChanged, view=" + view + ", mServedView=" + mServedView); if (DEBUG) Log.d(TAG, "onViewFocusChanged, view=" + view + ", mServedView=" + mServedView);
// We don't need to track the next served view when the view lost focus here because:
// 1) The current view focus may be cleared temporary when in touch mode, closing input
// at this moment isn't the right way.
// 2) We only care about the served view change when it focused, since changing input
// connection when the focus target changed is reasonable.
// 3) Setting the next served view as null when no more served view should be handled in
// other special events (e.g. view detached from window or the window dismissed).
if (hasFocus) { if (hasFocus) {
mNextServedView = view; mNextServedView = view;
} else if (view == mServedView) {
mNextServedView = null;
} }
mViewRootImpl.dispatchCheckFocus(); mViewRootImpl.dispatchCheckFocus();
} }