Skip to content
Browse files

Add IME Toggler (1/2)

Original work on ICS by romanbb

Signed-off-by: BMc08GT <bmc08gt.teamb00sted@gmail.com>

Conflicts:
	api/current.txt
	core/java/android/provider/Settings.java

Also brought in changes from http://gerrit.sudoservers.com/#/c/3921/

Change-Id: I46aa7dec5924c1fbec648c4f7541afdde3d59ffe
  • Loading branch information...
1 parent f2f3208 commit 40390fbed591f201bd076acaad157c49510761a9 BMc08GT committed with Gerrit Code Review
View
1 api/current.txt
@@ -18994,6 +18994,7 @@ package android.provider {
field public static final java.lang.String SETUP_WIZARD_HAS_RUN = "setup_wizard_has_run";
field public static final java.lang.String SHOW_GTALK_SERVICE_STATUS = "SHOW_GTALK_SERVICE_STATUS";
field public static final deprecated java.lang.String SHOW_PROCESSES = "show_processes";
+ field public static final java.lang.String SHOW_STATUSBAR_IME_SWITCHER = "show_statusbar_ime_switcher";
field public static final deprecated java.lang.String SHOW_WEB_SUGGESTIONS = "show_web_suggestions";
field public static final java.lang.String SOUND_EFFECTS_ENABLED = "sound_effects_enabled";
field public static final deprecated java.lang.String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in";
View
7 core/java/android/provider/Settings.java
@@ -3043,6 +3043,13 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON;
/**
+ * IME Switcher
+ *
+ * @hide
+ */
+ public static final String SHOW_STATUSBAR_IME_SWITCHER = "show_statusbar_ime_switcher";
+
+ /**
* @deprecated Use
* {@link android.provider.Settings.Global#WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY} instead
*/
View
12 services/java/com/android/server/InputMethodManagerService.java
@@ -399,6 +399,13 @@ public String toString() {
Settings.Secure.ENABLED_INPUT_METHODS), false, this);
resolver.registerContentObserver(Settings.Secure.getUriFor(
Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE), false, this);
+ resolver.registerContentObserver(Settings.System.getUriFor(
+ Settings.System.SHOW_STATUSBAR_IME_SWITCHER),
+ false, new ContentObserver(mHandler) {
+ public void onChange(boolean selfChange) {
+ updateFromSettingsLocked();
+ }
+ });
}
@Override public void onChange(boolean selfChange) {
@@ -853,8 +860,6 @@ public void onReceive(Context context, Intent intent) {
mStatusBar = statusBar;
statusBar.setIconVisibility("ime", false);
updateImeWindowStatusLocked();
- mShowOngoingImeSwitcherForPhones = mRes.getBoolean(
- com.android.internal.R.bool.show_ongoing_ime_switcher);
if (mShowOngoingImeSwitcherForPhones) {
mWindowManagerService.setOnHardKeyboardStatusChangeListener(
mHardKeyboardListener);
@@ -1606,6 +1611,9 @@ void updateFromSettingsLocked() {
mCurMethodId = null;
unbindCurrentMethodLocked(true, false);
}
+
+ mShowOngoingImeSwitcherForPhones = Settings.System.getBoolean(mContext.getContentResolver(),
+ Settings.System.SHOW_STATUSBAR_IME_SWITCHER, true);
}
/* package */ void setInputMethodLocked(String id, int subtypeId) {

0 comments on commit 40390fb

Please sign in to comment.
Something went wrong with that request. Please try again.