diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 6edd07178ed30..616910ab09cae 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -2230,9 +2230,7 @@ public final class InputMethodManager { public void removeImeSurface(IBinder windowToken) { synchronized (mH) { try { - final Completable.Void value = Completable.createVoid(); - mService.removeImeSurfaceFromWindow(windowToken, ResultCallbacks.of(value)); - Completable.getResult(value); + mService.removeImeSurfaceFromWindowAsync(windowToken); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl index 50bbfc5ccb085..fd13c26b05b20 100644 --- a/core/java/com/android/internal/view/IInputMethodManager.aidl +++ b/core/java/com/android/internal/view/IInputMethodManager.aidl @@ -89,8 +89,7 @@ interface IInputMethodManager { /** Remove the IME surface. Requires INTERNAL_SYSTEM_WINDOW permission. */ oneway void removeImeSurface(in IVoidResultCallback resultCallback); /** Remove the IME surface. Requires passing the currently focused window. */ - oneway void removeImeSurfaceFromWindow(in IBinder windowToken, - in IVoidResultCallback resultCallback); + oneway void removeImeSurfaceFromWindowAsync(in IBinder windowToken); oneway void startProtoDump(in byte[] protoDump, int source, String where, in IVoidResultCallback resultCallback); oneway void isImeTraceEnabled(in IBooleanResultCallback resultCallback); diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index ed8ea186b1d4b..7994fccbd650c 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -4100,13 +4100,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } @Override - public void removeImeSurfaceFromWindow(IBinder windowToken, - IVoidResultCallback resultCallback) { - CallbackUtils.onResult(resultCallback, () -> { - // No permission check, because we'll only execute the request if the calling window is - // also the current IME client. - mHandler.obtainMessage(MSG_REMOVE_IME_SURFACE_FROM_WINDOW, windowToken).sendToTarget(); - }); + public void removeImeSurfaceFromWindowAsync(IBinder windowToken) { + // No permission check, because we'll only execute the request if the calling window is + // also the current IME client. + mHandler.obtainMessage(MSG_REMOVE_IME_SURFACE_FROM_WINDOW, windowToken).sendToTarget(); } /** diff --git a/services/core/java/com/android/server/inputmethod/MultiClientInputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/MultiClientInputMethodManagerService.java index ef1489b4adf9d..62447439003b8 100644 --- a/services/core/java/com/android/server/inputmethod/MultiClientInputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/MultiClientInputMethodManagerService.java @@ -1510,10 +1510,8 @@ public final class MultiClientInputMethodManagerService { @BinderThread @Override - public void removeImeSurfaceFromWindow(IBinder windowToken, - IVoidResultCallback resultCallback) { + public void removeImeSurfaceFromWindowAsync(IBinder windowToken) { reportNotSupported(); - CallbackUtils.onResult(resultCallback, () -> { }); } @BinderThread