diff options
-rw-r--r-- | java/res/xml-bg/keyboard_set.xml | 42 | ||||
-rw-r--r-- | java/res/xml-sw600dp/kbd_rows_bulgarian.xml | 138 | ||||
-rw-r--r-- | java/res/xml-sw768dp/kbd_rows_bulgarian.xml | 122 | ||||
-rw-r--r-- | java/res/xml/kbd_bulgarian.xml | 26 | ||||
-rw-r--r-- | java/res/xml/kbd_rows_bulgarian.xml | 128 | ||||
-rw-r--r-- | java/res/xml/method.xml | 10 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParser.java | 47 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 6 | ||||
-rw-r--r-- | tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParserTests.java | 78 |
9 files changed, 533 insertions, 64 deletions
diff --git a/java/res/xml-bg/keyboard_set.xml b/java/res/xml-bg/keyboard_set.xml new file mode 100644 index 000000000..a789de630 --- /dev/null +++ b/java/res/xml-bg/keyboard_set.xml @@ -0,0 +1,42 @@ +<?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:keyboardLocale="bg"> + <Element + latin:elementName="alphabet" + latin:elementKeyboard="@xml/kbd_bulgarian" /> + <Element + latin:elementName="symbols" + latin:elementKeyboard="@xml/kbd_symbols" /> + <Element + latin:elementName="symbolsShift" + latin:elementKeyboard="@xml/kbd_symbols_shift" /> + <Element + latin:elementName="phone" + latin:elementKeyboard="@xml/kbd_phone" /> + <Element + latin:elementName="phoneShift" + latin:elementKeyboard="@xml/kbd_phone_shift" /> + <Element + latin:elementName="number" + latin:elementKeyboard="@xml/kbd_number" /> +</KeyboardSet> diff --git a/java/res/xml-sw600dp/kbd_rows_bulgarian.xml b/java/res/xml-sw600dp/kbd_rows_bulgarian.xml new file mode 100644 index 000000000..746398d49 --- /dev/null +++ b/java/res/xml-sw600dp/kbd_rows_bulgarian.xml @@ -0,0 +1,138 @@ +<?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. +*/ +--> + +<merge + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <include + latin:keyboardLayout="@xml/kbd_key_styles" /> + <Row + latin:keyWidth="7.692%p" + > + <Key + latin:keyLabel="ч" /> + <Key + latin:keyLabel="ш" /> + <Key + latin:keyLabel="е" /> + <Key + latin:keyLabel="р" /> + <Key + latin:keyLabel="т" /> + <Key + latin:keyLabel="ъ" /> + <Key + latin:keyLabel="у" /> + <Key + latin:keyLabel="и" + latin:moreKeys="ѝ" /> + <Key + latin:keyLabel="о" /> + <Key + latin:keyLabel="п" /> + <Key + latin:keyLabel="я" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.692%p" + > + <Key + latin:keyLabel="а" + latin:keyXPos="4.000%p" /> + <Key + latin:keyLabel="с" /> + <Key + latin:keyLabel="д" /> + <Key + latin:keyLabel="ф" /> + <Key + latin:keyLabel="г" /> + <Key + latin:keyLabel="х" /> + <Key + latin:keyLabel="й" /> + <Key + latin:keyLabel="к" /> + <Key + latin:keyLabel="л" /> + <Key + latin:keyLabel="щ" /> + <Key + latin:keyLabel="ь" /> + <Key + latin:keyStyle="returnKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.692%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="10.000%p" /> + <Key + latin:keyLabel="з" /> + <Key + latin:keyLabel="ж" /> + <Key + latin:keyLabel="ц" /> + <Key + latin:keyLabel="в" /> + <Key + latin:keyLabel="б" /> + <Key + latin:keyLabel="н" /> + <Key + latin:keyLabel="м" /> + <Key + latin:keyLabel="ю" /> + <switch> + <case + latin:mode="email" + > + <Key + latin:keyLabel="," /> + <Key + latin:keyLabel="." /> + </case> + <default> + <Key + latin:keyLabel="," + latin:keyLabelFlags="hasUppercaseLetter" + latin:keyHintLabel="!" + latin:moreKeys="!" /> + <Key + latin:keyLabel="." + latin:keyLabelFlags="hasUppercaseLetter" + latin:keyHintLabel="\?" + latin:moreKeys="\?" /> + </default> + </switch> + <Spacer + latin:keyXPos="-10.000%p" + latin:keyWidth="0%p" /> + <include + latin:keyboardLayout="@xml/kbd_row3_smiley" /> + </Row> + <include + latin:keyboardLayout="@xml/kbd_qwerty_row4" /> +</merge> diff --git a/java/res/xml-sw768dp/kbd_rows_bulgarian.xml b/java/res/xml-sw768dp/kbd_rows_bulgarian.xml new file mode 100644 index 000000000..42b3da525 --- /dev/null +++ b/java/res/xml-sw768dp/kbd_rows_bulgarian.xml @@ -0,0 +1,122 @@ +<?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. +*/ +--> + +<merge + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <include + latin:keyboardLayout="@xml/kbd_key_styles" /> + <Row + latin:keyWidth="7.333%p" + > + <Key + latin:keyStyle="tabKeyStyle" + latin:keyLabelFlags="alignLeft" /> + <Key + latin:keyLabel="ч" /> + <Key + latin:keyLabel="ш" /> + <Key + latin:keyLabel="е" /> + <Key + latin:keyLabel="р" /> + <Key + latin:keyLabel="т" /> + <Key + latin:keyLabel="ъ" /> + <Key + latin:keyLabel="у" /> + <Key + latin:keyLabel="и" + latin:moreKeys="ѝ" /> + <Key + latin:keyLabel="о" /> + <Key + latin:keyLabel="п" /> + <Key + latin:keyLabel="я" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.194%p" + > + <Key + latin:keyStyle="toSymbolKeyStyle" + latin:keyLabelFlags="alignLeft" + latin:keyWidth="9.375%p" /> + <Key + latin:keyLabel="а" /> + <Key + latin:keyLabel="с" /> + <Key + latin:keyLabel="д" /> + <Key + latin:keyLabel="ф" /> + <Key + latin:keyLabel="г" /> + <Key + latin:keyLabel="х" /> + <Key + latin:keyLabel="й" /> + <Key + latin:keyLabel="к" /> + <Key + latin:keyLabel="л" /> + <Key + latin:keyLabel="щ" /> + <Key + latin:keyLabel="ь" /> + <Key + latin:keyStyle="returnKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <Row + latin:keyWidth="7.125%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="14.375%p" /> + <Key + latin:keyLabel="з" /> + <Key + latin:keyLabel="ж" /> + <Key + latin:keyLabel="ц" /> + <Key + latin:keyLabel="в" /> + <Key + latin:keyLabel="б" /> + <Key + latin:keyLabel="н" /> + <Key + latin:keyLabel="м" /> + <Key + latin:keyLabel="ю" /> + <include + latin:keyboardLayout="@xml/kbd_row3_comma_period" /> + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="fillBoth" /> + </Row> + <include + latin:keyboardLayout="@xml/kbd_qwerty_row4" /> +</merge> diff --git a/java/res/xml/kbd_bulgarian.xml b/java/res/xml/kbd_bulgarian.xml new file mode 100644 index 000000000..f11438322 --- /dev/null +++ b/java/res/xml/kbd_bulgarian.xml @@ -0,0 +1,26 @@ +<?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. +*/ +--> + +<Keyboard + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <include + latin:keyboardLayout="@xml/kbd_rows_bulgarian" /> +</Keyboard> diff --git a/java/res/xml/kbd_rows_bulgarian.xml b/java/res/xml/kbd_rows_bulgarian.xml new file mode 100644 index 000000000..7b18361a9 --- /dev/null +++ b/java/res/xml/kbd_rows_bulgarian.xml @@ -0,0 +1,128 @@ +<?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. +*/ +--> + +<merge + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <include + latin:keyboardLayout="@xml/kbd_key_styles" /> + <Row + latin:keyWidth="9.091%p" + > + <Key + latin:keyLabel="ч" + latin:keyHintLabel="1" + latin:moreKeys="1" /> + <Key + latin:keyLabel="ш" + latin:keyHintLabel="2" + latin:moreKeys="2" /> + <Key + latin:keyLabel="е" + latin:keyHintLabel="3" + latin:moreKeys="3" /> + <Key + latin:keyLabel="р" + latin:keyHintLabel="4" + latin:moreKeys="4" /> + <Key + latin:keyLabel="т" + latin:keyHintLabel="5" + latin:moreKeys="5" /> + <Key + latin:keyLabel="ъ" + latin:keyHintLabel="6" + latin:moreKeys="6" /> + <Key + latin:keyLabel="у" + latin:keyHintLabel="7" + latin:moreKeys="7" /> + <Key + latin:keyLabel="и" + latin:keyHintLabel="8" + latin:moreKeys="8,ѝ" /> + <Key + latin:keyLabel="о" + latin:keyHintLabel="9" + latin:moreKeys="9" /> + <Key + latin:keyLabel="п" + latin:keyHintLabel="0" + latin:moreKeys="0" /> + <Key + latin:keyLabel="я" + latin:keyWidth="fillRight" /> + </Row> + <Row + latin:keyWidth="9.091%p" + > + <Key + latin:keyLabel="а" /> + <Key + latin:keyLabel="с" /> + <Key + latin:keyLabel="д" /> + <Key + latin:keyLabel="ф" /> + <Key + latin:keyLabel="г" /> + <Key + latin:keyLabel="х" /> + <Key + latin:keyLabel="й" /> + <Key + latin:keyLabel="к" /> + <Key + latin:keyLabel="л" /> + <Key + latin:keyLabel="щ" /> + <Key + latin:keyLabel="ь" + latin:keyWidth="fillRight" /> + </Row> + <Row + latin:keyWidth="9.091%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="13.636%p" /> + <Key + latin:keyLabel="з" /> + <Key + latin:keyLabel="ж" /> + <Key + latin:keyLabel="ц" /> + <Key + latin:keyLabel="в" /> + <Key + latin:keyLabel="б" /> + <Key + latin:keyLabel="н" /> + <Key + latin:keyLabel="м" /> + <Key + latin:keyLabel="ю" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="fillRight" /> + </Row> + <include + latin:keyboardLayout="@xml/kbd_qwerty_row4" /> +</merge> diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index 6c827363c..650f91b9b 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -20,8 +20,8 @@ <!-- The attributes in this XML file provide configuration information --> <!-- for the Input Method Manager. --> -<!-- Keyboard: en_US, en_GB, ar, be, cs, da, de, de(QWERTY), es, es_US, et, fi, fr, fr_CA, fr_CH, - hr, hu, it, iw, ky, lt, lv, nb, nl, pl, pt, ro, ru, sk, sl, sr, sv, tr, uk, vi --> +<!-- Keyboard: en_US, en_GB, ar, be, bg, cs, da, de, de(QWERTY), es, es_US, et, fi, fr, fr_CA, + fr_CH, hr, hu, it, iw, ky, lt, lv, nb, nl, pl, pt, ro, ru, sk, sl, sr, sv, tr, uk, vi --> <!-- 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 subtype.--> @@ -54,6 +54,12 @@ /> <subtype android:icon="@drawable/ic_subtype_keyboard" android:label="@string/subtype_generic" + android:imeSubtypeLocale="bg" + android:imeSubtypeMode="keyboard" + android:imeSubtypeExtraValue="SupportTouchPositionCorrection" + /> + <subtype android:icon="@drawable/ic_subtype_keyboard" + android:label="@string/subtype_generic" android:imeSubtypeLocale="cs" android:imeSubtypeMode="keyboard" android:imeSubtypeExtraValue="AsciiCapable,SupportTouchPositionCorrection" diff --git a/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParser.java b/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParser.java index 93be31ed9..c7d226d6e 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParser.java +++ b/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParser.java @@ -53,8 +53,9 @@ public class MoreKeySpecParser { private static boolean hasIcon(String moreKeySpec) { if (moreKeySpec.startsWith(PREFIX_ICON)) { final int end = indexOfLabelEnd(moreKeySpec, 0); - if (end > 0) + if (end > 0) { return true; + } throw new MoreKeySpecParserError("outputText or code not specified: " + moreKeySpec); } return false; @@ -70,8 +71,9 @@ public class MoreKeySpecParser { } private static String parseEscape(String text) { - if (text.indexOf(ESCAPE) < 0) + if (text.indexOf(ESCAPE) < 0) { return text; + } final int length = text.length(); final StringBuilder sb = new StringBuilder(); for (int pos = 0; pos < length; pos++) { @@ -88,8 +90,9 @@ public class MoreKeySpecParser { private static int indexOfLabelEnd(String moreKeySpec, int start) { if (moreKeySpec.indexOf(ESCAPE, start) < 0) { final int end = moreKeySpec.indexOf(LABEL_END, start); - if (end == 0) + if (end == 0) { throw new MoreKeySpecParserError(LABEL_END + " at " + start + ": " + moreKeySpec); + } return end; } final int length = moreKeySpec.length(); @@ -105,55 +108,62 @@ public class MoreKeySpecParser { } public static String getLabel(String moreKeySpec) { - if (hasIcon(moreKeySpec)) + if (hasIcon(moreKeySpec)) { return null; + } final int end = indexOfLabelEnd(moreKeySpec, 0); final String label = (end > 0) ? parseEscape(moreKeySpec.substring(0, end)) : parseEscape(moreKeySpec); - if (TextUtils.isEmpty(label)) + if (TextUtils.isEmpty(label)) { throw new MoreKeySpecParserError("Empty label: " + moreKeySpec); + } return label; } public static String getOutputText(String moreKeySpec) { - if (hasCode(moreKeySpec)) + if (hasCode(moreKeySpec)) { return null; + } final int end = indexOfLabelEnd(moreKeySpec, 0); if (end > 0) { - if (indexOfLabelEnd(moreKeySpec, end + 1) >= 0) + if (indexOfLabelEnd(moreKeySpec, end + 1) >= 0) { throw new MoreKeySpecParserError("Multiple " + LABEL_END + ": " + moreKeySpec); + } final String outputText = parseEscape(moreKeySpec.substring(end + LABEL_END.length())); - if (!TextUtils.isEmpty(outputText)) + if (!TextUtils.isEmpty(outputText)) { return outputText; + } throw new MoreKeySpecParserError("Empty outputText: " + moreKeySpec); } final String label = getLabel(moreKeySpec); - if (label == null) + if (label == null) { throw new MoreKeySpecParserError("Empty label: " + moreKeySpec); + } // Code is automatically generated for one letter label. See {@link getCode()}. - if (label.length() == 1) - return null; - return label; + return (label.length() == 1) ? null : label; } public static int getCode(Resources res, String moreKeySpec) { if (hasCode(moreKeySpec)) { final int end = indexOfLabelEnd(moreKeySpec, 0); - if (indexOfLabelEnd(moreKeySpec, end + 1) >= 0) + if (indexOfLabelEnd(moreKeySpec, end + 1) >= 0) { throw new MoreKeySpecParserError("Multiple " + LABEL_END + ": " + moreKeySpec); + } final int resId = getResourceId(res, moreKeySpec.substring(end + LABEL_END.length() + PREFIX_AT.length())); final int code = res.getInteger(resId); return code; } - if (indexOfLabelEnd(moreKeySpec, 0) > 0) - return Keyboard.CODE_UNSPECIFIED; + if (indexOfLabelEnd(moreKeySpec, 0) > 0) { + return Keyboard.CODE_OUTPUT_TEXT; + } final String label = getLabel(moreKeySpec); // Code is automatically generated for one letter label. - if (label != null && label.length() == 1) + if (label != null && label.length() == 1) { return label.charAt(0); - return Keyboard.CODE_UNSPECIFIED; + } + return Keyboard.CODE_OUTPUT_TEXT; } public static int getIconId(String moreKeySpec) { @@ -173,8 +183,9 @@ public class MoreKeySpecParser { private static int getResourceId(Resources res, String name) { String packageName = res.getResourcePackageName(R.string.english_ime_name); int resId = res.getIdentifier(name, null, packageName); - if (resId == 0) + if (resId == 0) { throw new MoreKeySpecParserError("Unknown resource: " + name); + } return resId; } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 883dadad6..d36140de6 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1924,8 +1924,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // Updating the predictions right away may be slow and feel unresponsive on slower // terminals. On the other hand if we just postUpdateBigramPredictions() it will // take a noticeable delay to update them which may feel uneasy. - } - if (showingAddToDictionaryHint) { + } else { if (mIsUserDictionaryAvailable) { mSuggestionsView.showAddToDictionaryHint( suggestion, mSettingsValues.mHintToSaveText); @@ -1942,9 +1941,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar * Commits the chosen word to the text field and saves it for later retrieval. */ private void commitChosenWord(final CharSequence bestWord, final int commitType) { - final KeyboardSwitcher switcher = mKeyboardSwitcher; - if (!switcher.isKeyboardAvailable()) - return; final InputConnection ic = getCurrentInputConnection(); if (ic != null) { mVoiceProxy.rememberReplacedWord(bestWord, mSettingsValues.mWordSeparators); diff --git a/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParserTests.java b/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParserTests.java index 0eb324234..edccff33a 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParserTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/MoreKeySpecParserTests.java @@ -89,78 +89,78 @@ public class MoreKeySpecParserTests extends AndroidTestCase { assertParser("Single escaped at", "\\@", "@", null, ICON_UNDEFINED, '@'); assertParser("Single letter with outputText", "a|abc", - "a", "abc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a", "abc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Single letter with escaped outputText", "a|a\\|c", - "a", "a|c", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a", "a|c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Single letter with comma outputText", "a|a,b", - "a", "a,b", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Single letter with escaped comma outputText", "a|a\\,b", - "a", "a,b", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Single letter with outputText starts with at", "a|@bc", - "a", "@bc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Single letter with outputText contains at", "a|a@c", - "a", "a@c", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a", "a@c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Single letter with escaped at outputText", "a|\\@bc", - "a", "@bc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Single escaped escape with outputText", "\\\\|\\\\", - "\\", "\\", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "\\", "\\", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Single escaped bar with outputText", "\\||\\|", - "|", "|", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "|", "|", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Single letter with code", "a|" + CODE_SETTINGS, "a", null, ICON_UNDEFINED, mCodeSettings); } public void testLabel() { assertParser("Simple label", "abc", - "abc", "abc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "abc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with escaped bar", "a\\|c", - "a|c", "a|c", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a|c", "a|c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with escaped escape", "a\\\\c", - "a\\c", "a\\c", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a\\c", "a\\c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with comma", "a,c", - "a,c", "a,c", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a,c", "a,c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with escaped comma", "a\\,c", - "a,c", "a,c", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a,c", "a,c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label starts with at", "@bc", - "@bc", "@bc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "@bc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label contains at", "a@c", - "a@c", "a@c", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a@c", "a@c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with escaped at", "\\@bc", - "@bc", "@bc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "@bc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with escaped letter", "\\abc", - "abc", "abc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "abc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with outputText", "abc|def", - "abc", "def", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with comma and outputText", "a,c|def", - "a,c", "def", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a,c", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Escaped comma label with outputText", "a\\,c|def", - "a,c", "def", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a,c", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Escaped label with outputText", "a\\|c|def", - "a|c", "def", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a|c", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with escaped bar outputText", "abc|d\\|f", - "abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Escaped escape label with outputText", "a\\\\|def", - "a\\", "def", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a\\", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label starts with at and outputText", "@bc|def", - "@bc", "def", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "@bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label contains at label and outputText", "a@c|def", - "a@c", "def", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a@c", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Escaped at label with outputText", "\\@bc|def", - "@bc", "def", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "@bc", "def", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with comma outputText", "abc|a,b", - "abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with escaped comma outputText", "abc|a\\,b", - "abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "a,b", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with outputText starts with at", "abc|@bc", - "abc", "@bc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with outputText contains at", "abc|a@c", - "abc", "a@c", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "a@c", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with escaped at outputText", "abc|\\@bc", - "abc", "@bc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "@bc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with escaped bar outputText", "abc|d\\|f", - "abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "abc", "d|f", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Escaped bar label with escaped bar outputText", "a\\|c|d\\|f", - "a|c", "d|f", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + "a|c", "d|f", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label with code", "abc|" + CODE_SETTINGS, "abc", null, ICON_UNDEFINED, mCodeSettings); assertParser("Escaped label with code", "a\\|c|" + CODE_SETTINGS, @@ -169,13 +169,13 @@ public class MoreKeySpecParserTests extends AndroidTestCase { public void testIconAndCode() { assertParser("Icon with outputText", ICON_SETTINGS + "|abc", - null, "abc", ICON_SETTINGS_KEY, Keyboard.CODE_UNSPECIFIED); + null, "abc", ICON_SETTINGS_KEY, Keyboard.CODE_OUTPUT_TEXT); assertParser("Icon with outputText starts with at", ICON_SETTINGS + "|@bc", - null, "@bc", ICON_SETTINGS_KEY, Keyboard.CODE_UNSPECIFIED); + null, "@bc", ICON_SETTINGS_KEY, Keyboard.CODE_OUTPUT_TEXT); assertParser("Icon with outputText contains at", ICON_SETTINGS + "|a@c", - null, "a@c", ICON_SETTINGS_KEY, Keyboard.CODE_UNSPECIFIED); + null, "a@c", ICON_SETTINGS_KEY, Keyboard.CODE_OUTPUT_TEXT); assertParser("Icon with escaped at outputText", ICON_SETTINGS + "|\\@bc", - null, "@bc", ICON_SETTINGS_KEY, Keyboard.CODE_UNSPECIFIED); + null, "@bc", ICON_SETTINGS_KEY, Keyboard.CODE_OUTPUT_TEXT); assertParser("Label starts with at and code", "@bc|" + CODE_SETTINGS, "@bc", null, ICON_UNDEFINED, mCodeSettings); assertParser("Label contains at and code", "a@c|" + CODE_SETTINGS, @@ -202,7 +202,7 @@ public class MoreKeySpecParserTests extends AndroidTestCase { assertParserError("Icon without code", ICON_SETTINGS, null, null, ICON_SETTINGS_KEY, Keyboard.CODE_UNSPECIFIED); assertParser("Non existing icon", ICON_NON_EXISTING + "|abc", - null, "abc", ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); + null, "abc", ICON_UNDEFINED, Keyboard.CODE_OUTPUT_TEXT); assertParserError("Non existing code", "abc|" + CODE_NON_EXISTING, "abc", null, ICON_UNDEFINED, Keyboard.CODE_UNSPECIFIED); assertParserError("Third bar at end", "a|b|", |