Merge "Support "nm" (no mic) privateImeOptions" into honeycomb
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index 504e007..7f00cdb 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -51,7 +51,7 @@
     <dimen name="candidate_strip_fading_edge_length">63dip</dimen>
     <dimen name="candidate_strip_padding">0dip</dimen>
     <dimen name="candidate_min_width">0.3in</dimen>
-    <dimen name="candidate_padding">0dip</dimen>
+    <dimen name="candidate_padding">6dip</dimen>
     <dimen name="candidate_text_size">18dip</dimen>
     <dimen name="spacebar_vertical_correction">4dip</dimen>
     <!-- If the screen height in landscape is larger than the below value, then the keyboard
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index 258f7ce..6d05012 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -212,39 +212,72 @@
     <!-- Description for keyboard theme switcher -->
     <string name="keyboard_layout">Keyboard Theme</string>
 
+    <!-- Description for Czech keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_cs_keyboard">Czech Keyboard</string>
+    <!-- Description for Danish keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_da_keyboard">Danish Keyboard</string>
+    <!-- Description for German keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_de_keyboard">German Keyboard</string>
+    <!-- Description for English (United Kingdom) keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_en_GB_keyboard">English (UK) Keyboard</string>
+    <!-- Description for English (United States) keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_en_US_keyboard">English (US) Keyboard</string>
+    <!-- Description for Spanish keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_es_keyboard">Spanish Keyboard</string>
+    <!-- Description for Spanish (United States) keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_es_US_keyboard">Spanish (US) Keyboard</string>
+    <!-- Description for French keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_fr_keyboard">French Keyboard</string>
+    <!-- Description for French (Canada) keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_fr_CA_keyboard">French (Canada) Keyboard</string>
+    <!-- Description for French (Switzerland) keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_fr_CH_keyboard">French (Switzerland) Keyboard</string>
+    <!-- Description for Italian keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_it_keyboard">Italian Keyboard</string>
+    <!-- Description for Norwegian keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_nb_keyboard">Norwegian Keyboard</string>
+    <!-- Description for Dutch keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_nl_keyboard">Dutch Keyboard</string>
+    <!-- Description for Russian keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_ru_keyboard">Russian Keyboard</string>
+    <!-- Description for Serbian keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_sr_keyboard">Serbian Keyboard</string>
+    <!-- Description for Swedish keyboard subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_sv_keyboard">Swedish Keyboard</string>
 
+    <!-- Description for Czech voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_cs_voice">Czech Voice</string>
+    <!-- Description for German voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_de_voice">German Voice</string>
+    <!-- Description for English (Australia) voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_en_AU_voice">English (Australia) Voice</string>
+    <!-- Description for English (United Kingdom) voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_en_GB_voice">English (UK) Voice</string>
+    <!-- Description for English (India) voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_en_IN_voice">English (India) Voice</string>
+    <!-- Description for English (New Zealand) voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_en_NZ_voice">English (New Zealand) Voice</string>
+    <!-- Description for English (United States) voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_en_US_voice">English (US) Voice</string>
+    <!-- Description for Spanish voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_es_voice">Spanish Voice</string>
+    <!-- Description for French voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_fr_voice">French Voice</string>
+    <!-- Description for Japanese voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_ja_voice">Japanese Voice</string>
+    <!-- Description for Korean voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_ko_voice">Korean Voice</string>
+    <!-- Description for Polish voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_pl_voice">Polish Voice</string>
+    <!-- Description for Portuguese voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_pt_voice">Portuguese Voice</string>
+    <!-- Description for Russian voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_ru_voice">Russian Voice</string>
+    <!-- Description for Turkish voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_tr_voice">Turkish Voice</string>
+    <!-- Description for Chinese (China, Simplified) voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_zh_CN_voice">Chinese (China, Simplified) Voice</string>
+    <!-- Description for Chinese (Taiwan, Traditional) voice input subtype [CHAR LIMIT=35] -->
     <string name="subtype_mode_zh_TW_voice">Chinese (Taiwan, Traditional) Voice</string>
 
     <!-- Title of an option for usability study mode -->
diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml
index 3b20298..9c780cb 100644
--- a/java/res/xml/prefs.xml
+++ b/java/res/xml/prefs.xml
@@ -70,15 +70,10 @@
             android:defaultValue="@string/voice_mode_main"
             />
 
-    <!-- TODO: Filter subtypes by IME in SubtypeEnabler -->
-    <!-- TODO: Maybe use this only for phone? -->
     <PreferenceScreen
             android:key="subtype_settings"
             android:title="@string/language_selection_title"
-            android:summary="@string/language_selection_summary">
-        <intent
-                android:action="android.settings.INPUT_METHOD_AND_SUBTYPE_ENABLER"/>
-    </PreferenceScreen>
+            android:summary="@string/language_selection_summary" />
 
     <PreferenceCategory
             android:title="@string/prediction_category"
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java
index 3f604a3..8efeeda 100644
--- a/java/src/com/android/inputmethod/latin/Settings.java
+++ b/java/src/com/android/inputmethod/latin/Settings.java
@@ -23,13 +23,17 @@
 import android.app.Dialog;
 import android.app.backup.BackupManager;
 import android.content.DialogInterface;
+import android.content.Intent;
 import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.os.Vibrator;
 import android.preference.CheckBoxPreference;
 import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.Preference.OnPreferenceClickListener;
 import android.preference.PreferenceActivity;
 import android.preference.PreferenceGroup;
+import android.preference.PreferenceScreen;
 import android.speech.SpeechRecognizer;
 import android.text.AutoText;
 import android.text.TextUtils;
@@ -41,7 +45,7 @@
 
 public class Settings extends PreferenceActivity
         implements SharedPreferences.OnSharedPreferenceChangeListener,
-        DialogInterface.OnDismissListener {
+        DialogInterface.OnDismissListener, OnPreferenceClickListener {
     private static final String TAG = "Settings";
 
     public static final String PREF_VIBRATE_ON = "vibrate_on";
@@ -64,6 +68,7 @@
     // Dialog ids
     private static final int VOICE_INPUT_CONFIRM_DIALOG = 0;
 
+    private PreferenceScreen mInputLanguageSelection;
     private CheckBoxPreference mQuickFixes;
     private ListPreference mVoicePreference;
     private ListPreference mSettingsKeyPreference;
@@ -84,10 +89,13 @@
         final String currentSetting = mAutoCorrectionThreshold.getValue();
         mBigramSuggestion.setEnabled(!currentSetting.equals(autoCorrectionOff));
     }
+
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         addPreferencesFromResource(R.xml.prefs);
+        mInputLanguageSelection = (PreferenceScreen) findPreference(PREF_SUBTYPES);
+        mInputLanguageSelection.setOnPreferenceClickListener(this);
         mQuickFixes = (CheckBoxPreference) findPreference(PREF_QUICK_FIXES);
         mVoicePreference = (ListPreference) findPreference(PREF_VOICE_SETTINGS_KEY);
         mSettingsKeyPreference = (ListPreference) findPreference(PREF_SETTINGS_KEY);
@@ -169,6 +177,22 @@
         updateSettingsKeySummary();
     }
 
+    @Override
+    public boolean onPreferenceClick(Preference pref) {
+        if (pref == mInputLanguageSelection) {
+            final String action;
+            if (android.os.Build.VERSION.SDK_INT
+                    >= /* android.os.Build.VERSION_CODES.HONEYCOMB */ 10) {
+                action = "android.settings.INPUT_METHOD_AND_SUBTYPE_ENABLER";
+            } else {
+                action = "com.android.inputmethod.latin.INPUT_LANGUAGE_SELECTION";
+            }
+            startActivity(new Intent(action));
+            return true;
+        }
+        return false;
+    }
+
     private void updateSettingsKeySummary() {
         mSettingsKeyPreference.setSummary(
                 getResources().getStringArray(R.array.settings_key_modes)