diff options
author | Yohei Yukawa <yukawa@google.com> | 2014-07-24 09:54:59 +0900 |
---|---|---|
committer | Yohei Yukawa <yukawa@google.com> | 2014-07-26 03:21:03 +0900 |
commit | 71cf0a32d0d9a45653704a671154f26a8bc3132b (patch) | |
tree | 02a72b957add60dc7e196901d957634eb27a7473 /core/tests | |
parent | 1a6896910898ae0bccaecc96aad4887cdc5fac1a (diff) | |
download | frameworks_base-71cf0a32d0d9a45653704a671154f26a8bc3132b.zip frameworks_base-71cf0a32d0d9a45653704a671154f26a8bc3132b.tar.gz frameworks_base-71cf0a32d0d9a45653704a671154f26a8bc3132b.tar.bz2 |
Stop assuming language part in locale string is up to 2-letter
With this CL, InputMethodSubtypeSwitchingController stop
assuming that language part in locale string is up to 2-letter.
this CL is not so risky because
InputMethodSubtypeSwitchingController have used language part for
nothing but sorting subtypes to determine the initial rotation
order of IME switching.
BUG: 16502987
Change-Id: Ib159ece0b7aa04f8fd7abc96c9a6e0832a4b7cd2
Diffstat (limited to 'core/tests')
-rw-r--r-- | core/tests/inputmethodtests/src/android/os/InputMethodSubtypeSwitchingControllerTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/core/tests/inputmethodtests/src/android/os/InputMethodSubtypeSwitchingControllerTest.java b/core/tests/inputmethodtests/src/android/os/InputMethodSubtypeSwitchingControllerTest.java index ca68e93..3a598f2 100644 --- a/core/tests/inputmethodtests/src/android/os/InputMethodSubtypeSwitchingControllerTest.java +++ b/core/tests/inputmethodtests/src/android/os/InputMethodSubtypeSwitchingControllerTest.java @@ -295,4 +295,33 @@ public class InputMethodSubtypeSwitchingControllerTest extends InstrumentationTe assertRotationOrder(anotherController, false /* onlyCurrentIme */, switchingUnawarelatinIme_en_UK, switchUnawareJapaneseIme_ja_JP); } + + @SmallTest + public void testImeSubtypeListItem() throws Exception { + final List<ImeSubtypeListItem> items = new ArrayList<ImeSubtypeListItem>(); + addDummyImeSubtypeListItems(items, "LatinIme", "LatinIme", + Arrays.asList("en_US", "fr", "en", "en_uk", "enn", "e", "EN_US"), + true /* supportsSwitchingToNextInputMethod*/); + final ImeSubtypeListItem item_en_US = items.get(0); + final ImeSubtypeListItem item_fr = items.get(1); + final ImeSubtypeListItem item_en = items.get(2); + final ImeSubtypeListItem item_enn = items.get(3); + final ImeSubtypeListItem item_e = items.get(4); + final ImeSubtypeListItem item_EN_US = items.get(5); + + assertTrue(item_en_US.mIsSystemLocale); + assertFalse(item_fr.mIsSystemLocale); + assertFalse(item_en.mIsSystemLocale); + assertFalse(item_en.mIsSystemLocale); + assertFalse(item_enn.mIsSystemLocale); + assertFalse(item_e.mIsSystemLocale); + assertFalse(item_EN_US.mIsSystemLocale); + + assertTrue(item_en_US.mIsSystemLanguage); + assertFalse(item_fr.mIsSystemLanguage); + assertTrue(item_en.mIsSystemLanguage); + assertFalse(item_enn.mIsSystemLocale); + assertFalse(item_e.mIsSystemLocale); + assertFalse(item_EN_US.mIsSystemLocale); + } } |