Merge "Make removeImeSurfaceFromWindow to one-way" into sc-dev

This commit is contained in:
Yohei Yukawa
2021-04-14 17:12:18 +00:00
committed by Android (Google) Code Review
4 changed files with 7 additions and 15 deletions

View File

@@ -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();
}

View File

@@ -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);

View File

@@ -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();
}
/**

View File

@@ -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