Merge "Call onInputConnectionClosed synchronously" into udc-dev

This commit is contained in:
Justin Ghan
2023-03-30 23:11:51 +00:00
committed by Android (Google) Code Review

View File

@@ -405,21 +405,15 @@ final class RemoteInputConnectionImpl extends IRemoteInputConnection.Stub {
}
if (handler.getLooper().isCurrentThread()) {
servedView.onInputConnectionClosedInternal();
final ViewRootImpl viewRoot = servedView.getViewRootImpl();
if (viewRoot != null) {
viewRoot.getHandwritingInitiator().onInputConnectionClosed(servedView);
}
} else {
handler.post(servedView::onInputConnectionClosedInternal);
handler.post(() -> {
final ViewRootImpl viewRoot = servedView.getViewRootImpl();
if (viewRoot != null) {
viewRoot.getHandwritingInitiator()
.onInputConnectionClosed(servedView);
}
});
}
}
final ViewRootImpl viewRoot = servedView.getViewRootImpl();
if (viewRoot != null) {
viewRoot.getHandwritingInitiator().onInputConnectionClosed(servedView);
}
}
});
}