From 13b964f91d355cf3a49fe840fe23be2c18fe6ebf Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Mon, 21 Oct 2024 11:22:26 -0700 Subject: [PATCH] Instead of checking for locale, check language specifically. Should be checking for english language as seen here: https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:libcore/ojluni/src/main/java/java/util/Locale.java;l=1374?q=locale%20getLanguage&sq=repo:googleplex-android%2Fplatform%2Fsuperproject%2Fmain%20b:main This gives the language code which is what we should be checking against according to https://yaqs.corp.google.com/eng/q/4542431059247104. bug: 373670311 Test: Manually - tried with various other "ENGLISH" languages besides US. Including Bermuda/UK and non english languages Flag: NONE locale checking Change-Id: Ib2eff4c9a13b74ede8575ee8d5280bbf9b9b8729 --- src/com/android/launcher3/BubbleTextView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 76dc7700e7..4e049fda83 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -187,7 +187,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, @ViewDebug.ExportedProperty(category = "launcher") private DotInfo mDotInfo; private DotRenderer mDotRenderer; - private Locale mCurrentLocale; + private String mCurrentLanguage; @ViewDebug.ExportedProperty(category = "launcher", deepExport = true) protected DotRenderer.DrawParams mDotParams; private Animator mDotScaleAnim; @@ -298,7 +298,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, mDotParams = new DotRenderer.DrawParams(); - mCurrentLocale = context.getResources().getConfiguration().locale; + mCurrentLanguage = context.getResources().getConfiguration().locale.getLanguage(); setEllipsize(TruncateAt.END); setAccessibilityDelegate(mActivity.getAccessibilityDelegate()); setTextAlpha(1f); @@ -494,7 +494,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, } protected boolean isCurrentLanguageEnglish() { - return mCurrentLocale.equals(Locale.US); + return mCurrentLanguage.equals(Locale.ENGLISH.getLanguage()); } @UiThread