Add language agnostic QWERTY subtype

Bug: 6010147
Change-Id: I705e38ac889172ae8b7c2a68e5c688f2ffc28320
diff --git a/java/res/values-zz/donottranslate-more-keys.xml b/java/res/values-zz/donottranslate-more-keys.xml
new file mode 100644
index 0000000..eb984a4
--- /dev/null
+++ b/java/res/values-zz/donottranslate-more-keys.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <!-- U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+         U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+         U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+         U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
+         U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+         U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
+         U+00E6: "æ" LATIN SMALL LETTER AE
+         U+0101: "ā" LATIN SMALL LETTER A WITH MACRON
+         U+0103: "ă" LATIN SMALL LETTER A WITH BREVE
+         U+0105: "ą" LATIN SMALL LETTER A WITH OGONEK
+         U+00AA: "ª" FEMININE ORDINAL INDICATOR -->
+    <string name="more_keys_for_a">&#x00E0;,&#x00E1;,&#x00E2;,&#x00E3;,&#x00E4;,&#x00E5;,&#x00E6;,&#x00E3;,&#x00E5;,&#x0101;,&#x0103;,&#x0105;,&#x00AA;</string>
+    <!-- U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+         U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+         U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
+         U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
+         U+0113: "ē" LATIN SMALL LETTER E WITH MACRON
+         U+0115: "ĕ" LATIN SMALL LETTER E WITH BREVE
+         U+0117: "ė" LATIN SMALL LETTER E WITH DOT ABOVE
+         U+0119: "ę" LATIN SMALL LETTER E WITH OGONEK
+         U+011B: "ě" LATIN SMALL LETTER E WITH CARON -->
+    <string name="more_keys_for_e">&#x00E8;,&#x00E9;,&#x00EA;,&#x00EB;,&#x0113;,&#x0115;,&#x0117;,&#x0119;,&#x011B;</string>
+    <!-- U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE
+         U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+         U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+         U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+         U+0129: "ĩ" LATIN SMALL LETTER I WITH TILDE
+         U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+         U+012D: "ĭ" LATIN SMALL LETTER I WITH BREVE
+         U+012F: "į" LATIN SMALL LETTER I WITH OGONEK
+         U+0131: "ı" LATIN SMALL LETTER DOTLESS I
+         U+0133: "ij" LATIN SMALL LIGATURE IJ -->
+    <string name="more_keys_for_i">&#x00EC;,&#x00ED;,&#x00EE;,&#x00EF;,&#x0129;,&#x012B;,&#x012D;,&#x012F;,&#x0131;,&#x0133;</string>
+    <!-- U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+         U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+         U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+         U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE
+         U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+         U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+         U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
+         U+014F: "ŏ" LATIN SMALL LETTER O WITH BREVE
+         U+0151: "ő" LATIN SMALL LETTER O WITH DOUBLE ACUTE
+         U+0153: "œ" LATIN SMALL LIGATURE OE
+         U+00BA: "º" MASCULINE ORDINAL INDICATOR -->
+    <string name="more_keys_for_o">&#x00F2;,&#x00F3;,&#x00F4;,&#x00F5;,&#x00F6;,&#x00F8;,&#x014D;,&#x014F;,&#x0151;,&#x0153;,&#x00BA;</string>
+    <!-- U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+         U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+         U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+         U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+         U+0169: "ũ" LATIN SMALL LETTER U WITH TILDE
+         U+016B: "ū" LATIN SMALL LETTER U WITH MACRON
+         U+016D: "ŭ" LATIN SMALL LETTER U WITH BREVE
+         U+016F: "ů" LATIN SMALL LETTER U WITH RING ABOVE
+         U+0171: "ű" LATIN SMALL LETTER U WITH DOUBLE ACUTE
+         U+0173: "ų" LATIN SMALL LETTER U WITH OGONEK -->
+    <string name="more_keys_for_u">&#x00F9;,&#x00FA;,&#x00FB;,&#x00FC;,&#x0169;,&#x016B;,&#x016D;,&#x016F;,&#x0171;,&#x0173;</string>
+    <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S
+         U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE
+         U+015D: "ŝ" LATIN SMALL LETTER S WITH CIRCUMFLEX
+         U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA
+         U+0161: "š" LATIN SMALL LETTER S WITH CARON
+         U+017F: "ſ" LATIN SMALL LETTER LONG S -->
+    <string name="more_keys_for_s">&#x00DF;,&#x015B;,&#x015D;,&#x015F;,&#x0161;,&#x017F;</string>
+    <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE
+         U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE
+         U+0146: "ņ" LATIN SMALL LETTER N WITH CEDILLA
+         U+0148: "ň" LATIN SMALL LETTER N WITH CARON
+         U+0149: "ʼn" LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
+         U+014B: "ŋ" LATIN SMALL LETTER ENG -->
+    <string name="more_keys_for_n">&#x00F1;,&#x0144;,&#x0146;,&#x0148;,&#x0149;,&#x014B;</string>
+    <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA
+         U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE
+         U+0109: "ĉ" LATIN SMALL LETTER C WITH CIRCUMFLEX
+         U+010B: "ċ" LATIN SMALL LETTER C WITH DOT ABOVE
+         U+010D: "č" LATIN SMALL LETTER C WITH CARON -->
+    <string name="more_keys_for_c">&#x00E7;,&#x0107;,&#x0109;,&#x010B;,&#x010D;</string>
+    <!-- U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE
+         U+0177: "ŷ" LATIN SMALL LETTER Y WITH CIRCUMFLEX
+         U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS
+         U+0133: "ij" LATIN SMALL LIGATURE IJ -->
+    <string name="more_keys_for_y">&#x00FD;,&#x0177;,&#x00FF;,&#x0133;</string>
+    <!-- U+010F: "ď" LATIN SMALL LETTER D WITH CARON
+         U+0111: "đ" LATIN SMALL LETTER D WITH STROKE
+         U+00F0: "ð" LATIN SMALL LETTER ETH -->
+    <string name="more_keys_for_d">&#x010F;,&#x0111;,&#x00F0;</string>
+    <!-- U+0155: "ŕ" LATIN SMALL LETTER R WITH ACUTE
+         U+0157: "ŗ" LATIN SMALL LETTER R WITH CEDILLA
+         U+0159: "ř" LATIN SMALL LETTER R WITH CARON -->
+    <string name="more_keys_for_r">&#x0155;,&#x0157;,&#x0159;</string>
+    <!-- U+00FE: "þ" LATIN SMALL LETTER THORN
+         U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA
+         U+0165: "ť" LATIN SMALL LETTER T WITH CARON
+         U+0167: "ŧ" LATIN SMALL LETTER T WITH STROKE -->
+    <string name="more_keys_for_t">&#x00FE;,&#x0163;,&#x0165;,&#x0167;</string>
+    <!-- U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE
+         U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE
+         U+017E: "ž" LATIN SMALL LETTER Z WITH CARON -->
+    <string name="more_keys_for_z">&#x017A;,&#x017C;,&#x017E;</string>
+    <!-- U+0137: "ķ" LATIN SMALL LETTER K WITH CEDILLA
+         U+0138: "ĸ" LATIN SMALL LETTER KRA -->
+    <string name="more_keys_for_k">&#x0137;,&#x0138;</string>
+    <!-- U+013A: "ĺ" LATIN SMALL LETTER L WITH ACUTE
+         U+013C: "ļ" LATIN SMALL LETTER L WITH CEDILLA
+         U+013E: "ľ" LATIN SMALL LETTER L WITH CARON
+         U+0140: "ŀ" LATIN SMALL LETTER L WITH MIDDLE DOT
+         U+0142: "ł" LATIN SMALL LETTER L WITH STROKE -->
+    <string name="more_keys_for_l">&#x013A;,&#x013C;,&#x013E;,&#x0140;,&#x0142;</string>
+    <!-- U+011D: "ĝ" LATIN SMALL LETTER G WITH CIRCUMFLEX
+         U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE
+         U+0121: "ġ" LATIN SMALL LETTER G WITH DOT ABOVE
+         U+0123: "ģ" LATIN SMALL LETTER G WITH CEDILLA -->
+    <string name="more_keys_for_g">&#x011D;,&#x011F;,&#x0121;,&#x0123;</string>
+    <!-- U+0125: "ĥ" LATIN SMALL LETTER H WITH CIRCUMFLEX -->
+    <string name="more_keys_for_h">&#x0125;</string>
+    <!-- U+0135: "ĵ" LATIN SMALL LETTER J WITH CIRCUMFLEX -->
+    <string name="more_keys_for_j">&#x0135;</string>
+    <!-- U+0175: "ŵ" LATIN SMALL LETTER W WITH CIRCUMFLEX -->
+    <string name="more_keys_for_w">&#x0175;</string>
+</resources>
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 86f2abe..b3f30c6 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -403,6 +403,11 @@
         <attr name="parentStyle" format="string" />
     </declare-styleable>
 
+    <declare-styleable name="KeyboardSet">
+        <!-- Disable shortcut key. Shortcut key is enabled by default. -->
+        <attr name="disableShortcutKey" format="boolean" />
+    </declare-styleable>
+
     <declare-styleable name="KeyboardSet_Element">
         <!-- This should be aligned with KeyboardId.ELEMENT_* -->
         <attr name="elementName" format="enum">
diff --git a/java/res/values/donottranslate-more-keys.xml b/java/res/values/donottranslate-more-keys.xml
index 8fbb2ef..9b27805 100644
--- a/java/res/values/donottranslate-more-keys.xml
+++ b/java/res/values/donottranslate-more-keys.xml
@@ -35,6 +35,9 @@
     <string name="more_keys_for_l"></string>
     <string name="more_keys_for_g"></string>
     <string name="more_keys_for_v"></string>
+    <string name="more_keys_for_h"></string>
+    <string name="more_keys_for_j"></string>
+    <string name="more_keys_for_w"></string>
     <string name="keylabel_for_nordic_row1_11"></string>
     <string name="keylabel_for_nordic_row2_10"></string>
     <string name="keylabel_for_nordic_row2_11"></string>
diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml
index 74c6846..68a8cab 100644
--- a/java/res/values/donottranslate.xml
+++ b/java/res/values/donottranslate.xml
@@ -156,18 +156,22 @@
     <string-array name="subtype_locale_exception_keys">
         <item>en_US</item>
         <item>en_GB</item>
-        <item>de_ZZ</item>
+        <item>de_QY</item>
+        <item>zz_QY</item>
     </string-array>
     <string-array name="subtype_locale_exception_values">
         <item>English (US)</item>
         <item>English (UK)</item>
-        <item>Deutsch (QWERTY)</item>
+        <item>@string/subtype_generic_qwerty</item>
+        <item>@string/subtype_qwerty</item>
     </string-array>
 
     <!-- Generic subtype label -->
     <string name="subtype_generic">%s</string>
     <!-- Description for generic QWERTY keyboard subtype -->
     <string name="subtype_generic_qwerty">%s (QWERTY)</string>
+    <!-- Description for language agnostic QWERTY keyboard subtype -->
+    <string name="subtype_qwerty">QWERTY</string>
 
     <!-- dictionary pack package name /settings activity (for shared prefs and settings) -->
     <string name="dictionary_pack_package_name">com.google.android.inputmethod.latin.dictionarypack</string>
diff --git a/java/res/xml-de-rZZ/keyboard_set.xml b/java/res/xml-de-rQY/keyboard_set.xml
similarity index 100%
rename from java/res/xml-de-rZZ/keyboard_set.xml
rename to java/res/xml-de-rQY/keyboard_set.xml
diff --git a/java/res/xml-zz-rQY/keyboard_set.xml b/java/res/xml-zz-rQY/keyboard_set.xml
new file mode 100644
index 0000000..6fa9701
--- /dev/null
+++ b/java/res/xml-zz-rQY/keyboard_set.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<KeyboardSet
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+    latin:disableShortcutKey="true" >
+    <Element
+        latin:elementName="alphabet"
+        latin:elementKeyboard="@xml/kbd_qwerty"
+        latin:enableProximityCharsCorrection="true" />
+    <Element
+        latin:elementName="symbols"
+        latin:elementKeyboard="@xml/kbd_symbols" />
+    <Element
+        latin:elementName="symbolsShifted"
+        latin:elementKeyboard="@xml/kbd_symbols_shift" />
+    <Element
+        latin:elementName="phone"
+        latin:elementKeyboard="@xml/kbd_phone" />
+    <Element
+        latin:elementName="phoneSymbols"
+        latin:elementKeyboard="@xml/kbd_phone_symbols" />
+    <Element
+        latin:elementName="number"
+        latin:elementKeyboard="@xml/kbd_number" />
+</KeyboardSet>
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index d6ded66..7a21a85 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -27,7 +27,7 @@
     cs: Czech/qwertz
     da: Danish/nordic
     de: German/qwertz
-    de_ZZ: German (QWERTY)/qwerty
+    de_QY: German (QWERTY)/qwerty
     el: Greek/greek
     en_US: English United States/qwerty
     en_GB: English Great Britain/qwerty
@@ -63,6 +63,7 @@
     tr: Turkish/qwerty
     uk: Ukrainian/east_slavic
     vi: Vietnamese/qwerty
+    zz_QY: QWERTY/qwerty
     -->
 <!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. -->
 <!-- If IME doesn't have an applicable subtype, the first subtype will be used as a default
@@ -74,7 +75,7 @@
             android:label="@string/subtype_en_US"
             android:imeSubtypeLocale="en_US"
             android:imeSubtypeMode="keyboard"
-            android:imeSubtypeExtraValue="TrySuppressingImeSwitcher,AsciiCapable,EnabledWhenDefaultIsNotAsciiCapable"
+            android:imeSubtypeExtraValue="TrySuppressingImeSwitcher,AsciiCapable"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_en_GB"
@@ -119,7 +120,7 @@
             android:label="@string/subtype_generic_qwerty"
             android:imeSubtypeLocale="de"
             android:imeSubtypeMode="keyboard"
-            android:imeSubtypeExtraValue="AsciiCapable,KeyboardLocale=de_ZZ"
+            android:imeSubtypeExtraValue="AsciiCapable,KeyboardLocale=de_QY"
     />
     <subtype android:icon="@drawable/ic_subtype_keyboard"
             android:label="@string/subtype_generic"
@@ -310,4 +311,10 @@
             android:imeSubtypeMode="keyboard"
             android:imeSubtypeExtraValue="AsciiCapable"
     />
+    <subtype android:icon="@drawable/ic_subtype_keyboard"
+            android:label="@string/subtype_qwerty"
+            android:imeSubtypeLocale="zz_QY"
+            android:imeSubtypeMode="keyboard"
+            android:imeSubtypeExtraValue="AsciiCapable,EnabledWhenDefaultIsNotAsciiCapable"
+    />
 </input-method>
diff --git a/java/res/xml/rowkeys_azerty2.xml b/java/res/xml/rowkeys_azerty2.xml
index 11bcd67..ff0b062 100644
--- a/java/res/xml/rowkeys_azerty2.xml
+++ b/java/res/xml/rowkeys_azerty2.xml
@@ -35,9 +35,11 @@
         latin:keyLabel="g"
         latin:moreKeys="@string/more_keys_for_g" />
     <Key
-        latin:keyLabel="h" />
+        latin:keyLabel="h"
+        latin:moreKeys="@string/more_keys_for_h" />
     <Key
-        latin:keyLabel="j" />
+        latin:keyLabel="j"
+        latin:moreKeys="@string/more_keys_for_j" />
     <Key
         latin:keyLabel="k"
         latin:moreKeys="@string/more_keys_for_k" />
diff --git a/java/res/xml/rowkeys_azerty3.xml b/java/res/xml/rowkeys_azerty3.xml
index 1a0eacc..b81c3c5 100644
--- a/java/res/xml/rowkeys_azerty3.xml
+++ b/java/res/xml/rowkeys_azerty3.xml
@@ -22,7 +22,8 @@
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
     <Key
-        latin:keyLabel="w" />
+        latin:keyLabel="w"
+        latin:moreKeys="@string/more_keys_for_w" />
     <Key
         latin:keyLabel="x" />
     <Key
diff --git a/java/res/xml/rowkeys_qwerty1.xml b/java/res/xml/rowkeys_qwerty1.xml
index bd5e9a2..19067a7 100644
--- a/java/res/xml/rowkeys_qwerty1.xml
+++ b/java/res/xml/rowkeys_qwerty1.xml
@@ -28,7 +28,8 @@
     <Key
         latin:keyLabel="w"
         latin:keyHintLabel="2"
-        latin:additionalMoreKeys="2" />
+        latin:additionalMoreKeys="2"
+        latin:moreKeys="@string/more_keys_for_w" />
     <Key
         latin:keyLabel="e"
         latin:keyHintLabel="3"
diff --git a/java/res/xml/rowkeys_qwerty2.xml b/java/res/xml/rowkeys_qwerty2.xml
index 4c983df..2fa8214 100644
--- a/java/res/xml/rowkeys_qwerty2.xml
+++ b/java/res/xml/rowkeys_qwerty2.xml
@@ -36,9 +36,11 @@
         latin:keyLabel="g"
         latin:moreKeys="@string/more_keys_for_g" />
     <Key
-        latin:keyLabel="h" />
+        latin:keyLabel="h"
+        latin:moreKeys="@string/more_keys_for_h" />
     <Key
-        latin:keyLabel="j" />
+        latin:keyLabel="j"
+        latin:moreKeys="@string/more_keys_for_j" />
     <Key
         latin:keyLabel="k"
         latin:moreKeys="@string/more_keys_for_k" />
diff --git a/java/res/xml/rowkeys_qwertz1.xml b/java/res/xml/rowkeys_qwertz1.xml
index 27b8a76..3e11a7a 100644
--- a/java/res/xml/rowkeys_qwertz1.xml
+++ b/java/res/xml/rowkeys_qwertz1.xml
@@ -28,7 +28,8 @@
     <Key
         latin:keyLabel="w"
         latin:keyHintLabel="2"
-        latin:additionalMoreKeys="2" />
+        latin:additionalMoreKeys="2"
+        latin:moreKeys="@string/more_keys_for_w" />
     <Key
         latin:keyLabel="e"
         latin:keyHintLabel="3"
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java
index c17fe86..f0c773f 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSet.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSet.java
@@ -98,6 +98,7 @@
         int mMode;
         EditorInfo mEditorInfo;
         boolean mTouchPositionCorrectionEnabled;
+        boolean mDisableShortcutKey;
         boolean mVoiceKeyEnabled;
         boolean mVoiceKeyOnMain;
         boolean mNoSettingsKey;
@@ -200,11 +201,11 @@
         final Params params = mParams;
         final boolean isSymbols = (keyboardSetElementId == KeyboardId.ELEMENT_SYMBOLS
                 || keyboardSetElementId == KeyboardId.ELEMENT_SYMBOLS_SHIFTED);
-        final boolean hasShortcutKey = params.mVoiceKeyEnabled
-                && (isSymbols != params.mVoiceKeyOnMain);
+        final boolean voiceKeyEnabled = params.mVoiceKeyEnabled && !params.mDisableShortcutKey;
+        final boolean hasShortcutKey = voiceKeyEnabled && (isSymbols != params.mVoiceKeyOnMain);
         return new KeyboardId(keyboardSetElementId, params.mLocale, params.mOrientation,
                 params.mWidth, params.mMode, params.mEditorInfo, params.mNoSettingsKey,
-                params.mVoiceKeyEnabled, hasShortcutKey, params.mLanguageSwitchKeyEnabled);
+                voiceKeyEnabled, hasShortcutKey, params.mLanguageSwitchKeyEnabled);
     }
 
     public static class Builder {
@@ -293,6 +294,11 @@
                     if (event == XmlPullParser.START_TAG) {
                         final String tag = parser.getName();
                         if (TAG_KEYBOARD_SET.equals(tag)) {
+                            final TypedArray a = mResources.obtainAttributes(
+                                    Xml.asAttributeSet(parser), R.styleable.KeyboardSet);
+                            mParams.mDisableShortcutKey = a.getBoolean(
+                                    R.styleable.KeyboardSet_disableShortcutKey, false);
+                            a.recycle();
                             parseKeyboardSetContent(parser);
                         } else {
                             throw new XmlParseUtils.IllegalStartTag(parser, TAG_KEYBOARD_SET);
diff --git a/java/src/com/android/inputmethod/latin/SubtypeLocale.java b/java/src/com/android/inputmethod/latin/SubtypeLocale.java
index 917521c..66c13bd 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeLocale.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeLocale.java
@@ -36,10 +36,16 @@
     }
 
     public static String getFullDisplayName(Locale locale) {
-        String localeCode = locale.toString();
+        final String localeCode = locale.toString();
         for (int index = 0; index < sExceptionKeys.length; index++) {
-            if (sExceptionKeys[index].equals(localeCode))
-                return sExceptionValues[index];
+            if (sExceptionKeys[index].equals(localeCode)) {
+                final String value = sExceptionValues[index];
+                if (value.indexOf("%s") >= 0) {
+                    final String languageName = locale.getDisplayLanguage(locale);
+                    return String.format(value, languageName);
+                }
+                return value;
+            }
         }
         return locale.getDisplayName(locale);
     }
diff --git a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java
index 7925d1a..089fdc5 100644
--- a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java
+++ b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java
@@ -62,6 +62,10 @@
         int failedCount = 0;
         for (final InputMethodSubtype subtype : mKeyboardSubtypes) {
             final Locale locale = LocaleUtils.constructLocaleFromString(subtype.getLocale());
+            if (locale.getLanguage().equals("zz")) {
+                // This is special language name for language agnostic usage.
+                continue;
+            }
             final String subtypeLocaleString =
                     subtype.containsExtraValueKey(LatinIME.SUBTYPE_EXTRA_VALUE_KEYBOARD_LOCALE)
                     ? subtype.getExtraValueOf(LatinIME.SUBTYPE_EXTRA_VALUE_KEYBOARD_LOCALE)