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

Commit 529001f0 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Switch back to StaticRotationList from DynamicRotationList

Ic005b94379f9d847ea, which introduced DynamicRotationList for
smarter input method rotation, is suspected to be causing a
strange behavior that InputMethodManager#switchToNextInputMethod
is choosing unexected/disabled IME/subtype.

With this CL, we switch back to StaticRotationList until the root
cause is addressed.

BUG: 7043015
Change-Id: I95fc8b28536cea6d09ea325e0caee14007cfc0a7
parent c3a6e23e
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -347,11 +347,12 @@ public class InputMethodSubtypeSwitchingController {

    @VisibleForTesting
    public static class ControllerImpl {
        private final DynamicRotationList mSwitchingAwareSubtypeList;
        // TODO: Switch to DynamicRotationList for smarter rotation.
        private final StaticRotationList mSwitchingAwareSubtypeList;
        private final StaticRotationList mSwitchingUnawareSubtypeList;

        public ControllerImpl(final List<ImeSubtypeListItem> sortedItems) {
            mSwitchingAwareSubtypeList = new DynamicRotationList(filterImeSubtypeList(sortedItems,
            mSwitchingAwareSubtypeList = new StaticRotationList(filterImeSubtypeList(sortedItems,
                    true /* supportsSwitchingToNextInputMethod */));
            mSwitchingUnawareSubtypeList = new StaticRotationList(filterImeSubtypeList(sortedItems,
                    false /* supportsSwitchingToNextInputMethod */));
@@ -375,9 +376,10 @@ public class InputMethodSubtypeSwitchingController {
            if (imi == null) {
                return;
            }
            if (imi.supportsSwitchingToNextInputMethod()) {
                mSwitchingAwareSubtypeList.onUserAction(imi, subtype);
            }
            // TODO: Enable the following code when DynamicRotationList is enabled.
            // if (imi.supportsSwitchingToNextInputMethod()) {
            //     mSwitchingAwareSubtypeList.onUserAction(imi, subtype);
            // }
        }

        private static List<ImeSubtypeListItem> filterImeSubtypeList(
+2 −1
Original line number Diff line number Diff line
@@ -214,8 +214,9 @@ public class InputMethodSubtypeSwitchingControllerTest extends InstrumentationTe
                disabledSubtypeUnawareIme, null);
    }

    // This test is disabled until DynamicRotationList is enabled.
    @SmallTest
    public void testControllerImplWithUserAction() throws Exception {
    public void DISABLED_testControllerImplWithUserAction() throws Exception {
        final List<ImeSubtypeListItem> enabledItems = createEnabledImeSubtypes();
        final ImeSubtypeListItem latinIme_en_US = enabledItems.get(0);
        final ImeSubtypeListItem latinIme_fr = enabledItems.get(1);