Add Telugu keyboard

Bug: 10028759
Change-Id: Id1bf030a9928124ead695aa7bf76db48ca58de4b
diff --git a/java/res/xml/kbd_telugu.xml b/java/res/xml/kbd_telugu.xml
new file mode 100644
index 0000000..b4fc337
--- /dev/null
+++ b/java/res/xml/kbd_telugu.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_telugu" />
+</Keyboard>
diff --git a/java/res/xml/key_space_5kw.xml b/java/res/xml/key_space_5kw.xml
index 1b62eab..b1fe0bb 100644
--- a/java/res/xml/key_space_5kw.xml
+++ b/java/res/xml/key_space_5kw.xml
@@ -24,9 +24,10 @@
     <switch>
         <!-- fa: Perisan
              kn: Kannada
-             ne: Nepali -->
+             ne: Nepali
+             te: Telugu -->
         <case
-            latin:languageCode="fa|kn|ne"
+            latin:languageCode="fa|kn|ne|te"
             latin:languageSwitchKeyEnabled="true"
         >
             <Key
@@ -38,7 +39,7 @@
                 latin:keyStyle="zwnjKeyStyle" />
         </case>
         <case
-            latin:languageCode="fa|kn|ne"
+            latin:languageCode="fa|kn|ne|te"
             latin:languageSwitchKeyEnabled="false"
         >
             <Key
diff --git a/java/res/xml/keyboard_layout_set_telugu.xml b/java/res/xml/keyboard_layout_set_telugu.xml
new file mode 100644
index 0000000..aca47b9
--- /dev/null
+++ b/java/res/xml/keyboard_layout_set_telugu.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_telugu"
+        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/method.xml b/java/res/xml/method.xml
index 2a03f20..5021f33 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -91,7 +91,8 @@
     (sr-Latn: Serbian/qwerty) # not yet implemented.
     sv: Swedish/nordic
     sw: Swahili/qwerty
-    (ta: Tamil/tamil) # This is a preliminary keyboard layout.
+    (ta_IN: Tamil (India)/tamil) # This is a preliminary keyboard layout.
+    (te_IN: Telugu (India)/telugu) # This is a preliminary keyboard layout.
     th: Thai/thai
     tl: Tagalog/spanish
     tr: Turkish/qwerty
@@ -699,6 +700,16 @@
             android:imeSubtypeExtraValue="KeyboardLayoutSet=tamil,EmojiCapable"
             android:isAsciiCapable="false"
     />
+    <!-- TODO: This telugu keyboard is a preliminary layout.
+               This isn't based on the final specification. -->
+    <subtype android:icon="@drawable/ic_ime_switcher_dark"
+            android:label="@string/subtype_generic"
+            android:subtypeId="0x1e177389"
+            android:imeSubtypeLocale="te_IN"
+            android:imeSubtypeMode="keyboard"
+            android:imeSubtypeExtraValue="KeyboardLayoutSet=telugu,EmojiCapable"
+            android:isAsciiCapable="false"
+    />
     <subtype android:icon="@drawable/ic_ime_switcher_dark"
             android:label="@string/subtype_generic"
             android:subtypeId="0x1f94d5d4"
diff --git a/java/res/xml/rowkeys_telugu1.xml b/java/res/xml/rowkeys_telugu1.xml
new file mode 100644
index 0000000..8a5c850
--- /dev/null
+++ b/java/res/xml/rowkeys_telugu1.xml
@@ -0,0 +1,97 @@
+<?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">
+    <!-- U+0C4C: "ౌ" TELUGU VOWEL SIGN AU
+         U+0C14: "ఔ" TELUGU LETTER AU -->
+    <Key
+        latin:keySpec="&#x0C4C;"
+        latin:moreKeys="&#x0C14;,%"
+        latin:keyHintLabel="1"
+        latin:additionalMoreKeys="1" />
+    <!-- U+0C48: "ై" TELUGU VOWEL SIGN AI
+         U+0C10: "ఐ" TELUGU LETTER AI -->
+    <Key
+        latin:keySpec="&#x0C48;"
+        latin:moreKeys="&#x0C10;,%"
+        latin:keyHintLabel="2"
+        latin:additionalMoreKeys="2" />
+    <!-- U+0C3E: "ా" TELUGU VOWEL SIGN AA
+         U+0C06: "ఆ" TELUGU LETTER AA -->
+    <Key
+        latin:keySpec="&#x0C3E;"
+        latin:moreKeys="&#x0C06;,%"
+        latin:keyHintLabel="3"
+        latin:additionalMoreKeys="3" />
+    <!-- U+0C40: "ీ" TELUGU VOWEL SIGN II
+         U+0C08: "ఈ" TELUGU LETTER II -->
+    <Key
+        latin:keySpec="&#x0C40;"
+        latin:moreKeys="&#x0C08;,%"
+        latin:keyHintLabel="4"
+        latin:additionalMoreKeys="4" />
+    <!-- U+0C42: "ూ" TELUGU VOWEL SIGN UU
+         U+0C0A: "ఊ" TELUGU LETTER UU -->
+    <Key
+        latin:keySpec="&#x0C42;"
+        latin:moreKeys="&#x0C0A;,%"
+        latin:keyHintLabel="5"
+        latin:additionalMoreKeys="5" />
+    <!-- U+0C2C: "బ" TELUGU LETTER BA
+         U+0C2D: "భ" TELUGU LETTER BHA -->
+    <Key
+        latin:keySpec="&#x0C2C;"
+        latin:moreKeys="&#x0C2D;,%"
+        latin:keyHintLabel="6"
+        latin:additionalMoreKeys="6" />
+    <!-- U+0C39: "హ" TELUGU LETTER HA
+         U+0C03: "ః" TELUGU SIGN VISARGA -->
+    <Key
+        latin:keySpec="&#x0C39;"
+        latin:moreKeys="&#x0C03;,%"
+        latin:keyHintLabel="7"
+        latin:additionalMoreKeys="7" />
+    <!-- U+0C17: "గ" TELUGU LETTER GA
+         U+0C18: "ఘ" TELUGU LETTER GHA -->
+    <Key
+        latin:keySpec="&#x0C17;"
+        latin:moreKeys="&#x0C18;,%"
+        latin:keyHintLabel="8"
+        latin:additionalMoreKeys="8" />
+    <!-- U+0C26: "ద" TELUGU LETTER DA
+         U+0C27: "ధ" TELUGU LETTER DHA -->
+    <Key
+        latin:keySpec="&#x0C26;"
+        latin:moreKeys="&#x0C27;,%"
+        latin:keyHintLabel="9"
+        latin:additionalMoreKeys="9" />
+    <!-- U+0C1C: "జ" TELUGU LETTER JA
+         U+0C1D: "ఝ" TELUGU LETTER JHA -->
+    <Key
+        latin:keySpec="&#x0C1C;"
+        latin:moreKeys="&#x0C1D;,%"
+        latin:keyHintLabel="0"
+        latin:additionalMoreKeys="0" />
+    <!-- U+0C21: "డ" TELUGU LETTER DDA
+         U+0C22: "ఢ" TELUGU LETTER DDHA -->
+    <Key
+        latin:keySpec="&#x0C21;"
+        latin:moreKeys="&#x0C22;" />
+</merge>
diff --git a/java/res/xml/rowkeys_telugu2.xml b/java/res/xml/rowkeys_telugu2.xml
new file mode 100644
index 0000000..a472fd3
--- /dev/null
+++ b/java/res/xml/rowkeys_telugu2.xml
@@ -0,0 +1,78 @@
+<?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">
+    <!-- U+0C4B: "ో" TELUGU VOWEL SIGN OO
+         U+0C13: "ఓ" TELUGU LETTER OO -->
+    <Key
+        latin:keySpec="&#x0C4B;"
+        latin:moreKeys="&#x0C13;" />
+    <!-- U+0C47: "ే" TELUGU VOWEL SIGN EE
+         U+0C0F: "ఏ" TELUGU LETTER EE -->
+    <Key
+        latin:keySpec="&#x0C47;"
+        latin:moreKeys="&#x0C0F;" />
+    <!-- U+0C4D: "్" TELUGU SIGN VIRAMA
+         U+0C05: "అ" TELUGU LETTER A -->
+    <Key
+        latin:keySpec="&#x0C4D;"
+        latin:moreKeys="&#x0C05;" />
+    <!-- U+0C3F: "ి" TELUGU VOWEL SIGN I
+         U+0C07: "ఇ" TELUGU LETTER I -->
+    <Key
+        latin:keySpec="&#x0C3F;"
+        latin:moreKeys="&#x0C07;" />
+    <!-- U+0C41: "ు" TELUGU VOWEL SIGN U
+         U+0C09: "ఉ" TELUGU LETTER U -->
+    <Key
+        latin:keySpec="&#x0C41;"
+        latin:moreKeys="&#x0C09;" />
+    <!-- U+0C2A: "ప" TELUGU LETTER PA
+         U+0C2B: "ఫ" TELUGU LETTER PHA -->
+    <Key
+        latin:keySpec="&#x0C2A;"
+        latin:moreKeys="&#x0C2B;" />
+    <!-- U+0C30: "ర" TELUGU LETTER RA
+         U+0C31: "ఱ" TELUGU LETTER RRA
+         U+0C43: "ృ" TELUGU VOWEL SIGN VOCALIC R -->
+    <Key
+        latin:keySpec="&#x0C30;"
+        latin:moreKeys="&#x0C31;,&#x0C43;" />
+    <!-- U+0C15: "క" TELUGU LETTER KA
+         U+0C16: "ఖ" TELUGU LETTER KHA -->
+    <Key
+        latin:keySpec="&#x0C15;"
+        latin:moreKeys="&#x0C16;" />
+    <!-- U+0C24: "త" TELUGU LETTER TA
+         U+0C25: "థ" TELUGU LETTER THA -->
+    <Key
+        latin:keySpec="&#x0C24;"
+        latin:moreKeys="&#x0C25;" />
+    <!-- U+0C1A: "చ" TELUGU LETTER CA
+         U+0C1B: "ఛ" TELUGU LETTER CHA -->
+    <Key
+        latin:keySpec="&#x0C1A;"
+        latin:moreKeys="&#x0C1B;" />
+    <!-- U+0C1F: "ట" TELUGU LETTER TTA
+         U+0C20: "ఠ" TELUGU LETTER TTHA -->
+    <Key
+        latin:keySpec="&#x0C1F;"
+        latin:moreKeys="&#x0C20;" />
+</merge>
diff --git a/java/res/xml/rowkeys_telugu3.xml b/java/res/xml/rowkeys_telugu3.xml
new file mode 100644
index 0000000..05755ec
--- /dev/null
+++ b/java/res/xml/rowkeys_telugu3.xml
@@ -0,0 +1,67 @@
+<?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">
+    <!-- U+0C46: "ె" TELUGU VOWEL SIGN E
+         U+0C12: "ఒ" TELUGU LETTER O -->
+    <Key
+        latin:keySpec="&#x0C46;"
+        latin:moreKeys="&#x0C12;" />
+    <!-- U+0C02: "ం" TELUGU SIGN ANUSVARA
+         U+0C0E: "ఎ" TELUGU LETTER E -->
+    <Key
+        latin:keySpec="&#x0C02;"
+        latin:moreKeys="&#x0C0E;" />
+    <!-- U+0C2E: "మ" TELUGU LETTER MA -->
+    <Key latin:keySpec="&#x0C2E;" />
+    <!-- U+0C28: "న" TELUGU LETTER NA
+         U+0C23: "ణ" TELUGU LETTER NNA
+         U+0C19: "ఙ" TELUGU LETTER NGA -->
+    <Key
+        latin:keySpec="&#x0C28;"
+        latin:moreKeys="&#x0C23;,&#x0C19;" />
+    <!-- U+0C35: "వ" TELUGU LETTER VA -->
+    <Key latin:keySpec="&#x0C35;" />
+    <!-- U+0C32: "ల" TELUGU LETTER LA
+         U+0C33: "ళ" TELUGU LETTER LLA -->
+    <Key
+        latin:keySpec="&#x0C32;"
+        latin:moreKeys="&#x0C33;" />
+    <!-- U+0C38: "స" TELUGU LETTER SA
+         U+0C36: "శ" TELUGU LETTER SHA -->
+    <Key
+        latin:keySpec="&#x0C38;"
+        latin:moreKeys="&#x0C36;" />
+    <!-- U+0C0B: "ఋ" TELUGU LETTER VOCALIC R
+         U+0C4D/U+0C30: "్ర" TELUGU SIGN VIRAMA/TELUGU LETTER RA -->
+    <Key
+        latin:keySpec="&#x0C0B;"
+        latin:moreKeys="&#x0C4D;&#x0C30;" />
+    <!-- U+0C37: "ష" TELUGU LETTER SSA
+         U+0C15/U+0C4D/U+0C37: "క్ష" TELUGU LETTER KA/TELUGU SIGN VIRAMA/TELUGU LETTER SSA -->
+    <Key
+        latin:keySpec="&#x0C37;"
+        latin:moreKeys="&#x0C15;&#x0C4D;&#x0C37;" />
+    <!-- U+0C2F: "య" TELUGU LETTER YA
+         U+0C1C/U+0C4D/U+0C1E: "జ్ఞ" TELUGU LETTER JA/TELUGU SIGN VIRAMA/TELUGU LETTER NYA -->
+    <Key
+        latin:keySpec="&#x0C2F;"
+        latin:moreKeys="&#x0C1C;&#x0C4D;&#x0C1E;" />
+</merge>
diff --git a/java/res/xml/rows_telugu.xml b/java/res/xml/rows_telugu.xml
new file mode 100644
index 0000000..4a31d5d
--- /dev/null
+++ b/java/res/xml/rows_telugu.xml
@@ -0,0 +1,45 @@
+<?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"
+        latin:keyLabelFlags="fontNormal|autoXScale"
+    >
+        <include latin:keyboardLayout="@xml/rowkeys_telugu1" />
+    </Row>
+    <Row
+        latin:keyWidth="9.091%p"
+        latin:keyLabelFlags="fontNormal|autoXScale"
+    >
+        <include latin:keyboardLayout="@xml/rowkeys_telugu2" />
+    </Row>
+    <Row
+        latin:keyWidth="9.091%p"
+        latin:keyLabelFlags="fontNormal|autoXScale"
+    >
+        <include latin:keyboardLayout="@xml/rowkeys_telugu3" />
+        <Key
+            latin:keyStyle="deleteKeyStyle"
+            latin:keyWidth="fillRight" />
+    </Row>
+    <include latin:keyboardLayout="@xml/row_qwerty4" />
+</merge>
\ No newline at end of file