Merge "Make IInputMethodManager#reportActivityViewAsync() truly async" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
096c8547d3
@@ -3106,10 +3106,7 @@ public final class InputMethodManager {
|
||||
matrixValues = new float[9];
|
||||
matrix.getValues(matrixValues);
|
||||
}
|
||||
final Completable.Void value = Completable.createVoid();
|
||||
mService.reportActivityView(
|
||||
mClient, childDisplayId, matrixValues, ResultCallbacks.of(value));
|
||||
Completable.getResult(value);
|
||||
mService.reportActivityViewAsync(mClient, childDisplayId, matrixValues);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ interface IInputMethodManager {
|
||||
// TODO(Bug 113914148): Consider removing this.
|
||||
oneway void getInputMethodWindowVisibleHeight(IIntResultCallback resultCallback);
|
||||
|
||||
oneway void reportActivityView(in IInputMethodClient parentClient, int childDisplayId,
|
||||
in float[] matrixValues, in IVoidResultCallback resultCallback);
|
||||
oneway void reportActivityViewAsync(in IInputMethodClient parentClient, int childDisplayId,
|
||||
in float[] matrixValues);
|
||||
|
||||
oneway void reportPerceptibleAsync(in IBinder windowToken, boolean perceptible);
|
||||
/** Remove the IME surface. Requires INTERNAL_SYSTEM_WINDOW permission. */
|
||||
|
||||
@@ -4046,9 +4046,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reportActivityView(IInputMethodClient parentClient, int childDisplayId,
|
||||
float[] matrixValues, IVoidResultCallback resultCallback) {
|
||||
CallbackUtils.onResult(resultCallback, () -> {
|
||||
public void reportActivityViewAsync(IInputMethodClient parentClient, int childDisplayId,
|
||||
float[] matrixValues) {
|
||||
try {
|
||||
final DisplayInfo displayInfo = mDisplayManagerInternal.getDisplayInfo(childDisplayId);
|
||||
if (displayInfo == null) {
|
||||
throw new IllegalArgumentException(
|
||||
@@ -4127,7 +4127,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
displayId = info.mParentClient.selfReportedDisplayId;
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Throwable t) {
|
||||
if (parentClient != null) {
|
||||
try {
|
||||
parentClient.throwExceptionFromSystem(t.toString());
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1864,10 +1864,9 @@ public final class MultiClientInputMethodManagerService {
|
||||
|
||||
@BinderThread
|
||||
@Override
|
||||
public void reportActivityView(IInputMethodClient parentClient, int childDisplayId,
|
||||
float[] matrixValues, IVoidResultCallback resultCallback) {
|
||||
public void reportActivityViewAsync(IInputMethodClient parentClient, int childDisplayId,
|
||||
float[] matrixValues) {
|
||||
reportNotSupported();
|
||||
CallbackUtils.onResult(resultCallback, () -> { });
|
||||
}
|
||||
|
||||
@BinderThread
|
||||
|
||||
Reference in New Issue
Block a user