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

Commit 75f46d33 authored by Wilson Wu's avatar Wilson Wu Committed by Android (Google) Code Review
Browse files

Merge "Make IInputMethodPrivilegedOperations to async (3/N)" into sc-dev

parents 755cd83f c84b3e15
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1627,7 +1627,7 @@ public class InputMethodService extends AbstractInputMethodService {
    }

    private void reportFullscreenMode() {
        mPrivOps.reportFullscreenMode(mIsFullscreen);
        mPrivOps.reportFullscreenModeAsync(mIsFullscreen);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ oneway interface IInputMethodPrivilegedOperations {
    void reportStartInputAsync(in IBinder startInputToken);
    void createInputContentUriToken(in Uri contentUri, in String packageName,
            in IIInputContentUriTokenResultCallback resultCallback);
    void reportFullscreenMode(boolean fullscreen, in IVoidResultCallback resultCallback);
    void reportFullscreenModeAsync(boolean fullscreen);
    void setInputMethod(String id, in IVoidResultCallback resultCallback);
    void setInputMethodAndSubtype(String id, in InputMethodSubtype subtype,
            in IVoidResultCallback resultCallback);
+3 −6
Original line number Diff line number Diff line
@@ -169,21 +169,18 @@ public final class InputMethodPrivilegedOperations {
    }

    /**
     * Calls {@link IInputMethodPrivilegedOperations#reportFullscreenMode(boolean,
     * IVoidResultCallback)}.
     * Calls {@link IInputMethodPrivilegedOperations#reportFullscreenModeAsync(boolean)}.
     *
     * @param fullscreen {@code true} if the IME enters full screen mode
     */
    @AnyThread
    public void reportFullscreenMode(boolean fullscreen) {
    public void reportFullscreenModeAsync(boolean fullscreen) {
        final IInputMethodPrivilegedOperations ops = mOps.getAndWarnIfNull();
        if (ops == null) {
            return;
        }
        try {
            final Completable.Void value = Completable.createVoid();
            ops.reportFullscreenMode(fullscreen, ResultCallbacks.of(value));
            Completable.getResult(value);
            ops.reportFullscreenModeAsync(fullscreen);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+2 −3
Original line number Diff line number Diff line
@@ -6006,9 +6006,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub

        @BinderThread
        @Override
        public void reportFullscreenMode(boolean fullscreen, IVoidResultCallback resultCallback) {
            CallbackUtils.onResult(resultCallback,
                    () -> mImms.reportFullscreenMode(mToken, fullscreen));
        public void reportFullscreenModeAsync(boolean fullscreen) {
            mImms.reportFullscreenMode(mToken, fullscreen);
        }

        @BinderThread