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

Commit 9bff8287 authored by Aaron Echols's avatar Aaron Echols Committed by Steve Kondik
Browse files

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

Change-Id: Ia35960d88468dba44cdfad26c7cc74f811a6844f
parent 7474b8fe
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2042,6 +2042,12 @@ public final class Settings {
         */
        public static final String STATUS_BAR_BRIGHTNESS_CONTROL = "status_bar_brightness_control";

        /**
         * 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
@@ -2111,4 +2111,7 @@
         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>
+1 −0
Original line number Diff line number Diff line
@@ -2210,6 +2210,7 @@

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

  <!-- Notification and battery light -->
  <java-symbol type="bool" name="config_intrusiveNotificationLed" />
+16 −0
Original line number Diff line number Diff line
@@ -84,6 +84,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.AtomicFile;
@@ -414,6 +415,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                    Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE), false, this);
            resolver.registerContentObserver(Settings.Secure.getUriFor(
                    Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD), false, this);
            resolver.registerContentObserver(Settings.System.getUriFor(
                    Settings.System.STATUS_BAR_IME_SWITCHER),
                    false, new ContentObserver(mHandler) {
                        public void onChange(boolean selfChange) {
                            updateFromSettingsLocked(true);
                        }
                    });
        }

        @Override public void onChange(boolean selfChange, Uri uri) {
@@ -1729,6 +1737,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            mCurMethodId = null;
            unbindCurrentMethodLocked(true, false);
        }
        // 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