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

Commit de16b869 authored by Prathmesh Prabhu's avatar Prathmesh Prabhu
Browse files

SettingsProvider: Add default value for SHOW_IME_WITH_HARD_KEYBOARD.

Allow OEMs to override default behaviour wrt. showing IME with a
hardware keyboard is connected. Current behaviour remains unchanged.

BUG: 27503877
BUG: 27484734
Change-Id: I7ed70b195c3ae98471e413b3eecc5d8fcd3dee26
parent 4123e538
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -155,6 +155,9 @@
    <!-- Default for Settings.Secure.LONG_PRESS_TIMEOUT_MILLIS -->
    <integer name="def_long_press_timeout_millis">500</integer>

    <!-- Default for Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD -->
    <bool name="def_show_ime_with_hard_keyboard">false</bool>

    <!-- Default for Settings.System.POINTER_SPEED -->
    <integer name="def_pointer_speed">0</integer>

+17 −1
Original line number Diff line number Diff line
@@ -1936,7 +1936,7 @@ public class SettingsProvider extends ContentProvider {
        }

        private final class UpgradeController {
            private static final int SETTINGS_VERSION = 124;
            private static final int SETTINGS_VERSION = 125;

            private final int mUserId;

@@ -2116,6 +2116,22 @@ public class SettingsProvider extends ContentProvider {
                    currentVersion = 124;
                }

                if (currentVersion == 124) {
                    // Version 124: allow OEMs to set a default value for whether IME should be
                    // shown when a physical keyboard is connected.
                    final SettingsState secureSettings = getSecureSettingsLocked(userId);
                    Setting currentSetting = secureSettings.getSettingLocked(
                            Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD);
                    if (currentSetting == null) {
                        secureSettings.insertSettingLocked(
                                Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD,
                                getContext().getResources().getBoolean(
                                        R.bool.def_show_ime_with_hard_keyboard) ? "1" : "0",
                                SettingsState.SYSTEM_PACKAGE_NAME);
                    }
                    currentVersion = 125;
                }

                // vXXX: Add new settings above this point.

                // Return the current version.