aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dictionaries/en_GB_wordlist.xml6
-rw-r--r--dictionaries/en_US_wordlist.xml6
-rw-r--r--dictionaries/en_wordlist.xml6
-rw-r--r--java/res/raw/main_en.dictbin1069220 -> 1069220 bytes
-rw-r--r--java/res/xml-sw600dp/row_pcqwerty5.xml41
-rw-r--r--java/src/com/android/inputmethod/keyboard/Key.java47
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java43
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java3
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java40
-rw-r--r--tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java19
10 files changed, 116 insertions, 95 deletions
diff --git a/dictionaries/en_GB_wordlist.xml b/dictionaries/en_GB_wordlist.xml
index 79ce93213..4e66d566f 100644
--- a/dictionaries/en_GB_wordlist.xml
+++ b/dictionaries/en_GB_wordlist.xml
@@ -1,4 +1,4 @@
-<wordlist locale="en_GB" description="English (UK)" date="1337670570" version="10">
+<wordlist locale="en_GB" description="English (UK)" date="1338177647" version="12">
<w f="222" flags="">the</w>
<w f="214" flags="">of</w>
<w f="212" flags="">and</w>
@@ -20247,7 +20247,6 @@
<w f="88" flags="">Gregg</w>
<w f="88" flags="">Grimsby</w>
<w f="88" flags="">Guthrie</w>
- <w f="88" flags="abreviation">HDTV</w>
<w f="88" flags="">Haifa</w>
<w f="88" flags="">Haitian</w>
<w f="88" flags="">Harrisburg</w>
@@ -59184,6 +59183,7 @@
<w f="58" flags="">Gudrun</w>
<w f="58" flags="">Guinea's</w>
<w f="58" flags="">Gunderson</w>
+ <w f="58" flags="abreviation">HDTV</w>
<w f="58" flags="">Haiphong</w>
<w f="58" flags="">Hale's</w>
<w f="58" flags="">Hanson's</w>
@@ -65632,7 +65632,6 @@
<w f="54" flags="">Grosz</w>
<w f="54" flags="">Guizot</w>
<w f="54" flags="">Gurney's</w>
- <w f="54" flags="abreviation">HDTVs</w>
<w f="54" flags="abreviation">HMSO</w>
<w f="54" flags="">Hadleigh</w>
<w f="54" flags="">Haig's</w>
@@ -79303,6 +79302,7 @@
<w f="45" flags="">Guofeng</w>
<w f="45" flags="">Gupta's</w>
<w f="45" flags="">Guyer</w>
+ <w f="45" flags="abreviation">HDTVs</w>
<w f="45" flags="">Haggai</w>
<w f="45" flags="">Haifa's</w>
<w f="45" flags="">Hamiltonians</w>
diff --git a/dictionaries/en_US_wordlist.xml b/dictionaries/en_US_wordlist.xml
index 075a104ea..1d1a3015f 100644
--- a/dictionaries/en_US_wordlist.xml
+++ b/dictionaries/en_US_wordlist.xml
@@ -1,4 +1,4 @@
-<wordlist locale="en_US" description="English (US)" date="1337667777" version="10">
+<wordlist locale="en_US" description="English (US)" date="1338177476" version="12">
<w f="222" flags="">the</w>
<w f="214" flags="">of</w>
<w f="212" flags="">and</w>
@@ -21040,7 +21040,6 @@
<w f="88" flags="">Gregg</w>
<w f="88" flags="">Grimsby</w>
<w f="88" flags="">Guthrie</w>
- <w f="88" flags="abreviation">HDTV</w>
<w f="88" flags="">Haifa</w>
<w f="88" flags="">Haitian</w>
<w f="88" flags="">Harrisburg</w>
@@ -61319,6 +61318,7 @@
<w f="58" flags="">Gudrun</w>
<w f="58" flags="">Guinea's</w>
<w f="58" flags="">Gunderson</w>
+ <w f="58" flags="abreviation">HDTV</w>
<w f="58" flags="">Haiphong</w>
<w f="58" flags="">Hale's</w>
<w f="58" flags="">Hanson's</w>
@@ -67979,7 +67979,6 @@
<w f="54" flags="">Grosz</w>
<w f="54" flags="">Guizot</w>
<w f="54" flags="">Gurney's</w>
- <w f="54" flags="abreviation">HDTVs</w>
<w f="54" flags="abreviation">HMSO</w>
<w f="54" flags="">Hadleigh</w>
<w f="54" flags="">Haig's</w>
@@ -82031,6 +82030,7 @@
<w f="45" flags="">Guofeng</w>
<w f="45" flags="">Gupta's</w>
<w f="45" flags="">Guyer</w>
+ <w f="45" flags="abreviation">HDTVs</w>
<w f="45" flags="">Haggai</w>
<w f="45" flags="">Haifa's</w>
<w f="45" flags="">Hamiltonians</w>
diff --git a/dictionaries/en_wordlist.xml b/dictionaries/en_wordlist.xml
index eff5fd25f..3987e96c9 100644
--- a/dictionaries/en_wordlist.xml
+++ b/dictionaries/en_wordlist.xml
@@ -1,4 +1,4 @@
-<wordlist locale="en" description="English" date="1337667811" version="10">
+<wordlist locale="en" description="English" date="1338177651" version="12">
<w f="222" flags="">the</w>
<w f="214" flags="">of</w>
<w f="212" flags="">and</w>
@@ -21254,7 +21254,6 @@
<w f="88" flags="">Gregg</w>
<w f="88" flags="">Grimsby</w>
<w f="88" flags="">Guthrie</w>
- <w f="88" flags="abreviation">HDTV</w>
<w f="88" flags="">Haifa</w>
<w f="88" flags="">Haitian</w>
<w f="88" flags="">Harrisburg</w>
@@ -62354,6 +62353,7 @@
<w f="58" flags="">Gudrun</w>
<w f="58" flags="">Guinea's</w>
<w f="58" flags="">Gunderson</w>
+ <w f="58" flags="abreviation">HDTV</w>
<w f="58" flags="">Haiphong</w>
<w f="58" flags="">Hale's</w>
<w f="58" flags="">Hanson's</w>
@@ -69201,7 +69201,6 @@
<w f="54" flags="">Grosz</w>
<w f="54" flags="">Guizot</w>
<w f="54" flags="">Gurney's</w>
- <w f="54" flags="abreviation">HDTVs</w>
<w f="54" flags="abreviation">HMSO</w>
<w f="54" flags="">Hadleigh</w>
<w f="54" flags="">Haig's</w>
@@ -83695,6 +83694,7 @@
<w f="45" flags="">Guofeng</w>
<w f="45" flags="">Gupta's</w>
<w f="45" flags="">Guyer</w>
+ <w f="45" flags="abreviation">HDTVs</w>
<w f="45" flags="">Haggai</w>
<w f="45" flags="">Haifa's</w>
<w f="45" flags="">Hamiltonians</w>
diff --git a/java/res/raw/main_en.dict b/java/res/raw/main_en.dict
index 14865a28e..8f8b3cd82 100644
--- a/java/res/raw/main_en.dict
+++ b/java/res/raw/main_en.dict
Binary files differ
diff --git a/java/res/xml-sw600dp/row_pcqwerty5.xml b/java/res/xml-sw600dp/row_pcqwerty5.xml
index e9e231a16..3c4a46660 100644
--- a/java/res/xml-sw600dp/row_pcqwerty5.xml
+++ b/java/res/xml-sw600dp/row_pcqwerty5.xml
@@ -26,44 +26,19 @@
>
<switch>
<case
- latin:keyboardLayoutSetElement="symbols|symbolsShifted"
- >
- <Spacer
- latin:keyXPos="15.0%p"
- latin:keyWidth="10.5%p" />
- </case>
- <case
- latin:mode="url"
- >
- <Key
- latin:keyStyle="comKeyStyle"
- latin:keyXPos="15.0%p"
- latin:keyWidth="10.5%p" />
- </case>
- <default>
- <include
- latin:keyboardLayout="@xml/keys_f1f2"
- latin:keyXPos="18.5%p" />
- </default>
- </switch>
- <switch>
- <case
latin:languageSwitchKeyEnabled="true"
>
<Key
- latin:keyStyle="languageSwitchKeyStyle" />
- <Key
- latin:keyStyle="spaceKeyStyle"
- latin:keyWidth="42.0%p" />
+ latin:keyStyle="languageSwitchKeyStyle"
+ latin:keyWidth="9.0%p"
+ latin:backgroundType="functional" />
</case>
- <!-- languageSwitchKeyEnabled="false" -->
- <default>
- <Key
- latin:keyStyle="spaceKeyStyle"
- latin:keyWidth="49.0%p" />
- </default>
</switch>
- <include
+ <Key
+ latin:keyStyle="spaceKeyStyle"
+ latin:keyXPos="25.5%p"
+ latin:keyWidth="49.0%p" />
+ <include
latin:keyXPos="-9.0%p"
latin:keyWidth="fillRight"
latin:keyboardLayout="@xml/key_shortcut" />
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 45ed34ed2..91e81f347 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -42,6 +42,7 @@ import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.util.Arrays;
+import java.util.Locale;
/**
* Class for describing the position and characteristics of a single key in the keyboard.
@@ -240,7 +241,8 @@ public class Key {
mLabelFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags)
| row.getDefaultKeyLabelFlags();
- final boolean preserveCase = (mLabelFlags & LABEL_FLAGS_PRESERVE_CASE) != 0;
+ final boolean needsToUpperCase = needsToUpperCase(mLabelFlags, params.mId.mElementId);
+ final Locale locale = params.mId.mLocale;
int actionFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyActionFlags);
String[] moreKeys = style.getStringArray(keyAttr, R.styleable.Keyboard_Key_moreKeys);
@@ -276,8 +278,8 @@ public class Key {
actionFlags |= ACTION_FLAGS_ENABLE_LONG_PRESS;
mMoreKeys = new MoreKeySpec[moreKeys.length];
for (int i = 0; i < moreKeys.length; i++) {
- mMoreKeys[i] = new MoreKeySpec(adjustCaseOfStringForKeyboardId(
- moreKeys[i], preserveCase, params.mId), params.mCodesSet);
+ mMoreKeys[i] = new MoreKeySpec(
+ moreKeys[i], needsToUpperCase, locale, params.mCodesSet);
}
} else {
mMoreKeys = null;
@@ -287,17 +289,17 @@ public class Key {
if ((mLabelFlags & LABEL_FLAGS_FROM_CUSTOM_ACTION_LABEL) != 0) {
mLabel = params.mId.mCustomActionLabel;
} else {
- mLabel = adjustCaseOfStringForKeyboardId(style.getString(keyAttr,
- R.styleable.Keyboard_Key_keyLabel), preserveCase, params.mId);
+ mLabel = KeySpecParser.toUpperCaseOfStringForLocale(style.getString(keyAttr,
+ R.styleable.Keyboard_Key_keyLabel), needsToUpperCase, locale);
}
if ((mLabelFlags & LABEL_FLAGS_DISABLE_HINT_LABEL) != 0) {
mHintLabel = null;
} else {
- mHintLabel = adjustCaseOfStringForKeyboardId(style.getString(keyAttr,
- R.styleable.Keyboard_Key_keyHintLabel), preserveCase, params.mId);
+ mHintLabel = KeySpecParser.toUpperCaseOfStringForLocale(style.getString(keyAttr,
+ R.styleable.Keyboard_Key_keyHintLabel), needsToUpperCase, locale);
}
- String outputText = adjustCaseOfStringForKeyboardId(style.getString(keyAttr,
- R.styleable.Keyboard_Key_keyOutputText), preserveCase, params.mId);
+ String outputText = KeySpecParser.toUpperCaseOfStringForLocale(style.getString(keyAttr,
+ R.styleable.Keyboard_Key_keyOutputText), needsToUpperCase, locale);
final int code = KeySpecParser.parseCode(style.getString(keyAttr,
R.styleable.Keyboard_Key_code), params.mCodesSet, CODE_UNSPECIFIED);
// Choose the first letter of the label as primary code if not specified.
@@ -326,12 +328,13 @@ public class Key {
mCode = CODE_OUTPUT_TEXT;
}
} else {
- mCode = adjustCaseOfCodeForKeyboardId(code, preserveCase, params.mId);
+ mCode = KeySpecParser.toUpperCaseOfCodeForLocale(code, needsToUpperCase, locale);
}
mOutputText = outputText;
- mAltCode = adjustCaseOfCodeForKeyboardId(KeySpecParser.parseCode(style.getString(keyAttr,
+ mAltCode = KeySpecParser.toUpperCaseOfCodeForLocale(
+ KeySpecParser.parseCode(style.getString(keyAttr,
R.styleable.Keyboard_Key_altCode), params.mCodesSet, CODE_UNSPECIFIED),
- preserveCase, params.mId);
+ needsToUpperCase, locale);
mHashCode = computeHashCode(this);
keyAttr.recycle();
@@ -341,26 +344,16 @@ public class Key {
}
}
- private static int adjustCaseOfCodeForKeyboardId(int code, boolean preserveCase,
- KeyboardId id) {
- if (!Keyboard.isLetterCode(code) || preserveCase) return code;
- final String text = new String(new int[] { code } , 0, 1);
- final String casedText = adjustCaseOfStringForKeyboardId(text, preserveCase, id);
- return StringUtils.codePointCount(casedText) == 1
- ? casedText.codePointAt(0) : CODE_UNSPECIFIED;
- }
-
- private static String adjustCaseOfStringForKeyboardId(String text, boolean preserveCase,
- KeyboardId id) {
- if (text == null || preserveCase) return text;
- switch (id.mElementId) {
+ private static boolean needsToUpperCase(int labelFlags, int keyboardElementId) {
+ if ((labelFlags & LABEL_FLAGS_PRESERVE_CASE) != 0) return false;
+ switch (keyboardElementId) {
case KeyboardId.ELEMENT_ALPHABET_MANUAL_SHIFTED:
case KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED:
case KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCKED:
case KeyboardId.ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED:
- return text.toUpperCase(id.mLocale);
+ return true;
default:
- return text;
+ return false;
}
}
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java
index a44ddf182..b95bddc81 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java
@@ -16,6 +16,8 @@
package com.android.inputmethod.keyboard.internal;
+import static com.android.inputmethod.keyboard.Keyboard.CODE_UNSPECIFIED;
+
import android.text.TextUtils;
import com.android.inputmethod.keyboard.Keyboard;
@@ -24,6 +26,7 @@ import com.android.inputmethod.latin.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Locale;
/**
* The string parser of more keys specification.
@@ -63,10 +66,14 @@ public class KeySpecParser {
public final String mOutputText;
public final int mIconId;
- public MoreKeySpec(final String moreKeySpec, final KeyboardCodesSet codesSet) {
- mCode = getCode(moreKeySpec, codesSet);
- mLabel = getLabel(moreKeySpec);
- mOutputText = getOutputText(moreKeySpec);
+ public MoreKeySpec(final String moreKeySpec, boolean needsToUpperCase, Locale locale,
+ final KeyboardCodesSet codesSet) {
+ mCode = toUpperCaseOfCodeForLocale(getCode(moreKeySpec, codesSet),
+ needsToUpperCase, locale);
+ mLabel = toUpperCaseOfStringForLocale(getLabel(moreKeySpec),
+ needsToUpperCase, locale);
+ mOutputText = toUpperCaseOfStringForLocale(getOutputText(moreKeySpec),
+ needsToUpperCase, locale);
mIconId = getIconId(moreKeySpec);
}
}
@@ -256,9 +263,8 @@ public class KeySpecParser {
}
if (out == null) {
return array;
- } else {
- return out.toArray(new String[out.size()]);
}
+ return out.toArray(new String[out.size()]);
}
public static String[] insertAdditionalMoreKeys(String[] moreKeySpecs,
@@ -427,12 +433,11 @@ public class KeySpecParser {
final String remain = (size - start > 0) ? text.substring(start) : null;
if (list == null) {
return remain != null ? new String[] { remain } : null;
- } else {
- if (remain != null) {
- list.add(remain);
- }
- return list.toArray(new String[list.size()]);
}
+ if (remain != null) {
+ list.add(remain);
+ }
+ return list.toArray(new String[list.size()]);
}
public static int getIntValue(String[] moreKeys, String key, int defaultValue) {
@@ -476,4 +481,20 @@ public class KeySpecParser {
}
return value;
}
+
+ public static int toUpperCaseOfCodeForLocale(int code, boolean needsToUpperCase,
+ Locale locale) {
+ if (!Keyboard.isLetterCode(code) || !needsToUpperCase) return code;
+ final String text = new String(new int[] { code } , 0, 1);
+ final String casedText = KeySpecParser.toUpperCaseOfStringForLocale(
+ text, needsToUpperCase, locale);
+ return StringUtils.codePointCount(casedText) == 1
+ ? casedText.codePointAt(0) : CODE_UNSPECIFIED;
+ }
+
+ public static String toUpperCaseOfStringForLocale(String text, boolean needsToUpperCase,
+ Locale locale) {
+ if (text == null || !needsToUpperCase) return text;
+ return text.toUpperCase(locale);
+ }
}
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java
index c10a394c1..67cb74f4d 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java
@@ -34,9 +34,6 @@ public class KeyboardCodesSet {
public int getCode(final String name) {
Integer id = sNameToIdMap.get(name);
- if (id == null) {
- id = sNameToIdMap.get(name.toLowerCase());
- }
if (id == null) throw new RuntimeException("Unknown key code: " + name);
return mCodes[id];
}
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index e9117e29a..52088812d 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -45,6 +45,8 @@ import android.text.TextUtils;
import android.util.Log;
import android.util.PrintWriterPrinter;
import android.util.Printer;
+import android.view.KeyCharacterMap;
+import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
@@ -1223,6 +1225,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
+ static private void sendUpDownEnterOrBackspace(final int code, final InputConnection ic) {
+ final long eventTime = SystemClock.uptimeMillis();
+ ic.sendKeyEvent(new KeyEvent(eventTime, eventTime,
+ KeyEvent.ACTION_DOWN, code, 0, 0, KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
+ KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE));
+ ic.sendKeyEvent(new KeyEvent(SystemClock.uptimeMillis(), eventTime,
+ KeyEvent.ACTION_UP, code, 0, 0, KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
+ KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE));
+ }
+
private void sendKeyCodePoint(int code) {
// TODO: Remove this special handling of digit letters.
// For backward compatibility. See {@link InputMethodService#sendKeyChar(char)}.
@@ -1233,8 +1245,19 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final InputConnection ic = getCurrentInputConnection();
if (ic != null) {
- final String text = new String(new int[] { code }, 0, 1);
- ic.commitText(text, text.length());
+ // 16 is android.os.Build.VERSION_CODES.JELLY_BEAN but we can't write it because
+ // we want to be able to compile against the Ice Cream Sandwich SDK.
+ if (Keyboard.CODE_ENTER == code && mTargetApplicationInfo != null
+ && mTargetApplicationInfo.targetSdkVersion < 16) {
+ // Backward compatibility mode. Before Jelly bean, the keyboard would simulate
+ // a hardware keyboard event on pressing enter or delete. This is bad for many
+ // reasons (there are race conditions with commits) but some applications are
+ // relying on this behavior so we continue to support it for older apps.
+ sendUpDownEnterOrBackspace(KeyEvent.KEYCODE_ENTER, ic);
+ } else {
+ final String text = new String(new int[] { code }, 0, 1);
+ ic.commitText(text, text.length());
+ }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.latinIME_sendKeyCodePoint(code);
}
@@ -1463,7 +1486,18 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// This should never happen.
Log.e(TAG, "Backspace when we don't know the selection position");
}
- ic.deleteSurroundingText(1, 0);
+ // 16 is android.os.Build.VERSION_CODES.JELLY_BEAN but we can't write it because
+ // we want to be able to compile against the Ice Cream Sandwich SDK.
+ if (mTargetApplicationInfo != null
+ && mTargetApplicationInfo.targetSdkVersion < 16) {
+ // Backward compatibility mode. Before Jelly bean, the keyboard would simulate
+ // a hardware keyboard event on pressing enter or delete. This is bad for many
+ // reasons (there are race conditions with commits) but some applications are
+ // relying on this behavior so we continue to support it for older apps.
+ sendUpDownEnterOrBackspace(KeyEvent.KEYCODE_DEL, ic);
+ } else {
+ ic.deleteSurroundingText(1, 0);
+ }
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.latinIME_deleteSurroundingText(1);
}
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java
index f2a165678..eb37769f5 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java
@@ -62,7 +62,8 @@ public class KeySpecParserTests extends AndroidTestCase {
private void assertParser(String message, String moreKeySpec, String expectedLabel,
String expectedOutputText, int expectedIcon, int expectedCode) {
final String labelResolved = KeySpecParser.resolveTextReference(moreKeySpec, mTextsSet);
- final MoreKeySpec spec = new MoreKeySpec(labelResolved, mCodesSet);
+ final MoreKeySpec spec = new MoreKeySpec(labelResolved, false /* needsToUpperCase */,
+ Locale.US, mCodesSet);
assertEquals(message + " [label]", expectedLabel, spec.mLabel);
assertEquals(message + " [ouptputText]", expectedOutputText, spec.mOutputText);
assertEquals(message + " [icon]",
@@ -149,7 +150,7 @@ public class KeySpecParserTests extends AndroidTestCase {
"|", null, ICON_UNDEFINED, '|');
assertParser("Single letter with code", "a|" + CODE_SETTINGS,
"a", null, ICON_UNDEFINED, mCodeSettings);
- assertParser("Single letter with CODE", "a|" + CODE_SETTINGS_UPPERCASE,
+ assertParserError("Single letter with CODE", "a|" + CODE_SETTINGS_UPPERCASE,
"a", null, ICON_UNDEFINED, mCodeSettings);
}
@@ -213,11 +214,11 @@ public class KeySpecParserTests extends AndroidTestCase {
"a|c", "d|f", ICON_UNDEFINED, CODE_OUTPUT_TEXT);
assertParser("Label with code", "abc|" + CODE_SETTINGS,
"abc", null, ICON_UNDEFINED, mCodeSettings);
- assertParser("Label with CODE", "abc|" + CODE_SETTINGS_UPPERCASE,
+ assertParserError("Label with CODE", "abc|" + CODE_SETTINGS_UPPERCASE,
"abc", null, ICON_UNDEFINED, mCodeSettings);
assertParser("Escaped label with code", "a\\|c|" + CODE_SETTINGS,
"a|c", null, ICON_UNDEFINED, mCodeSettings);
- assertParser("Escaped label with CODE", "a\\|c|" + CODE_SETTINGS_UPPERCASE,
+ assertParserError("Escaped label with CODE", "a\\|c|" + CODE_SETTINGS_UPPERCASE,
"a|c", null, ICON_UNDEFINED, mCodeSettings);
}
@@ -240,19 +241,19 @@ public class KeySpecParserTests extends AndroidTestCase {
null, "!bc", mSettingsIconId, CODE_OUTPUT_TEXT);
assertParser("Label starts with bang and code", "!bc|" + CODE_SETTINGS,
"!bc", null, ICON_UNDEFINED, mCodeSettings);
- assertParser("Label starts with bang and CODE", "!bc|" + CODE_SETTINGS_UPPERCASE,
+ assertParserError("Label starts with bang and CODE", "!bc|" + CODE_SETTINGS_UPPERCASE,
"!bc", null, ICON_UNDEFINED, mCodeSettings);
assertParser("Label contains bang and code", "a!c|" + CODE_SETTINGS,
"a!c", null, ICON_UNDEFINED, mCodeSettings);
- assertParser("Label contains bang and CODE", "a!c|" + CODE_SETTINGS_UPPERCASE,
+ assertParserError("Label contains bang and CODE", "a!c|" + CODE_SETTINGS_UPPERCASE,
"a!c", null, ICON_UNDEFINED, mCodeSettings);
assertParser("Escaped bang label with code", "\\!bc|" + CODE_SETTINGS,
"!bc", null, ICON_UNDEFINED, mCodeSettings);
- assertParser("Escaped bang label with CODE", "\\!bc|" + CODE_SETTINGS_UPPERCASE,
+ assertParserError("Escaped bang label with CODE", "\\!bc|" + CODE_SETTINGS_UPPERCASE,
"!bc", null, ICON_UNDEFINED, mCodeSettings);
assertParser("Icon with code", ICON_SETTINGS + "|" + CODE_SETTINGS,
null, null, mSettingsIconId, mCodeSettings);
- assertParser("ICON with CODE", ICON_SETTINGS_UPPERCASE + "|" + CODE_SETTINGS_UPPERCASE,
+ assertParserError("ICON with CODE", ICON_SETTINGS_UPPERCASE + "|" + CODE_SETTINGS_UPPERCASE,
null, null, mSettingsIconId, mCodeSettings);
}
@@ -264,7 +265,7 @@ public class KeySpecParserTests extends AndroidTestCase {
assertParser("Action next as more key", "!text/label_next_key|!code/key_action_next",
"Next", null, ICON_UNDEFINED, mCodeActionNext);
- assertParser("ACTION NEXT AS MORE KEY", "!TEXT/LABEL_NEXT_KEY|!CODE/KEY_ACTION_NEXT",
+ assertParserError("ACTION NEXT AS MORE KEY", "!TEXT/LABEL_NEXT_KEY|!CODE/KEY_ACTION_NEXT",
"Next", null, ICON_UNDEFINED, mCodeActionNext);
assertParser("Popular domain",