Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c482473c authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Make LocaleUtils#getLanguageFromLocaleString() work again

This is a follow up CL to our previous CL [1], which aimed to remove
the code duplicate without changing the behavior but ended up
introducing an unexpected behavior change, which is actually caught as
test failures.

In short, the legacy "subtypeLocale" uses a non-standard text format,
which cannot be parsed with

  Locale#forLanguageTag().

Note that subtypes have already accept BCP 47 LanguageTags [2], that's
where

  Locale#forLanguageTag()

should be used.

Anyway, with this commit

  LocaleUtils#getLanguageFromLocaleString()

starts working correctly again.

Futher cleanups will be coming at Bug 321064051.

 [1]: I67ec553f8cfc21b1916a5a32783630ea43f2d407
      d24bd53f
 [2]: I6db107ad2afc7709167f7c4e5d24bd589ac8bd70
      868d19b9

Bug: 303302694
Bug: 321064051
Fix: 320780830
Test: atest FrameworksServicesTests:com.android.server.inputmethod.InputMethodSubtypeSwitchingControllerTest
Test: atest FrameworksServicesTests:com.android.server.inputmethod.InputMethodUtilsTest
Test: atest FrameworksServicesTests:com.android.server.inputmethod.LocaleUtilsTest
Change-Id: Ifdbc565455cd4ff3edf47221949e8c16f3a457c2
parent d62ba55c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment