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
This commit is contained in:
Brandon Dayauon
2024-10-21 11:22:26 -07:00
parent cfd3326efd
commit 13b964f91d
@@ -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