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

Commit 70f17e7c authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Remove IInputMethodManager#switchToNextInputMethod()

It turns out that we had already rejected null IME token in
InputMethodManager#switchToNextInputMethod() since Android L [1].

Hence there is no need to keep this IPC any more.

There should be no developer-visible behavior change.

 [1]: I043aa30a19c821f33effd57dfd6590b0e3ed817b
      34c666472137a99a2ce5546b80bd04979d10ab7a

Bug: 114488811
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I72ee82d62e3bdce44f623604eca86ab3fe3df0bd
parent e770d22d
Loading
Loading
Loading
Loading
+0 −10
Original line number Original line Diff line number Diff line
@@ -2548,16 +2548,6 @@ public final class InputMethodManager {
     */
     */
    @Deprecated
    @Deprecated
    public boolean switchToNextInputMethod(IBinder imeToken, boolean onlyCurrentIme) {
    public boolean switchToNextInputMethod(IBinder imeToken, boolean onlyCurrentIme) {
        if (imeToken == null) {
            // Note: null token is allowed for callers that have WRITE_SECURE_SETTINGS permission.
            // Thus we cannot always rely on InputMethodPrivilegedOperationsRegistry unfortunately.
            // TODO(Bug 114488811): Consider deprecating null token rule.
            try {
                return mService.switchToNextInputMethod(imeToken, onlyCurrentIme);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        }
        return InputMethodPrivilegedOperationsRegistry.get(imeToken)
        return InputMethodPrivilegedOperationsRegistry.get(imeToken)
                .switchToNextInputMethod(onlyCurrentIme);
                .switchToNextInputMethod(onlyCurrentIme);
    }
    }
+0 −2
Original line number Original line Diff line number Diff line
@@ -76,8 +76,6 @@ interface IInputMethodManager {
    boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
    boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
    // TODO(Bug 114488811): this can be removed once we deprecate special null token rule.
    // TODO(Bug 114488811): this can be removed once we deprecate special null token rule.
    boolean switchToPreviousInputMethod(in IBinder token);
    boolean switchToPreviousInputMethod(in IBinder token);
    // TODO(Bug 114488811): this can be removed once we deprecate special null token rule.
    boolean switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme);
    void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
    void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
    // This is kept due to @UnsupportedAppUsage.
    // This is kept due to @UnsupportedAppUsage.
    // TODO(Bug 113914148): Consider removing this.
    // TODO(Bug 113914148): Consider removing this.
+2 −2
Original line number Original line Diff line number Diff line
@@ -3191,8 +3191,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        }
        }
    }
    }


    @Override
    @BinderThread
    public boolean switchToNextInputMethod(IBinder token, boolean onlyCurrentIme) {
    private boolean switchToNextInputMethod(IBinder token, boolean onlyCurrentIme) {
        if (!calledFromValidUser()) {
        if (!calledFromValidUser()) {
            return false;
            return false;
        }
        }
+0 −7
Original line number Original line Diff line number Diff line
@@ -1600,13 +1600,6 @@ public final class MultiClientInputMethodManagerService {
            return false;
            return false;
        }
        }


        @BinderThread
        @Override
        public boolean switchToNextInputMethod(IBinder token, boolean onlyCurrentIme) {
            reportNotSupported();
            return false;
        }

        @BinderThread
        @BinderThread
        @Override
        @Override
        public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {
        public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {