Merge "cec: fix Traditional Chinese issue for Playback [1/1] BUG:183071276" am: f4c40e0b0b am: 6a47166d50
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1566053 Change-Id: I9d3fce190d3449dabd24862a8eb8d0d6f944a0db Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -275,7 +275,9 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource {
|
|||||||
try {
|
try {
|
||||||
String iso3Language = new String(message.getParams(), 0, 3, "US-ASCII");
|
String iso3Language = new String(message.getParams(), 0, 3, "US-ASCII");
|
||||||
Locale currentLocale = mService.getContext().getResources().getConfiguration().locale;
|
Locale currentLocale = mService.getContext().getResources().getConfiguration().locale;
|
||||||
if (currentLocale.getISO3Language().equals(iso3Language)) {
|
String curIso3Language = mService.localeToMenuLanguage(currentLocale);
|
||||||
|
HdmiLogger.debug("handleSetMenuLanguage " + iso3Language + " cur:" + curIso3Language);
|
||||||
|
if (curIso3Language.equals(iso3Language)) {
|
||||||
// Do not switch language if the new language is the same as the current one.
|
// Do not switch language if the new language is the same as the current one.
|
||||||
// This helps avoid accidental country variant switching from en_US to en_AU
|
// This helps avoid accidental country variant switching from en_US to en_AU
|
||||||
// due to the limitation of CEC. See the warning below.
|
// due to the limitation of CEC. See the warning below.
|
||||||
@@ -287,7 +289,7 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource {
|
|||||||
final List<LocaleInfo> localeInfos = LocalePicker.getAllAssetLocales(
|
final List<LocaleInfo> localeInfos = LocalePicker.getAllAssetLocales(
|
||||||
mService.getContext(), false);
|
mService.getContext(), false);
|
||||||
for (LocaleInfo localeInfo : localeInfos) {
|
for (LocaleInfo localeInfo : localeInfos) {
|
||||||
if (localeInfo.getLocale().getISO3Language().equals(iso3Language)) {
|
if (mService.localeToMenuLanguage(localeInfo.getLocale()).equals(iso3Language)) {
|
||||||
// WARNING: CEC adopts ISO/FDIS-2 for language code, while Android requires
|
// WARNING: CEC adopts ISO/FDIS-2 for language code, while Android requires
|
||||||
// additional country variant to pinpoint the locale. This keeps the right
|
// additional country variant to pinpoint the locale. This keeps the right
|
||||||
// locale from being chosen. 'eng' in the CEC command, for instance,
|
// locale from being chosen. 'eng' in the CEC command, for instance,
|
||||||
|
|||||||
Reference in New Issue
Block a user