Merge "Make sure to call back View#onCheckIsTextEditor() on the UI thread" into udc-qpr-dev am: ac9e269b00

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23813171

Change-Id: I7d3f8d0a1d4843b4584d47c940d97e5d1ae7fd17
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Yohei Yukawa
2023-06-27 19:59:19 +00:00
committed by Automerger Merge Worker

View File

@@ -2657,17 +2657,6 @@ public final class InputMethodManager {
}
}
if (windowGainingFocus == null) {
windowGainingFocus = view.getWindowToken();
if (windowGainingFocus == null) {
Log.e(TAG, "ABORT input: ServedView must be attached to a Window");
return false;
}
startInputFlags = getStartInputFlags(view, startInputFlags);
softInputMode = view.getViewRootImpl().mWindowAttributes.softInputMode;
windowFlags = view.getViewRootImpl().mWindowAttributes.flags;
}
// Now we need to get an input connection from the served view.
// This is complicated in a couple ways: we can't be holding our lock
// when calling out to the view, and we need to make sure we call into
@@ -2690,6 +2679,17 @@ public final class InputMethodManager {
return false;
}
if (windowGainingFocus == null) {
windowGainingFocus = view.getWindowToken();
if (windowGainingFocus == null) {
Log.e(TAG, "ABORT input: ServedView must be attached to a Window");
return false;
}
startInputFlags = getStartInputFlags(view, startInputFlags);
softInputMode = view.getViewRootImpl().mWindowAttributes.softInputMode;
windowFlags = view.getViewRootImpl().mWindowAttributes.flags;
}
// Okay we are now ready to call into the served view and have it
// do its stuff.
// Life is good: let's hook everything up!