From e81ddfe3e70435210b3f9d2d6df67f99e88aaf97 Mon Sep 17 00:00:00 2001 From: Taran Singh Date: Mon, 27 Mar 2023 22:54:17 +0000 Subject: Send gesture cancellation on correct thread CancellationSignal listener should be called on main thread instead of Binder thread. Fix: 275426397 Test: atest InputConnectionEndToEndTest Change-Id: Ief253699d52a19fb36996dd1f6b3487a59f87526 --- core/java/android/view/inputmethod/RemoteInputConnectionImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/inputmethod/RemoteInputConnectionImpl.java b/core/java/android/view/inputmethod/RemoteInputConnectionImpl.java index eb91d08dc278..b9bc2d40978d 100644 --- a/core/java/android/view/inputmethod/RemoteInputConnectionImpl.java +++ b/core/java/android/view/inputmethod/RemoteInputConnectionImpl.java @@ -424,12 +424,15 @@ final class RemoteInputConnectionImpl extends IRemoteInputConnection.Stub { }); } + @Dispatching(cancellable = false) @Override public void cancelCancellationSignal(IBinder token) { if (mBeamer == null) { return; } - mBeamer.cancel(token); + dispatch(() -> { + mBeamer.cancel(token); + }); } @Override -- cgit v1.2.3-59-g8ed1b