Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2397)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 2488343003: Stop passing unsupported locale string to Android Webview (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index e5196e47ed1c1e42483d48132c373a299dbba568..5a59ce7c7bf54715e17c7f679bc000589202032c 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -360,7 +360,7 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
// Do not use directly, call isDestroyed() instead.
private boolean mIsDestroyed = false;
- private static String sCurrentLocales = "";
+ private static String sCurrentLocale = "";
private static final class AwContentsDestroyRunnable implements Runnable {
private final long mNativeAwContents;
@@ -694,11 +694,7 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
@Override
public void onConfigurationChanged(Configuration configuration) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- setLocale(LocaleUtils.toLanguageTags(configuration.getLocales()));
- } else {
- setLocale(LocaleUtils.toLanguageTag(configuration.locale));
- }
+ setLocale(LocaleUtils.toLanguageTag(configuration.locale));
mSettings.updateAcceptLanguages();
}
};
@@ -1025,12 +1021,11 @@ public class AwContents implements SmartClipProvider, PostMessageSender.PostMess
return wrapper;
}
- // Deal with a string that represents either a single locale or a locale list.
@VisibleForTesting
- public static void setLocale(String locales) {
- if (!sCurrentLocales.equals(locales)) {
- sCurrentLocales = locales;
- nativeSetLocale(sCurrentLocales);
+ public static void setLocale(String locale) {
+ if (!sCurrentLocale.equals(locale)) {
+ sCurrentLocale = locale;
+ nativeSetLocale(sCurrentLocale);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698