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

Commit c997ca0b authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Android (Google) Code Review
Browse files

Merge "Switch back to StaticRotationList from DynamicRotationList"

parents 10bfef0b 529001f0
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);