Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 096c8547 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make IInputMethodManager#reportActivityViewAsync() truly async" into sc-dev

parents e056f435 4baf2915
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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();
        }
+2 −2
Original line number Diff line number Diff line
@@ -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. */
+11 −4
Original line number Diff line number Diff line
@@ -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
+2 −3
Original line number Diff line number Diff line
@@ -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