Add hindi_compact keyboard

Bug: 13779052
Change-Id: Ic7c17d96560501422a63340d7ce6bd8720e6c3c9
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index 494bfbd..937a799 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -361,6 +361,10 @@
     <!-- Description for "LANGUAGE_NAME" (Traditional) keyboard subtype [CHAR LIMIT=25]
          (Traditional) can be an abbreviation to fit in the CHAR LIMIT. -->
     <string name="subtype_generic_traditional"><xliff:g id="LANGUAGE_NAME" example="Nepali">%s</xliff:g> (Traditional)</string>
+    <!-- Description for "LANGUAGE_NAME" (Compact) keyboard subtype [CHAR LIMIT=25]
+         (Compact) can be an abbreviation to fit in the CHAR LIMIT.
+         TODO: Remove translatable=false once we are settled down with the naming. -->
+    <string name="subtype_generic_compact" translatable="false"><xliff:g id="LANGUAGE_NAME" example="Hindi">%s</xliff:g> (Compact)</string>
     <!-- TODO: Uncomment once we can handle IETF language tag with script name specified.
          Description for Serbian Cyrillic keyboard subtype [CHAR LIMIT=25]
          (Cyrillic) can be an abbreviation to fit in the CHAR LIMIT.
diff --git a/java/res/xml-sw600dp/keys_comma_period.xml b/java/res/xml-sw600dp/keys_comma_period.xml
index ab98733..23172cf 100644
--- a/java/res/xml-sw600dp/keys_comma_period.xml
+++ b/java/res/xml-sw600dp/keys_comma_period.xml
@@ -28,11 +28,26 @@
         latin:moreKeys="!text/morekeys_tablet_comma"
         latin:backgroundType="functional"
         latin:keyStyle="hasShiftedLetterHintStyle" />
-    <Key
-        latin:keySpec="!text/keyspec_tablet_period"
-        latin:keyHintLabel="!text/keyhintlabel_tablet_period"
-        latin:keyLabelFlags="hasPopupHint"
-        latin:moreKeys="!text/morekeys_tablet_period"
-        latin:backgroundType="functional"
-        latin:keyStyle="hasShiftedLetterHintStyle" />
+    <switch>
+        <case
+            latin:languageCode="hi"
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0964: "।" DEVANAGARI DANDA -->
+            <Key
+                latin:keySpec="\u0964"
+                latin:keyLabelFlags="hasPopupHint"
+                latin:moreKeys="!autoColumnOrder!8,\\,,.,',#,),(,/,;,@,:,-,&quot;,+,\\%,&amp;"
+                latin:backgroundType="functional" />
+        </case>
+        <default>
+            <Key
+                latin:keySpec="!text/keyspec_tablet_period"
+                latin:keyHintLabel="!text/keyhintlabel_tablet_period"
+                latin:keyLabelFlags="hasPopupHint"
+                latin:moreKeys="!text/morekeys_tablet_period"
+                latin:backgroundType="functional"
+                latin:keyStyle="hasShiftedLetterHintStyle" />
+        </default>
+    </switch>
 </merge>
diff --git a/java/res/xml-sw600dp/rows_hindi_compact.xml b/java/res/xml-sw600dp/rows_hindi_compact.xml
new file mode 100644
index 0000000..ac476eb
--- /dev/null
+++ b/java/res/xml-sw600dp/rows_hindi_compact.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <include
+        latin:keyboardLayout="@xml/key_styles_common" />
+    <Row
+        latin:keyWidth="8.182%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/rowkeys_hindi_compact1" />
+        <Key
+            latin:keyStyle="deleteKeyStyle"
+            latin:keyWidth="fillRight" />
+    </Row>
+    <Row
+        latin:keyWidth="8.182%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/rowkeys_hindi_compact2" />
+        <Key
+            latin:keyStyle="enterKeyStyle"
+            latin:keyWidth="fillRight" />
+    </Row>
+    <Row
+        latin:keyWidth="8.182%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/rowkeys_hindi_compact3" />
+        <include
+            latin:keyboardLayout="@xml/keys_exclamation_question" />
+    </Row>
+    <include
+        latin:keyboardLayout="@xml/row_qwerty4" />
+</merge>
diff --git a/java/res/xml-v16/keystyle_devanagari_sign_anusvara.xml b/java/res/xml-v16/keystyle_devanagari_sign_anusvara.xml
index 10b1426..71439d6 100644
--- a/java/res/xml-v16/keystyle_devanagari_sign_anusvara.xml
+++ b/java/res/xml-v16/keystyle_devanagari_sign_anusvara.xml
@@ -25,9 +25,26 @@
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0903: "ः‍" DEVANAGARI SIGN VISARGA
+                 U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
+                 U+093C: "़" DEVANAGARI SIGN NUKTA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariSignAnusvara"
+                latin:moreKeys="&#x0903;,&#x0901;,&#x093C;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariSignAnusvara" />
+        </default>
+    </switch>
     <!-- U+0902: "ं" DEVANAGARI SIGN ANUSVARA -->
     <key-style
         latin:styleName="baseKeyDevanagariSignAnusvara"
+        latin:parentStyle="moreKeysDevanagariSignAnusvara"
         latin:keySpec="&#x0902;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/keystyle_devanagari_sign_virama.xml b/java/res/xml-v16/keystyle_devanagari_sign_virama.xml
index 764fb1f..0c3a29b 100644
--- a/java/res/xml-v16/keystyle_devanagari_sign_virama.xml
+++ b/java/res/xml-v16/keystyle_devanagari_sign_virama.xml
@@ -25,9 +25,24 @@
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+094D: "्" DEVANAGARI SIGN VIRAMA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariSignVirama"
+                latin:moreKeys="&#x094D;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariSignVirama" />
+        </default>
+    </switch>
     <!-- U+094D: "्" DEVANAGARI SIGN VIRAMA -->
     <key-style
         latin:styleName="baseKeyDevanagariSignVirama"
+        latin:parentStyle="moreKeysDevanagariSignVirama"
         latin:keySpec="&#x094D;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_aa.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_aa.xml
index fe9264b..5bb0351 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_aa.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_aa.xml
@@ -35,6 +35,14 @@
                 latin:styleName="moreKeysDevanagariVowelSignAa"
                 latin:moreKeys="&#x093E;&#x0902;,&#x093E;&#x0901;,%" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+093E: "ा" DEVANAGARI VOWEL SIGN AA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAa"
+                latin:moreKeys="&#x093E;,%" />
+        </case>
         <default>
             <key-style
                 latin:styleName="moreKeysDevanagariVowelSignAa" />
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_ai.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_ai.xml
index fdb53bb..8edf6eb 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_ai.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_ai.xml
@@ -35,6 +35,14 @@
                 latin:moreKeys="&#x0948;&#x0902;,%" />
         </case>
         <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0948: "ै" DEVANAGARI VOWEL SIGN AI -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAi"
+                latin:moreKeys="&#x0948;,%" />
+        </case>
+        <case
             latin:keyboardLayoutSet="nepali_traditional"
         >
             <!-- U+0936/U+094D/U+0930: "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA -->
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_au.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_au.xml
index 653e79e..212e058 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_au.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_au.xml
@@ -34,6 +34,14 @@
                 latin:styleName="moreKeysDevanagariVowelSignAu"
                 latin:moreKeys="&#x094C;&#x0902;,%" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+094C: "ौ" DEVANAGARI VOWEL SIGN AU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAu"
+                latin:moreKeys="&#x094C;,%" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignAu" />
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_candra_e.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_candra_e.xml
new file mode 100644
index 0000000..ef2c3f1
--- /dev/null
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_candra_e.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<!-- The code point U+25CC for key label is needed because the font rendering system prior to
+     API version 16 can't automatically render dotted circle for incomplete combining letter
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignCandraE"
+                latin:moreKeys="&#x0945;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignCandraE" />
+        </default>
+    </switch>
+</merge>
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_candra_o.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_candra_o.xml
index f7edae0..ac01d37 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_candra_o.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_candra_o.xml
@@ -25,9 +25,24 @@
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignCandraO"
+                latin:moreKeys="&#x0949;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignCandraO" />
+        </default>
+    </switch>
     <!-- U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O -->
     <key-style
         latin:styleName="baseKeyDevanagariVowelSignCandraO"
+        latin:parentStyle="moreKeysDevanagariVowelSignCandraO"
         latin:keySpec="&#x0949;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_e.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_e.xml
index 7240a2c..77d6eb5 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_e.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_e.xml
@@ -35,6 +35,14 @@
                 latin:moreKeys="&#x0947;&#x0902;" />
         </case>
         <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0947: "े" DEVANAGARI VOWEL SIGN E -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignE"
+                latin:moreKeys="&#x0947;" />
+        </case>
+        <case
             latin:keyboardLayoutSet="nepali_traditional"
         >
             <!-- U+0903: "ः‍" DEVANAGARI SIGN VISARGA
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_i.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_i.xml
index 5a006f0..d79447b 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_i.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_i.xml
@@ -34,6 +34,14 @@
                 latin:styleName="moreKeysDevanagariVowelSignI"
                 latin:moreKeys="&#x093F;&#x0902;" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+093F: "ि" DEVANAGARI VOWEL SIGN I -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignI"
+                latin:moreKeys="&#x093F;" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignI" />
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_ii.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_ii.xml
index a2b07fe..0e10f31 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_ii.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_ii.xml
@@ -34,6 +34,14 @@
                 latin:styleName="moreKeysDevanagariVowelSignIi"
                 latin:moreKeys="&#x0940;&#x0902;,%" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0940: "ी" DEVANAGARI VOWEL SIGN II -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignIi"
+                latin:moreKeys="&#x0940;,%" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignIi" />
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_o.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_o.xml
index 4b764cd..47ca906 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_o.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_o.xml
@@ -29,13 +29,21 @@
         <case
             latin:keyboardLayoutSet="hindi"
         >
-            <!-- U+094B/U+0902: "қं" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA
+            <!-- U+094B/U+0902: "ों" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA
                  U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
                  U+094A: "ॊ" DEVANAGARI VOWEL SIGN SHORT O -->
             <key-style
                 latin:styleName="moreKeysDevanagariVowelSignO"
                 latin:moreKeys="&#x094B;&#x0902;,&#x0949;,&#x094A;" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+094B: "ो" DEVANAGARI VOWEL SIGN O -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignO"
+                latin:moreKeys="&#x094B;" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignO" />
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_u.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_u.xml
index 18d485a..694e4ab 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_u.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_u.xml
@@ -35,6 +35,14 @@
                 latin:styleName="moreKeysDevanagariVowelSignU"
                 latin:moreKeys="&#x0941;&#x0902;,&#x0941;&#x0901;" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0941: "ु" DEVANAGARI VOWEL SIGN U -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignU"
+                latin:moreKeys="&#x0941;" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignU" />
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_uu.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_uu.xml
index d770ee6..f17489e 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_uu.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_uu.xml
@@ -35,6 +35,14 @@
                 latin:styleName="moreKeysDevanagariVowelSignUu"
                 latin:moreKeys="&#x0942;&#x0902;,&#x0942;&#x0901;,%" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0942: "ू" DEVANAGARI VOWEL SIGN UU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignUu"
+                latin:moreKeys="&#x0942;,%" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignUu" />
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_vocalic_r.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_vocalic_r.xml
index b49a97c..2709846 100644
--- a/java/res/xml-v16/keystyle_devanagari_vowel_sign_vocalic_r.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_vocalic_r.xml
@@ -35,6 +35,15 @@
                 latin:moreKeys="&#x0944;" />
         </case>
         <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+090B: "ऋ" DEVANAGARI LETTER VOCALIC R
+                 U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignVocalicR"
+                latin:moreKeys="&#x090B;,&#x0943;" />
+        </case>
+        <case
             latin:keyboardLayoutSet="nepali_traditional"
         >
             <!-- U+0913: "ओ" DEVANAGARI LETTER O -->
diff --git a/java/res/xml/kbd_hindi_compact.xml b/java/res/xml/kbd_hindi_compact.xml
new file mode 100644
index 0000000..7502bba
--- /dev/null
+++ b/java/res/xml/kbd_hindi_compact.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<Keyboard
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <include
+        latin:keyboardLayout="@xml/rows_hindi_compact" />
+</Keyboard>
diff --git a/java/res/xml/key_period.xml b/java/res/xml/key_period.xml
index ce23e22..e1d4bbd 100644
--- a/java/res/xml/key_period.xml
+++ b/java/res/xml/key_period.xml
@@ -23,6 +23,17 @@
 >
     <switch>
         <case
+            latin:languageCode="hi"
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+0964: "।" DEVANAGARI DANDA -->
+            <Key
+                latin:keySpec="\u0964"
+                latin:keyLabelFlags="hasPopupHint"
+                latin:moreKeys="!autoColumnOrder!9,\\,,.,?,!,#,),(,/,;,',@,:,-,&quot;,+,\\%,&amp;"
+                latin:backgroundType="functional" />
+        </case>
+        <case
             latin:languageCode="ne"
             latin:keyboardLayoutSet="nepali_traditional"
         >
diff --git a/java/res/xml/keyboard_layout_set_hindi_compact.xml b/java/res/xml/keyboard_layout_set_hindi_compact.xml
new file mode 100644
index 0000000..77d02fb
--- /dev/null
+++ b/java/res/xml/keyboard_layout_set_hindi_compact.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<KeyboardLayoutSet
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
+    <Element
+        latin:elementName="alphabet"
+        latin:elementKeyboard="@xml/kbd_hindi_compact"
+        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" />
+</KeyboardLayoutSet>
diff --git a/java/res/xml/keystyle_devanagari_sign_anusvara.xml b/java/res/xml/keystyle_devanagari_sign_anusvara.xml
index 0486a5d..6dc9b7e 100644
--- a/java/res/xml/keystyle_devanagari_sign_anusvara.xml
+++ b/java/res/xml/keystyle_devanagari_sign_anusvara.xml
@@ -25,10 +25,28 @@
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0903: "ः‍" DEVANAGARI SIGN VISARGA
+                 U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
+                 U+093C: "़" DEVANAGARI SIGN NUKTA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariSignAnusvara"
+                latin:moreKeys="&#x25CC;&#x0903;|&#x0903;,&#x25CC;&#x0901;|&#x0901;,&#x25CC;&#x093C;|&#x093C;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariSignAnusvara" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
          U+0902: "ं" DEVANAGARI SIGN ANUSVARA -->
     <key-style
         latin:styleName="baseKeyDevanagariSignAnusvara"
+        latin:parentStyle="moreKeysDevanagariSignAnusvara"
         latin:keySpec="&#x25CC;&#x0902;|&#x0902;"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
 </merge>
diff --git a/java/res/xml/keystyle_devanagari_sign_virama.xml b/java/res/xml/keystyle_devanagari_sign_virama.xml
index 5e0e108..96506e2 100644
--- a/java/res/xml/keystyle_devanagari_sign_virama.xml
+++ b/java/res/xml/keystyle_devanagari_sign_virama.xml
@@ -25,10 +25,26 @@
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+094D: "्" DEVANAGARI SIGN VIRAMA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariSignVirama"
+                latin:moreKeys="&#x25CC;&#x094D;|&#x094D;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariSignVirama" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
          U+094D: "्" DEVANAGARI SIGN VIRAMA -->
     <key-style
         latin:styleName="baseKeyDevanagariSignVirama"
+        latin:parentStyle="moreKeysDevanagariSignVirama"
         latin:keySpec="&#x25CC;&#x094D;|&#x094D;"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
  </merge>
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_aa.xml b/java/res/xml/keystyle_devanagari_vowel_sign_aa.xml
index 97f98e3..4b87650 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_aa.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_aa.xml
@@ -36,6 +36,15 @@
                 latin:styleName="moreKeysDevanagariVowelSignAa"
                 latin:moreKeys="&#x25CC;&#x093E;&#x0902;|&#x093E;&#x0902;,&#x25CC;&#x093E;&#x0901;|&#x093E;&#x0901;,%" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+093E: "ा" DEVANAGARI VOWEL SIGN AA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAa"
+                latin:moreKeys="&#x25CC;&#x093E;|&#x093E;,%" />
+        </case>
         <default>
             <key-style
                 latin:styleName="moreKeysDevanagariVowelSignAa" />
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_ai.xml b/java/res/xml/keystyle_devanagari_vowel_sign_ai.xml
index 4d1b2c5..050a7ce 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_ai.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_ai.xml
@@ -36,6 +36,15 @@
                 latin:moreKeys="&#x25CC;&#x0948;&#x0902;|&#x0948;&#x0902;,%" />
         </case>
         <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0948: "ै" DEVANAGARI VOWEL SIGN AI -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAi"
+                latin:moreKeys="&#x25CC;&#x0948;|&#x0948;,%" />
+        </case>
+        <case
             latin:keyboardLayoutSet="nepali_traditional"
         >
             <!-- U+0936/U+094D/U+0930: "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA -->
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_au.xml b/java/res/xml/keystyle_devanagari_vowel_sign_au.xml
index 66628b5..49e67da 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_au.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_au.xml
@@ -30,11 +30,20 @@
             latin:keyboardLayoutSet="hindi"
         >
             <!-- U+25CC: "◌" DOTTED CIRCLE
-                U+094C/U+0902: "ौं" DEVANAGARI VOWEL SIGN AU/DEVANAGARI SIGN ANUSVARA -->
+                 U+094C/U+0902: "ौं" DEVANAGARI VOWEL SIGN AU/DEVANAGARI SIGN ANUSVARA -->
             <key-style
                 latin:styleName="moreKeysDevanagariVowelSignAu"
                 latin:moreKeys="&#x25CC;&#x094C;&#x0902;|&#x094C;&#x0902;,%" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+094C: "ौ" DEVANAGARI VOWEL SIGN AU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAu"
+                latin:moreKeys="&#x25CC;&#x094C;|&#x094C;,%" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignAu" />
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_candra_e.xml b/java/res/xml/keystyle_devanagari_vowel_sign_candra_e.xml
new file mode 100644
index 0000000..86f68d3
--- /dev/null
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_candra_e.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<!-- The code point U+25CC for key label is needed because the font rendering system prior to
+     API version 16 can't automatically render dotted circle for incomplete combining letter
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignCandraE"
+                latin:moreKeys="&#x25CC;&#x0945;|&#x0945;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignCandraE" />
+        </default>
+    </switch>
+</merge>
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_candra_o.xml b/java/res/xml/keystyle_devanagari_vowel_sign_candra_o.xml
index e2c2cec..fd711e0 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_candra_o.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_candra_o.xml
@@ -25,10 +25,26 @@
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignCandraO"
+                latin:moreKeys="&#x25CC;&#x0949;|&#x0949;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignCandraO" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
          U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O -->
     <key-style
         latin:styleName="baseKeyDevanagariVowelSignCandraO"
+        latin:parentStyle="moreKeysDevanagariVowelSignCandraO"
         latin:keySpec="&#x25CC;&#x0949;|&#x0949;"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
 </merge>
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_e.xml b/java/res/xml/keystyle_devanagari_vowel_sign_e.xml
index de1d949..88f6a74 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_e.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_e.xml
@@ -36,6 +36,15 @@
                 latin:moreKeys="&#x25CC;&#x0947;&#x0902;|&#x0947;&#x0902;" />
         </case>
         <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0947: "े" DEVANAGARI VOWEL SIGN E -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignE"
+                latin:moreKeys="&#x25CC;&#x0947;|&#x0947;" />
+        </case>
+        <case
             latin:keyboardLayoutSet="nepali_traditional"
         >
             <!-- U+25CC: "◌" DOTTED CIRCLE
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_i.xml b/java/res/xml/keystyle_devanagari_vowel_sign_i.xml
index d1d56c1..a84fdb4 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_i.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_i.xml
@@ -35,6 +35,15 @@
                 latin:styleName="moreKeysDevanagariVowelSignI"
                 latin:moreKeys="&#x093F;&#x25CC;&#x0902;|&#x093F;&#x0902;" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+093F: "ि" DEVANAGARI VOWEL SIGN I -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignI"
+                latin:moreKeys="&#x25CC;&#x093F;|&#x093F;" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignI" />
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_ii.xml b/java/res/xml/keystyle_devanagari_vowel_sign_ii.xml
index fd0ce77..6f6eb0f 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_ii.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_ii.xml
@@ -29,12 +29,21 @@
         <case
             latin:keyboardLayoutSet="hindi"
         >
-            <!-- U+0940: "ी" DEVANAGARI VOWEL SIGN II
+            <!-- U+25CC: "◌" DOTTED CIRCLE
                  U+0940/U+0902: "ीं" DEVANAGARI VOWEL SIGN II/DEVANAGARI SIGN ANUSVARA -->
             <key-style
                 latin:styleName="moreKeysDevanagariVowelSignIi"
                 latin:moreKeys="&#x25CC;&#x0940;&#x0902;|&#x0940;&#x0902;,%" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0940: "ी" DEVANAGARI VOWEL SIGN II -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignIi"
+                latin:moreKeys="&#x25CC;&#x0940;|&#x0940;,%" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignIi" />
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_o.xml b/java/res/xml/keystyle_devanagari_vowel_sign_o.xml
index edc3bef..68b176a 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_o.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_o.xml
@@ -30,13 +30,22 @@
             latin:keyboardLayoutSet="hindi"
         >
             <!-- U+25CC: "◌" DOTTED CIRCLE
-                 U+094B/U+0902: "қं" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA
+                 U+094B/U+0902: "ों" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA
                  U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
                  U+094A: "ॊ" DEVANAGARI VOWEL SIGN SHORT O -->
             <key-style
                 latin:styleName="moreKeysDevanagariVowelSignO"
                 latin:moreKeys="&#x25CC;&#x094B;&#x0902;|&#x094B;&#x0902;,&#x25CC;&#x0949;|&#x0949;,&#x25CC;&#x094A;|&#x094A;" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+094B: "ो" DEVANAGARI VOWEL SIGN O -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignO"
+                latin:moreKeys="&#x25CC;&#x094B;|&#x094B;" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignO" />
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_u.xml b/java/res/xml/keystyle_devanagari_vowel_sign_u.xml
index c7de4fd..7c058b1 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_u.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_u.xml
@@ -36,6 +36,15 @@
                 latin:styleName="moreKeysDevanagariVowelSignU"
                 latin:moreKeys="&#x25CC;&#x0941;&#x0902;|&#x0941;&#x0902;,&#x25CC;&#x0941;&#x0901;|&#x0941;&#x0901;" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0941: "ु" DEVANAGARI VOWEL SIGN U -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignU"
+                latin:moreKeys="&#x25CC;&#x0941;|&#x0941;" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignU" />
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_uu.xml b/java/res/xml/keystyle_devanagari_vowel_sign_uu.xml
index 6029d6d..73ab63c 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_uu.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_uu.xml
@@ -36,6 +36,15 @@
                 latin:styleName="moreKeysDevanagariVowelSignUu"
                 latin:moreKeys="&#x25CC;&#x0942;&#x0902;|&#x0942;&#x0902;,&#x25CC;&#x0942;&#x0901;|&#x0942;&#x0901;,%" />
         </case>
+        <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0942: "ू" DEVANAGARI VOWEL SIGN UU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignUu"
+                latin:moreKeys="&#x25CC;&#x0942;|&#x0942;,%" />
+        </case>
         <default>
              <key-style
                 latin:styleName="moreKeysDevanagariVowelSignUu" />
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_vocalic_r.xml b/java/res/xml/keystyle_devanagari_vowel_sign_vocalic_r.xml
index 2268f7d..29b083e 100644
--- a/java/res/xml/keystyle_devanagari_vowel_sign_vocalic_r.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_vocalic_r.xml
@@ -36,6 +36,16 @@
                 latin:moreKeys="&#x25CC;&#x0944;|&#x0944;" />
         </case>
         <case
+            latin:keyboardLayoutSet="hindi_compact"
+        >
+            <!-- U+090B: "ऋ" DEVANAGARI LETTER VOCALIC R
+                 U+25CC: "◌" DOTTED CIRCLE
+                 U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignVocalicR"
+                latin:moreKeys="&#x090B;,&#x25CC;&#x0943;|&#x0943;" />
+        </case>
+        <case
             latin:keyboardLayoutSet="nepali_traditional"
         >
             <!-- U+0913: "ओ" DEVANAGARI LETTER O -->
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index cc82456..ee1b54b 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -49,6 +49,7 @@
     fr_CH: French (Switzerland)/swiss
     gl_ES: Galician (Spain)/spanish
     hi: Hindi/hindi
+    hi: Hindi/hindi_compact
     hr: Croatian/qwertz
     hu: Hungarian/qwertz
     hy_AM: Armenian (Armenia) Phonetic/armenian_phonetic
@@ -321,6 +322,14 @@
             android:isAsciiCapable="false"
     />
     <subtype android:icon="@drawable/ic_ime_switcher_dark"
+            android:label="@string/subtype_generic_compact"
+            android:subtypeId="0xe49c89a1"
+            android:imeSubtypeLocale="hi"
+            android:imeSubtypeMode="keyboard"
+            android:imeSubtypeExtraValue="KeyboardLayoutSet=hindi_compact,EmojiCapable"
+            android:isAsciiCapable="false"
+    />
+    <subtype android:icon="@drawable/ic_ime_switcher_dark"
             android:label="@string/subtype_generic"
             android:subtypeId="0x35b7526a"
             android:imeSubtypeLocale="hr"
diff --git a/java/res/xml/rowkeys_hindi_compact1.xml b/java/res/xml/rowkeys_hindi_compact1.xml
new file mode 100644
index 0000000..c63de4f
--- /dev/null
+++ b/java/res/xml/rowkeys_hindi_compact1.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_au" />
+    <!-- U+0914: "औ" DEVANAGARI LETTER AU
+         U+0967: "१" DEVANAGARI DIGIT ONE -->
+    <Key
+        latin:keySpec="&#x0914;"
+        latin:keyStyle="moreKeysDevanagariVowelSignAu"
+        latin:keyHintLabel="1"
+        latin:additionalMoreKeys="&#x0967;,1"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_ai" />
+    <!-- U+0910: "ऐ" DEVANAGARI LETTER AI
+         U+0968: "२" DEVANAGARI DIGIT TWO -->
+    <Key
+        latin:keySpec="&#x0910;"
+        latin:keyStyle="moreKeysDevanagariVowelSignAi"
+        latin:keyHintLabel="2"
+        latin:additionalMoreKeys="&#x0968;,2"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_aa" />
+    <!-- U+0906: "आ" DEVANAGARI LETTER AA
+         U+0969: "३" DEVANAGARI DIGIT THREE -->
+    <Key
+        latin:keySpec="&#x0906;"
+        latin:keyStyle="moreKeysDevanagariVowelSignAa"
+        latin:keyHintLabel="3"
+        latin:additionalMoreKeys="&#x0969;,3"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_ii" />
+    <!-- U+0908: "ई" DEVANAGARI LETTER II
+         U+096A: "४" DEVANAGARI DIGIT FOUR -->
+    <Key
+        latin:keySpec="&#x0908;"
+        latin:keyStyle="moreKeysDevanagariVowelSignIi"
+        latin:keyHintLabel="4"
+        latin:additionalMoreKeys="&#x096A;,4"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_uu" />
+    <!-- U+090A: "ऊ" DEVANAGARI LETTER UU
+         U+096B: "५" DEVANAGARI DIGIT FIVE -->
+    <Key
+        latin:keySpec="&#x090A;"
+        latin:keyStyle="moreKeysDevanagariVowelSignUu"
+        latin:keyHintLabel="5"
+        latin:additionalMoreKeys="&#x096B;,5"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+092C: "ब" DEVANAGARI LETTER BA
+         U+092D: "भ" DEVANAGARI LETTER BHA
+         U+096C: "६" DEVANAGARI DIGIT SIX -->
+    <Key
+        latin:keySpec="&#x092C;"
+        latin:moreKeys="&#x092D;,%"
+        latin:keyHintLabel="6"
+        latin:additionalMoreKeys="&#x096C;,6"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0939: "ह" DEVANAGARI LETTER HA
+         U+096D: "७" DEVANAGARI DIGIT SEVEN -->
+    <Key
+        latin:keySpec="&#x0939;"
+        latin:keyHintLabel="7"
+        latin:additionalMoreKeys="&#x096D;,7"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0917: "ग" DEVANAGARI LETTER GA
+         U+0918: "घ" DEVANAGARI LETTER GHA
+         U+096E: "८" DEVANAGARI DIGIT EIGHT -->
+    <Key
+        latin:keySpec="&#x0917;"
+        latin:moreKeys="&#x0918;,%"
+        latin:keyHintLabel="8"
+        latin:additionalMoreKeys="&#x096E;,8"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0926: "द" DEVANAGARI LETTER DA
+         U+0927: "ध" DEVANAGARI LETTER DHA
+         U+096F: "९" DEVANAGARI DIGIT NINE -->
+    <Key
+        latin:keySpec="&#x0926;"
+        latin:moreKeys="&#x0927;,%"
+        latin:keyHintLabel="9"
+        latin:additionalMoreKeys="&#x096F;,9"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+091C: "ज" DEVANAGARI LETTER JA
+         U+091D: "झ" DEVANAGARI LETTER JHA
+         U+091C/U+094D/U+091E: "ज्ञ" DEVANAGARI LETTER JA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER NYA
+         U+0966: "०" DEVANAGARI DIGIT ZERO -->
+    <Key
+        latin:keySpec="&#x091C;"
+        latin:moreKeys="&#x091D;,&#x091C;&#x094D;&#x091E;,%"
+        latin:keyHintLabel="0"
+        latin:additionalMoreKeys="&#x0966;,0"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0921: "ड" DEVANAGARI LETTER DDA
+         U+0922: "ढ" DEVANAGARI LETTER DDHA -->
+    <Key
+        latin:keySpec="&#x0921;"
+        latin:moreKeys="&#x0922;"
+        latin:keyLabelFlags="fontNormal" />
+</merge>
diff --git a/java/res/xml/rowkeys_hindi_compact2.xml b/java/res/xml/rowkeys_hindi_compact2.xml
new file mode 100644
index 0000000..06364c2
--- /dev/null
+++ b/java/res/xml/rowkeys_hindi_compact2.xml
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_o" />
+    <!-- U+0913: "ओ" DEVANAGARI LETTER O -->
+    <Key
+        latin:keySpec="&#x0913;"
+        latin:keyStyle="moreKeysDevanagariVowelSignO"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_e" />
+    <!-- U+090F: "ए" DEVANAGARI LETTER E -->
+    <Key
+        latin:keySpec="&#x090F;"
+        latin:keyStyle="moreKeysDevanagariVowelSignE"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_sign_virama" />
+    <!-- U+0905: "अ" DEVANAGARI LETTER A -->
+    <Key
+        latin:keySpec="&#x0905;"
+        latin:keyStyle="moreKeysDevanagariSignVirama"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_i" />
+    <!-- U+0907: "इ" DEVANAGARI LETTER I -->
+    <Key
+        latin:keySpec="&#x0907;"
+        latin:keyStyle="moreKeysDevanagariVowelSignI"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_u" />
+    <!-- U+0909: "उ" DEVANAGARI LETTER U -->
+    <Key
+        latin:keySpec="&#x0909;"
+        latin:keyStyle="moreKeysDevanagariVowelSignU"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+092A: "प" DEVANAGARI LETTER PA
+         U+092B: "फ" DEVANAGARI LETTER PHA -->
+    <Key
+        latin:keySpec="&#x092A;"
+        latin:moreKeys="&#x092B;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_vocalic_r" />
+    <!-- U+0930: "र" DEVANAGARI LETTER RA -->
+    <Key
+        latin:keySpec="&#x0930;"
+        latin:keyStyle="moreKeysDevanagariVowelSignVocalicR"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0915: "क" DEVANAGARI LETTER KA
+         U+0916: "ख" DEVANAGARI LETTER KHA -->
+    <Key
+        latin:keySpec="&#x0915;"
+        latin:moreKeys="&#x0916;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0924: "त" DEVANAGARI LETTER TA
+         U+0925: "थ" DEVANAGARI LETTER THA
+         U+0924/U+094D/U+0930: "त्र" DEVANAGARI LETTER TA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA -->
+    <Key
+        latin:keySpec="&#x0924;"
+        latin:moreKeys="&#x0925;,&#x0924;&#x094D;&#x0930;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+091A: "च" DEVANAGARI LETTER CA
+         U+091B: "छ" DEVANAGARI LETTER CHA -->
+    <Key
+        latin:keySpec="&#x091A;"
+        latin:moreKeys="&#x091B;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+091F: "ट" DEVANAGARI LETTER TTA
+         U+0920: "ठ" DEVANAGARI LETTER TTHA -->
+    <Key
+        latin:keySpec="&#x091F;"
+        latin:moreKeys="&#x0920;"
+        latin:keyLabelFlags="fontNormal" />
+</merge>
diff --git a/java/res/xml/rowkeys_hindi_compact3.xml b/java/res/xml/rowkeys_hindi_compact3.xml
new file mode 100644
index 0000000..0e8165e
--- /dev/null
+++ b/java/res/xml/rowkeys_hindi_compact3.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_candra_o" />
+    <!-- U+0911: "ऑ" DEVANAGARI LETTER CANDRA O -->
+    <Key
+        latin:keySpec="&#x0911;"
+        latin:keyStyle="moreKeysDevanagariVowelSignCandraO"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_candra_e" />
+    <!-- U+090D: "ऍ" DEVANAGARI LETTER CANDRA E -->
+    <Key
+        latin:keySpec="&#x090D;"
+        latin:keyStyle="moreKeysDevanagariVowelSignCandraE"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- Because the font rendering system prior to API version 16 can't automatically
+         render dotted circle for incomplete combining letter of some scripts, different
+         set of Key definitions are needed based on the API version. -->
+    <include
+        latin:keyboardLayout="@xml/keystyle_devanagari_sign_anusvara" />
+    <Key
+        latin:keyStyle="baseKeyDevanagariSignAnusvara" />
+    <!-- U+092E: "म" DEVANAGARI LETTER MA
+         U+0950: "ॐ" DEVANAGARI OM -->
+    <Key
+        latin:keySpec="&#x092E;"
+        latin:moreKeys="&#x0950;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0928: "न" DEVANAGARI LETTER NA
+         U+0923: "ण" DEVANAGARI LETTER NNA
+         U+091E: "ञ" DEVANAGARI LETTER NYA
+         U+0919: "ङ" DEVANAGARI LETTER NGA -->
+    <Key
+        latin:keySpec="&#x0928;"
+        latin:moreKeys="&#x0923;,&#x091E;,&#x0919;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0935: "व" DEVANAGARI LETTER VA -->
+    <Key
+        latin:keySpec="&#x0935;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0932: "ल" DEVANAGARI LETTER LA -->
+    <Key
+        latin:keySpec="&#x0932;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0938: "स" DEVANAGARI LETTER SA
+         U+0936: "श" DEVANAGARI LETTER SHA
+         U+0937: "ष" DEVANAGARI LETTER SSA
+         U+0936/U+094D/U+0930: "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA -->
+    <Key
+        latin:keySpec="&#x0938;"
+        latin:moreKeys="&#x0936;,&#x0937;,&#x0936;&#x094D;&#x0930;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+092F: "य" DEVANAGARI LETTER YA -->
+    <Key
+        latin:keySpec="&#x092F;"
+        latin:keyLabelFlags="fontNormal" />
+    <!-- U+0915/U+094D/U+0937: "क्ष" DEVANAGARI LETTER KA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER SSA -->
+    <Key
+        latin:keySpec="&#x0915;&#x094D;&#x0937;"
+        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
+</merge>
diff --git a/java/res/xml/rows_hindi_compact.xml b/java/res/xml/rows_hindi_compact.xml
new file mode 100644
index 0000000..a60cf2b
--- /dev/null
+++ b/java/res/xml/rows_hindi_compact.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, 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.
+*/
+-->
+
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <include
+        latin:keyboardLayout="@xml/key_styles_common" />
+    <Row
+        latin:keyWidth="9.091%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/rowkeys_hindi_compact1" />
+    </Row>
+    <Row
+            latin:keyWidth="9.091%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/rowkeys_hindi_compact2" />
+    </Row>
+    <Row
+        latin:keyWidth="9.091%p"
+    >
+        <include
+            latin:keyboardLayout="@xml/rowkeys_hindi_compact3" />
+        <Key
+            latin:keyStyle="deleteKeyStyle"
+            latin:keyWidth="fillRight" />
+    </Row>
+    <include
+        latin:keyboardLayout="@xml/row_qwerty4" />
+</merge>
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/HindiCompact.java b/tests/src/com/android/inputmethod/keyboard/layout/HindiCompact.java
new file mode 100644
index 0000000..afd26e4
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/HindiCompact.java
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package com.android.inputmethod.keyboard.layout;
+
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.SIGN_ANUSVARA;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.SIGN_CANDRABINDU;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.SIGN_NUKTA;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.SIGN_VIRAMA;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.SIGN_VISARGA;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_AA;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_AI;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_AU;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_CANDRA_E;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_CANDRA_O;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_E;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_I;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_II;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_O;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_U;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_UU;
+import static com.android.inputmethod.keyboard.layout.DevanagariLetterConstants.VOWEL_SIGN_VOCALIC_R;
+
+import com.android.inputmethod.keyboard.layout.Hindi.HindiCustomizer;
+import com.android.inputmethod.keyboard.layout.Hindi.HindiSymbols;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKey;
+import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder;
+import com.android.inputmethod.latin.Constants;
+
+import java.util.Locale;
+
+/**
+ * The Hindi Compact keyboard.
+ */
+public final class HindiCompact extends LayoutBase {
+    private static final String LAYOUT_NAME = "hindi_compact";
+
+    public HindiCompact(final LayoutCustomizer customizer) {
+        super(customizer, HindiSymbols.class, SymbolsShifted.class);
+    }
+
+    @Override
+    public String getName() { return LAYOUT_NAME; }
+
+    public static class HindiCompactCustomizer extends HindiCustomizer {
+        public HindiCompactCustomizer(final Locale locale) { super(locale); }
+
+        @Override
+        public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) {
+            return EMPTY_KEYS;
+        }
+
+        @Override
+        public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
+            // U+0964: "।" DEVANAGARI DANDA
+            final ExpectedKey periodKey = key("\u0964", getPunctuationMoreKeys(isPhone));
+            return isPhone ? joinKeys(periodKey) : joinKeys(",", periodKey);
+        }
+
+        @Override
+        public ExpectedKey[] getPunctuationMoreKeys(final boolean isPhone) {
+            return isPhone ? HINDI_PHONE_PUNCTUATION_MORE_KEYS : HINDI_TABLET_PUNCTUATION_MORE_KEYS;
+        }
+
+        // Punctuation more keys for phone form factor.
+        private static final ExpectedKey[] HINDI_PHONE_PUNCTUATION_MORE_KEYS = joinKeys(
+                ",", ".", "?", "!", "#", ")", "(", "/", ";",
+                "'", "@", ":", "-", "\"", "+", "%", "&");
+        // Punctuation more keys for tablet form factor.
+        private static final ExpectedKey[] HINDI_TABLET_PUNCTUATION_MORE_KEYS = joinKeys(
+                ",", ".", "'", "#", ")", "(", "/", ";",
+                "@", ":", "-", "\"", "+", "%", "&");
+    }
+
+    @Override
+    ExpectedKey[][] getCommonAlphabetLayout(boolean isPhone) { return ALPHABET_COMMON; }
+
+    @Override
+    ExpectedKey[][] getCommonAlphabetShiftLayout(boolean isPhone, final int elementId) {
+        return null;
+    }
+
+    private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder()
+            .setKeysOfRow(1,
+                    // U+0914: "औ" DEVANAGARI LETTER AU
+                    // U+094C: "ौ" DEVANAGARI VOWEL SIGN AU
+                    // U+0967: "१" DEVANAGARI DIGIT ONE
+                    key("\u0914", joinMoreKeys(moreKey(VOWEL_SIGN_AU, "\u094C"), "\u0967", "1")),
+                    // U+0910: "ऐ" DEVANAGARI LETTER AI
+                    // U+0948: "ै" DEVANAGARI VOWEL SIGN AI
+                    // U+0968: "२" DEVANAGARI DIGIT TWO
+                    key("\u0910", joinMoreKeys(moreKey(VOWEL_SIGN_AI, "\u0948"), "\u0968", "2")),
+                    // U+0906: "आ" DEVANAGARI LETTER AA
+                    // U+093E: "ा" DEVANAGARI VOWEL SIGN AA
+                    // U+0969: "३" DEVANAGARI DIGIT THREE
+                    key("\u0906", joinMoreKeys(moreKey(VOWEL_SIGN_AA, "\u093E"), "\u0969", "3")),
+                    // U+0908: "ई" DEVANAGARI LETTER II
+                    // U+0940: "ी" DEVANAGARI VOWEL SIGN II
+                    // U+096A: "४" DEVANAGARI DIGIT FOUR
+                    key("\u0908", joinMoreKeys(moreKey(VOWEL_SIGN_II, "\u0940"), "\u096A", "4")),
+                    // U+090A: "ऊ" DEVANAGARI LETTER UU
+                    // U+0942: "ू" DEVANAGARI VOWEL SIGN UU
+                    // U+096B: "५" DEVANAGARI DIGIT FIVE
+                    key("\u090A", joinMoreKeys(moreKey(VOWEL_SIGN_UU, "\u0942"), "\u096B", "5")),
+                    // U+092C: "ब" DEVANAGARI LETTER BA
+                    // U+092D: "भ" DEVANAGARI LETTER BHA
+                    // U+096C: "६" DEVANAGARI DIGIT SIX
+                    key("\u092C", joinMoreKeys("\u092D", "\u096C", "6")),
+                    // U+0939: "ह" DEVANAGARI LETTER HA
+                    // U+096D: "७" DEVANAGARI DIGIT SEVEN
+                    key("\u0939", joinMoreKeys("\u096D", "7")),
+                    // U+0917: "ग" DEVANAGARI LETTER GA
+                    // U+0918: "घ" DEVANAGARI LETTER GHA
+                    // U+096E: "८" DEVANAGARI DIGIT EIGHT
+                    key("\u0917", joinMoreKeys("\u0918", "\u096E", "8")),
+                    // U+0926: "द" DEVANAGARI LETTER DA
+                    // U+0927: "ध" DEVANAGARI LETTER DHA
+                    // U+096F: "९" DEVANAGARI DIGIT NINE
+                    key("\u0926", joinMoreKeys("\u0927", "\u096F", "9")),
+                    // U+091C: "ज" DEVANAGARI LETTER JA
+                    // U+091D: "झ" DEVANAGARI LETTER JHA
+                    // U+091C/U+094D/U+091E:
+                    //     "ज्ञ" DEVANAGARI LETTER JA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER NYA
+                    // U+0966: "०" DEVANAGARI DIGIT ZERO
+                    key("\u091C", joinMoreKeys("\u091D", "\u091C\u094D\u091E", "\u0966", "0")),
+                    // U+0921: "ड" DEVANAGARI LETTER DDA
+                    // U+0922: "ढ" DEVANAGARI LETTER DDHA
+                    key("\u0921", moreKey("\u0922")))
+            .setKeysOfRow(2,
+                    // U+0913: "ओ" DEVANAGARI LETTER O
+                    // U+094B: "ो" DEVANAGARI VOWEL SIGN O
+                    key("\u0913", moreKey(VOWEL_SIGN_O, "\u094B")),
+                    // U+090F: "ए" DEVANAGARI LETTER E
+                    // U+0947: "े" DEVANAGARI VOWEL SIGN E
+                    key("\u090F", moreKey(VOWEL_SIGN_E, "\u0947")),
+                    // U+0905: "अ" DEVANAGARI LETTER A
+                    // U+094D: "्" DEVANAGARI SIGN VIRAMA
+                    key("\u0905", moreKey(SIGN_VIRAMA, "\u094D")),
+                    // U+0907: "इ" DEVANAGARI LETTER I
+                    // U+093F: "ि" DEVANAGARI VOWEL SIGN I
+                    key("\u0907", moreKey(VOWEL_SIGN_I, "\u093F")),
+                    // U+0909: "उ" DEVANAGARI LETTER U
+                    // U+0941: "ु" DEVANAGARI VOWEL SIGN U
+                    key("\u0909", moreKey(VOWEL_SIGN_U, "\u0941")),
+                    // U+092A: "प" DEVANAGARI LETTER PA
+                    // U+092B: "फ" DEVANAGARI LETTER PHA
+                    key("\u092A", moreKey("\u092B")),
+                    // U+0930: "र" DEVANAGARI LETTER RA
+                    // U+090B: "ऋ" DEVANAGARI LETTER VOCALIC R
+                    // U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R
+                    key("\u0930", joinMoreKeys("\u090B", moreKey(VOWEL_SIGN_VOCALIC_R, "\u0943"))),
+                    // U+0915: "क" DEVANAGARI LETTER KA
+                    // U+0916: "ख" DEVANAGARI LETTER KHA
+                    key("\u0915", moreKey("\u0916")),
+                    // U+0924: "त" DEVANAGARI LETTER TA
+                    // U+0925: "थ" DEVANAGARI LETTER THA
+                    // U+0924/U+094D/U+0930:
+                    //     "त्र" DEVANAGARI LETTER TA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA
+                    key("\u0924", joinMoreKeys("\u0925", "\u0924\u094D\u0930")),
+                    // U+091A: "च" DEVANAGARI LETTER CA
+                    // U+091B: "छ" DEVANAGARI LETTER CHA
+                    key("\u091A", moreKey("\u091B")),
+                    // U+091F: "ट" DEVANAGARI LETTER TTA
+                    // U+0920: "ठ" DEVANAGARI LETTER TTHA
+                    key("\u091F", moreKey("\u0920")))
+            .setKeysOfRow(3,
+                    // U+0911: "ऑ" DEVANAGARI LETTER CANDRA O
+                    // U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
+                    key("\u0911", moreKey(VOWEL_SIGN_CANDRA_O, "\u0949")),
+                    // U+090D: "ऍ" DEVANAGARI LETTER CANDRA E
+                    // U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E
+                    key("\u090D", moreKey(VOWEL_SIGN_CANDRA_E, "\u0945")),
+                    // U+0902: "ं" DEVANAGARI SIGN ANUSVARA
+                    // U+0903: "ः‍" DEVANAGARI SIGN VISARGA
+                    // U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
+                    // U+093C: "़" DEVANAGARI SIGN NUKTA
+                    key(SIGN_ANUSVARA, "\u0902", joinMoreKeys(
+                            moreKey(SIGN_VISARGA, "\u0903"),
+                            moreKey(SIGN_CANDRABINDU, "\u0901"),
+                            moreKey(SIGN_NUKTA, "\u093C"))),
+                    // U+092E: "म" DEVANAGARI LETTER MA
+                    // U+0950: "ॐ" DEVANAGARI OM
+                    key("\u092E", moreKey("\u0950")),
+                    // U+0928: "न" DEVANAGARI LETTER NA
+                    // U+0923: "ण" DEVANAGARI LETTER NNA
+                    // U+091E: "ञ" DEVANAGARI LETTER NYA
+                    // U+0919: "ङ" DEVANAGARI LETTER NGA
+                    key("\u0928", joinMoreKeys("\u0923", "\u091E", "\u0919")),
+                    // U+0935: "व" DEVANAGARI LETTER VA
+                    // U+0932: "ल" DEVANAGARI LETTER LA
+                    "\u0935", "\u0932",
+                    // U+0938: "स" DEVANAGARI LETTER SA
+                    // U+0936: "श" DEVANAGARI LETTER SHA
+                    // U+0937: "ष" DEVANAGARI LETTER SSA
+                    // U+0936/U+094D/U+0930:
+                    //     "श्र" DEVANAGARI LETTER SHA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER RA
+                    key("\u0938", joinMoreKeys("\u0936", "\u0937", "\u0936\u094D\u0930")),
+                    // U+092F: "य" DEVANAGARI LETTER YA
+                    // U+0915/U+094D/U+0937:
+                    //     "क्ष" DEVANAGARI LETTER KA/DEVANAGARI SIGN VIRAMA/DEVANAGARI LETTER SSA
+                    "\u092F", "\u0915\u094D\u0937")
+            .build();
+}
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java b/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java
index 09cc8f9..4123a22 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java
@@ -180,8 +180,7 @@
          * @return the array of {@link ExpectedKey} that are "more keys" of the punctuation key.
          */
         public ExpectedKey[] getPunctuationMoreKeys(final boolean isPhone) {
-            return isPhone ? PHONE_PUNCTUATION_MORE_KEYS
-                    : TABLET_PUNCTUATION_MORE_KEYS;
+            return isPhone ? PHONE_PUNCTUATION_MORE_KEYS : TABLET_PUNCTUATION_MORE_KEYS;
         }
     }
 
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsHindiCompact.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsHindiCompact.java
new file mode 100644
index 0000000..2e676df
--- /dev/null
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsHindiCompact.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package com.android.inputmethod.keyboard.layout.tests;
+
+import android.test.suitebuilder.annotation.SmallTest;
+
+import com.android.inputmethod.keyboard.layout.HindiCompact;
+import com.android.inputmethod.keyboard.layout.HindiCompact.HindiCompactCustomizer;
+import com.android.inputmethod.keyboard.layout.LayoutBase;
+
+import java.util.Locale;
+
+/**
+ * hi: Hindi/hindi_compact
+ */
+@SmallTest
+public final class TestsHindiCompact extends LayoutTestsBase {
+    private static final Locale LOCALE = new Locale("hi");
+    private static final LayoutBase LAYOUT = new HindiCompact(new HindiCompactCustomizer(LOCALE));
+
+    @Override
+    LayoutBase getLayout() { return LAYOUT; }
+}