Fix 2242164 Soft keyboard keeps getting enabled even if I disable it
On keyboardful devices, it is possible to disable the system soft input method. Something changed in eclair that caused the ime to be re-enabled on every package manager update (packages added/deleted). Now keep track of disabled system imes in the settings db and search in that list before enabling a system IME on package changes. Every time the user goes to settings to enable/disable imes, the list is re-created. Any new system IMEs that may be added via an OTA will get enabled if they have a different package name.
This commit is contained in:
@@ -180,6 +180,7 @@ public class LanguageSettings extends PreferenceActivity {
|
|||||||
super.onPause();
|
super.onPause();
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder(256);
|
StringBuilder builder = new StringBuilder(256);
|
||||||
|
StringBuilder disabledSysImes = new StringBuilder(256);
|
||||||
|
|
||||||
int firstEnabled = -1;
|
int firstEnabled = -1;
|
||||||
int N = mInputMethodProperties.size();
|
int N = mInputMethodProperties.size();
|
||||||
@@ -199,6 +200,12 @@ public class LanguageSettings extends PreferenceActivity {
|
|||||||
} else if (hasIt) {
|
} else if (hasIt) {
|
||||||
mLastInputMethodId = mLastTickedInputMethodId;
|
mLastInputMethodId = mLastTickedInputMethodId;
|
||||||
}
|
}
|
||||||
|
// If it's a disabled system ime, add it to the disabled list so that it
|
||||||
|
// doesn't get enabled automatically on any changes to the package list
|
||||||
|
if (pref != null && !pref.isChecked() && systemIme && mHaveHardKeyboard) {
|
||||||
|
if (disabledSysImes.length() > 0) disabledSysImes.append(":");
|
||||||
|
disabledSysImes.append(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the last input method is unset, set it as the first enabled one.
|
// If the last input method is unset, set it as the first enabled one.
|
||||||
@@ -212,6 +219,8 @@ public class LanguageSettings extends PreferenceActivity {
|
|||||||
|
|
||||||
Settings.Secure.putString(getContentResolver(),
|
Settings.Secure.putString(getContentResolver(),
|
||||||
Settings.Secure.ENABLED_INPUT_METHODS, builder.toString());
|
Settings.Secure.ENABLED_INPUT_METHODS, builder.toString());
|
||||||
|
Settings.Secure.putString(getContentResolver(),
|
||||||
|
Settings.Secure.DISABLED_SYSTEM_INPUT_METHODS, disabledSysImes.toString());
|
||||||
Settings.Secure.putString(getContentResolver(),
|
Settings.Secure.putString(getContentResolver(),
|
||||||
Settings.Secure.DEFAULT_INPUT_METHOD,
|
Settings.Secure.DEFAULT_INPUT_METHOD,
|
||||||
mLastInputMethodId != null ? mLastInputMethodId : "");
|
mLastInputMethodId != null ? mLastInputMethodId : "");
|
||||||
|
Reference in New Issue
Block a user