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

Commit fec8cef7 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Revert "Rotate IMEs (subtypes) by Meta+Space."

This reverts commit ae61f711 [1].

Reason for revert: to deprecate Meta-Space short cut.

 [1]: I4005692215edfcf8bed3e86b1e07000148f986f5

Bug: 79150878
Test: Manually tested as follows.
  1. make -j SoftKeyboard
  2. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  3. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  4. Connect a hardware keyboard
  5. adb shell settings get secure default_input_method
  6. Hit Meta+Space on the hardware keyboard.
  7. adb shell settings get secure default_input_method
  8. Make sure that the results of step 5 and step 7 are the same.
Change-Id: I5ed0feb5a6d7171564d358644b04ee2a43e4d6b3
parent 08115125
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -30,11 +30,6 @@ public interface InputMethodManagerInternal {
     */
    void setInteractive(boolean interactive);

    /**
     * Called by the window manager to let the input method manager rotate the input method.
     */
    void switchInputMethod(boolean forwardDirection);

    /**
     * Hides the current input method, if visible.
     */
+0 −23
Original line number Diff line number Diff line
@@ -210,7 +210,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    static final int MSG_SET_INTERACTIVE = 3030;
    static final int MSG_SET_USER_ACTION_NOTIFICATION_SEQUENCE_NUMBER = 3040;
    static final int MSG_REPORT_FULLSCREEN_MODE = 3045;
    static final int MSG_SWITCH_IME = 3050;

    static final int MSG_HARD_KEYBOARD_SWITCH_CHANGED = 4000;

@@ -3489,9 +3488,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            case MSG_START_VR_INPUT:
                startVrInputMethodNoCheck((ComponentName) msg.obj);
                return true;
            case MSG_SWITCH_IME:
                handleSwitchInputMethod(msg.arg1 != 0);
                return true;
            case MSG_SET_USER_ACTION_NOTIFICATION_SEQUENCE_NUMBER: {
                final int sequenceNumber = msg.arg1;
                final ClientState clientState = (ClientState)msg.obj;
@@ -3545,18 +3541,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        }
    }

    private void handleSwitchInputMethod(final boolean forwardDirection) {
        synchronized (mMethodMap) {
            // TODO: Support forwardDirection.
            final ImeSubtypeListItem nextSubtype = mSwitchingController.getNextInputMethodLocked(
                    false, mMethodMap.get(mCurMethodId), mCurrentSubtype);
            if (nextSubtype == null) {
                return;
            }
            setInputMethodLocked(nextSubtype.mImi.getId(), nextSubtype.mSubtypeId);
        }
    }

    private boolean chooseNewDefaultIMELocked() {
        final InputMethodInfo imi = InputMethodUtils.getMostApplicableDefaultIME(
                mSettings.getEnabledInputMethodListLocked());
@@ -4456,13 +4440,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                    interactive ? 1 : 0, 0));
        }

        @Override
        public void switchInputMethod(boolean forwardDirection) {
            // Do everything in handler so as not to block the caller.
            mHandler.sendMessage(mHandler.obtainMessage(MSG_SWITCH_IME,
                    forwardDirection ? 1 : 0, 0));
        }

        @Override
        public void hideCurrentInputMethod() {
            mHandler.removeMessages(MSG_HIDE_CURRENT_INPUT_METHOD);
+4 −13
Original line number Diff line number Diff line
@@ -3985,22 +3985,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            hideRecentApps(true, false);
        }

        // Handle keyboard layout switching.
        // TODO: Deprecate this behavior when we fully migrate to IME subtype-based layout rotation.
        if (down && repeatCount == 0 && keyCode == KeyEvent.KEYCODE_SPACE
                && ((metaState & KeyEvent.META_CTRL_MASK) != 0)) {
            int direction = (metaState & KeyEvent.META_SHIFT_MASK) != 0 ? -1 : 1;
            mWindowManagerFuncs.switchKeyboardLayout(event.getDeviceId(), direction);
            return -1;
        }

        // Handle input method switching.
        // Handle keyboard language switching.
        if (down && repeatCount == 0
                && (keyCode == KeyEvent.KEYCODE_LANGUAGE_SWITCH
                        || (keyCode == KeyEvent.KEYCODE_SPACE
                                && (metaState & KeyEvent.META_META_MASK) != 0))) {
            final boolean forwardDirection = (metaState & KeyEvent.META_SHIFT_MASK) == 0;
            mWindowManagerFuncs.switchInputMethod(forwardDirection);
                                && (metaState & KeyEvent.META_CTRL_MASK) != 0))) {
            int direction = (metaState & KeyEvent.META_SHIFT_MASK) != 0 ? -1 : 1;
            mWindowManagerFuncs.switchKeyboardLayout(event.getDeviceId(), direction);
            return -1;
        }
        if (mLanguageSwitchKeyPressed && !down
+0 −7
Original line number Diff line number Diff line
@@ -568,13 +568,6 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
         */
        public void switchKeyboardLayout(int deviceId, int direction);

        /**
         * Switch the input method, to be precise, input method subtype.
         *
         * @param forwardDirection {@code true} to rotate in a forward direction.
         */
        public void switchInputMethod(boolean forwardDirection);

        public void shutdown(boolean confirm);
        public void reboot(boolean confirm);
        public void rebootSafeMode(boolean confirm);
+0 −11
Original line number Diff line number Diff line
@@ -222,7 +222,6 @@ import android.view.WindowManager.TransitionFlags;
import android.view.WindowManager.TransitionType;
import android.view.WindowManagerGlobal;
import android.view.WindowManagerPolicyConstants.PointerEventListener;
import android.view.inputmethod.InputMethodManagerInternal;

import com.android.internal.R;
import com.android.internal.graphics.SfVsyncFrameCallbackProvider;
@@ -3237,16 +3236,6 @@ public class WindowManagerService extends IWindowManager.Stub
        mInputManager.switchKeyboardLayout(deviceId, direction);
    }

    // Called by window manager policy.  Not exposed externally.
    @Override
    public void switchInputMethod(boolean forwardDirection) {
        final InputMethodManagerInternal inputMethodManagerInternal =
                LocalServices.getService(InputMethodManagerInternal.class);
        if (inputMethodManagerInternal != null) {
            inputMethodManagerInternal.switchInputMethod(forwardDirection);
        }
    }

    // Called by window manager policy.  Not exposed externally.
    @Override
    public void shutdown(boolean confirm) {