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

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

Merge "Stop supporting null IME token in IMM#switchToLastInputMethod()"

parents dbd8c1b9 0c49908a
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -2520,16 +2520,6 @@ public final class InputMethodManager {
     */
    @Deprecated
    public boolean switchToLastInputMethod(IBinder imeToken) {
        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.switchToPreviousInputMethod(imeToken);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        }
        return InputMethodPrivilegedOperationsRegistry.get(imeToken).switchToPreviousInputMethod();
    }

+0 −2
Original line number Diff line number Diff line
@@ -74,8 +74,6 @@ interface IInputMethodManager {
    boolean notifySuggestionPicked(in SuggestionSpan span, String originalString, int index);
    InputMethodSubtype getCurrentInputMethodSubtype();
    boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
    // TODO(Bug 114488811): this can be removed once we deprecate special null token rule.
    boolean switchToPreviousInputMethod(in IBinder token);
    void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
    // This is kept due to @UnsupportedAppUsage.
    // TODO(Bug 113914148): Consider removing this.
+5 −2
Original line number Diff line number Diff line
@@ -3119,12 +3119,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        }
    }

    @Override
    public boolean switchToPreviousInputMethod(IBinder token) {
    @BinderThread
    private boolean switchToPreviousInputMethod(IBinder token) {
        if (!calledFromValidUser()) {
            return false;
        }
        synchronized (mMethodMap) {
            if (!calledWithValidToken(token)) {
                return false;
            }
            final Pair<String, String> lastIme = mSettings.getLastInputMethodAndSubtypeLocked();
            final InputMethodInfo lastImi;
            if (lastIme != null) {
+0 −7
Original line number Diff line number Diff line
@@ -1593,13 +1593,6 @@ public final class MultiClientInputMethodManagerService {
            return false;
        }

        @BinderThread
        @Override
        public boolean switchToPreviousInputMethod(IBinder token) {
            reportNotSupported();
            return false;
        }

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