summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/InputMethodManagerService.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-03-24 21:39:27 -0700
committerAmith Yamasani <yamasani@google.com>2010-03-24 21:39:27 -0700
commite861ec11c458b4f76eb80da518dfee6a400071bf (patch)
tree7ecb061abf6bb6cf6e55093702bef5e9660a9a6c /services/java/com/android/server/InputMethodManagerService.java
parent2c9607137cd496cd0373f17a8bd4454715057f67 (diff)
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.
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 1179500b01dd..0c205ca83566 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -46,6 +46,7 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
+import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.database.ContentObserver;
@@ -60,6 +61,7 @@ import android.os.ResultReceiver;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.provider.Settings;
+import android.provider.Settings.Secure;
import android.text.TextUtils;
import android.util.EventLog;
import android.util.Slog;
@@ -1418,6 +1420,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
map.clear();
PackageManager pm = mContext.getPackageManager();
+ final Configuration config = mContext.getResources().getConfiguration();
+ final boolean haveHardKeyboard = config.keyboard == Configuration.KEYBOARD_QWERTY;
+ String disabledSysImes = Settings.Secure.getString(mContext.getContentResolver(),
+ Secure.DISABLED_SYSTEM_INPUT_METHODS);
+ if (disabledSysImes == null) disabledSysImes = "";
List<ResolveInfo> services = pm.queryIntentServices(
new Intent(InputMethod.SERVICE_INTERFACE),
@@ -1440,11 +1447,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
try {
InputMethodInfo p = new InputMethodInfo(mContext, ri);
list.add(p);
- map.put(p.getId(), p);
+ final String id = p.getId();
+ map.put(id, p);
- // System IMEs are enabled by default
- if (isSystemIme(p)) {
- setInputMethodEnabledLocked(p.getId(), true);
+ // System IMEs are enabled by default, unless there's a hard keyboard
+ // and the system IME was explicitly disabled
+ if (isSystemIme(p) && (!haveHardKeyboard || disabledSysImes.indexOf(id) < 0)) {
+ setInputMethodEnabledLocked(id, true);
}
if (DEBUG) {