OSDN Git Service

Introduce script matching for enabling default IME subtypes.
authorSeigo Nonaka <nona@google.com>
Sat, 5 Mar 2016 02:38:26 +0000 (18:38 -0800)
committerSeigo Nonaka <nona@google.com>
Sun, 6 Mar 2016 02:52:59 +0000 (18:52 -0800)
commit9e7a1c9824cffca32fd7d58bb13bd3416ab32091
tree32f079ed58b3ed96ec03d470e5fb5e08bf64b290
parentc53244db5efb791d42b9b70c05ae8ed89b62c530
Introduce script matching for enabling default IME subtypes.

The motivation of this CL is enhance the default IME subtype enabling
algorithm.  The new approach is done by score based algorithm.  The
design of the matching score is determined as follows:
- The matching score for the each two locale is up to 3 and determined
  as follows:
  - Score of 3 : matches all language, script and country.
  - Score of 2 : matches the language and script.
  - Score of 1 : matches the language regardless of country.
  - Score of 0 : doesn't match the language regardless of script and
                 country.
- All locales are fully expanded before matching by addLikelySubtags in
  ICU.

Bug: 27129703
Change-Id: I5bb1bd8cdb9096d516d60beb9936e55bf2b757ae
core/java/com/android/internal/inputmethod/LocaleUtils.java
core/tests/coretests/src/com/android/internal/inputmethod/LocaleUtilsTest.java