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

Unverified Commit 887768ca authored by Aaron Echols's avatar Aaron Echols Committed by Michael Bestas
Browse files

framework: port IME selector notification toggle (2/2)

Change-Id: Ia35960d88468dba44cdfad26c7cc74f811a6844f

framework: fix 'port IME selector notification toggle'

Change-Id: I7801cc9edc2341c447e2c3eafd9344216eb6c0c6
parent fa6ddf18
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2792,6 +2792,12 @@ public final class Settings {
         */
        public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;

        /**
         * Whether to show the IME switcher in the status bar
         * @hide
         */
        public static final String STATUS_BAR_IME_SWITCHER = "status_bar_ime_switcher";

        /**
         * The keyboard brightness to be used while the screen is on.
         * Valid value range is between 0 and {@link PowerManager#getMaximumKeyboardBrightness()}
+3 −0
Original line number Diff line number Diff line
@@ -2869,4 +2869,7 @@
    <!-- Timeout in MS for how long you have to long-press the back key to
         kill the foreground app. -->
    <integer name="config_backKillTimeout">2000</integer>

    <!-- Setting to false will disable CM's IME switcher implementation for tablets -->
    <bool name="config_show_cmIMESwitcher">true</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -2864,6 +2864,9 @@
  <!-- Gesture Sensor -->
  <java-symbol type="bool" name="config_enableGestureService" />

  <!-- Config.xml entries -->
  <java-symbol type="bool" name="config_show_cmIMESwitcher"/>

  <!-- Developer settings - Kill app back press -->
  <java-symbol type="string" name="app_killed_message" />

+17 −2
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ import android.os.SystemClock;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.text.TextUtils;
import android.text.style.SuggestionSpan;
import android.util.ArrayMap;
@@ -515,6 +516,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                    Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD), false, this, userId);
            resolver.registerContentObserver(Settings.Secure.getUriFor(
                    Settings.Secure.ACCESSIBILITY_SOFT_KEYBOARD_MODE), false, this, userId);
            resolver.registerContentObserver(Settings.System.getUriFor(
                    Settings.System.STATUS_BAR_IME_SWITCHER),
                    false, new ContentObserver(mHandler) {
                        public void onChange(boolean selfChange) {
                            updateFromSettingsLocked(true);
                        }
                    }, userId);

            mRegistered = true;
        }

@@ -1090,8 +1099,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                    mStatusBar.setIconVisibility(mSlotIme, false);
                }
                updateSystemUiLocked(mCurToken, mImeWindowVis, mBackDisposition);
                mShowOngoingImeSwitcherForPhones = mRes.getBoolean(
                        com.android.internal.R.bool.show_ongoing_ime_switcher);
                if (mShowOngoingImeSwitcherForPhones) {
                    mWindowManagerInternal.setOnHardKeyboardStatusChangeListener(
                            mHardKeyboardListener);
@@ -1968,6 +1975,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            // There is no longer an input method set, so stop any current one.
            resetCurrentMethodAndClient(InputMethodClient.UNBIND_REASON_NO_IME);
        }
        // code to disable the CM Phone IME switcher with config_show_cmIMESwitcher set = false
        try {
            mShowOngoingImeSwitcherForPhones = Settings.System.getInt(mContext.getContentResolver(),
            Settings.System.STATUS_BAR_IME_SWITCHER) == 1;
        } catch (SettingNotFoundException e) {
            mShowOngoingImeSwitcherForPhones = mRes.getBoolean(
            com.android.internal.R.bool.config_show_cmIMESwitcher);
        }
        // Here is not the perfect place to reset the switching controller. Ideally
        // mSwitchingController and mSettings should be able to share the same state.
        // TODO: Make sure that mSwitchingController and mSettings are sharing the