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

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

Inline InputMethodSettings#isShowImeWithHardKeyboardEnabled

In order to remove the dependency on InputMethodSettings from
InputMethodMenuController, this CL inlines

  InputMethodSettings#isShowImeWithHardKeyboardEnabled

with keeping the current behavior.

This is a mechanical refactoring CL. There must be no observable
behavior change.

Bug: 309868254
Bug: 309837937
Test: presubmit
Change-Id: I0c3e0e16f361dff84c3b79040a9a83058512088f
parent 47f311b2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -209,7 +209,9 @@ final class InputMethodMenuController {
    }

    void updateKeyboardFromSettingsLocked() {
        mShowImeWithHardKeyboard = mSettings.isShowImeWithHardKeyboardEnabled();
        mShowImeWithHardKeyboard =
                SecureSettingsWrapper.getBoolean(Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD,
                        false, mService.getCurrentImeUserIdLocked());
        if (mSwitchingDialog != null && mSwitchingDialogTitleView != null
                && mSwitchingDialog.isShowing()) {
            final Switch hardKeySwitch = mSwitchingDialogTitleView.findViewById(
+0 −4
Original line number Diff line number Diff line
@@ -660,10 +660,6 @@ final class InputMethodUtils {
            return getInt(Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE, NOT_A_SUBTYPE_ID);
        }

        boolean isShowImeWithHardKeyboardEnabled() {
            return getBoolean(Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD, false);
        }

        @UserIdInt
        public int getCurrentUserId() {
            return mCurrentUserId;
+0 −7
Original line number Diff line number Diff line
@@ -1239,9 +1239,6 @@ public class InputMethodUtilsTest {
                methodMap, 0 /* userId */);
        assertEquals(0, settings.getCurrentUserId());

        settings.isShowImeWithHardKeyboardEnabled();
        verify(ownerUserContext.getContentResolver(), atLeastOnce()).getAttributionSource();

        settings.getEnabledInputMethodSubtypeListLocked(nonSystemIme, true);
        verify(ownerUserContext.getResources(), atLeastOnce()).getConfiguration();

@@ -1250,10 +1247,6 @@ public class InputMethodUtilsTest {
        settings.switchCurrentUser(10 /* userId */);
        assertEquals(10, settings.getCurrentUserId());

        settings.isShowImeWithHardKeyboardEnabled();
        verify(TestContext.getSecondaryUserContext().getContentResolver(),
                atLeastOnce()).getAttributionSource();

        settings.getEnabledInputMethodSubtypeListLocked(nonSystemIme, true);
        verify(TestContext.getSecondaryUserContext().getResources(),
                atLeastOnce()).getConfiguration();