diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
index e5ce987..f956a4e 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
@@ -31,6 +31,7 @@
 import android.preference.PreferenceCategory;
 import android.preference.PreferenceScreen;
 import android.text.TextUtils;
+import android.util.Log;
 import android.view.inputmethod.InputMethodInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.view.inputmethod.InputMethodSubtype;
@@ -40,6 +41,7 @@
 import java.util.List;
 
 public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment {
+    private static final String TAG =InputMethodAndSubtypeEnabler.class.getSimpleName();
     private AlertDialog mDialog = null;
     private boolean mHaveHardKeyboard;
     final private HashMap<String, List<Preference>> mInputMethodAndSubtypePrefsMap =
@@ -223,37 +225,55 @@
             if (!TextUtils.isEmpty(mInputMethodId) && !mInputMethodId.equals(imiId)) {
                 continue;
             }
-            PreferenceCategory keyboardSettingsCategory = new PreferenceCategory(context);
+            final PreferenceCategory keyboardSettingsCategory = new PreferenceCategory(context);
             root.addPreference(keyboardSettingsCategory);
-            PackageManager pm = getPackageManager();
-            CharSequence label = imi.loadLabel(pm);
+            final PackageManager pm = getPackageManager();
+            final CharSequence label = imi.loadLabel(pm);
 
             keyboardSettingsCategory.setTitle(label);
             keyboardSettingsCategory.setKey(imiId);
             // TODO: Use toggle Preference if images are ready.
-            CheckBoxPreference autoCB = new CheckBoxPreference(context);
-            autoCB.setTitle(R.string.use_system_language_to_select_input_method_subtypes);
+            final CheckBoxPreference autoCB = new CheckBoxPreference(context);
             mSubtypeAutoSelectionCBMap.put(imiId, autoCB);
             keyboardSettingsCategory.addPreference(autoCB);
 
-            PreferenceCategory activeInputMethodsCategory = new PreferenceCategory(context);
+            final PreferenceCategory activeInputMethodsCategory = new PreferenceCategory(context);
             activeInputMethodsCategory.setTitle(R.string.active_input_method_subtypes);
             root.addPreference(activeInputMethodsCategory);
 
-            ArrayList<Preference> subtypePreferences = new ArrayList<Preference>();
+            boolean isAutoSubtype = false;
+            CharSequence autoSubtypeLabel = null;
+            final ArrayList<Preference> subtypePreferences = new ArrayList<Preference>();
             if (subtypeCount > 0) {
                 for (int j = 0; j < subtypeCount; ++j) {
                     final InputMethodSubtype subtype = imi.getSubtypeAt(j);
                     final CharSequence subtypeLabel = subtype.getDisplayName(context,
                             imi.getPackageName(), imi.getServiceInfo().applicationInfo);
-                    final CheckBoxPreference chkbxPref = new CheckBoxPreference(context);
-                    chkbxPref.setKey(imiId + subtype.hashCode());
-                    chkbxPref.setTitle(subtypeLabel);
-                    activeInputMethodsCategory.addPreference(chkbxPref);
-                    subtypePreferences.add(chkbxPref);
+                    if (subtype.overridesImplicitlyEnabledSubtype()) {
+                        if (!isAutoSubtype) {
+                            isAutoSubtype = true;
+                            autoSubtypeLabel = subtypeLabel;
+                        }
+                    } else {
+                        final CheckBoxPreference chkbxPref = new CheckBoxPreference(context);
+                        chkbxPref.setKey(imiId + subtype.hashCode());
+                        chkbxPref.setTitle(subtypeLabel);
+                        activeInputMethodsCategory.addPreference(chkbxPref);
+                        subtypePreferences.add(chkbxPref);
+                    }
                 }
                 mInputMethodAndSubtypePrefsMap.put(imiId, subtypePreferences);
             }
+            if (isAutoSubtype) {
+                if (TextUtils.isEmpty(autoSubtypeLabel)) {
+                    Log.w(TAG, "Title for auto subtype is empty.");
+                    autoCB.setTitle("---");
+                } else {
+                    autoCB.setTitle(autoSubtypeLabel);
+                }
+            } else {
+                autoCB.setTitle(R.string.use_system_language_to_select_input_method_subtypes);
+            }
         }
         return root;
     }
diff --git a/src/com/android/settings/inputmethod/SingleSpellCheckerPreference.java b/src/com/android/settings/inputmethod/SingleSpellCheckerPreference.java
index 8a0b620..753d1f0 100644
--- a/src/com/android/settings/inputmethod/SingleSpellCheckerPreference.java
+++ b/src/com/android/settings/inputmethod/SingleSpellCheckerPreference.java
@@ -23,7 +23,6 @@
 import android.content.Intent;
 import android.content.res.Resources;
 import android.preference.Preference;
-import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
