| 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 45a360b4f9da94ff9fe8607a1c29090fe6c44221..c75d4a5e67e134e6c8a1bfcdeb66ddd654f5d435 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| @@ -359,7 +359,7 @@ public class AwContents implements SmartClipProvider,
|
| // Do not use directly, call isDestroyed() instead.
|
| private boolean mIsDestroyed = false;
|
|
|
| - private static String sCurrentLocale = "";
|
| + private static String sCurrentLocales = "";
|
|
|
| private static final class AwContentsDestroyRunnable implements Runnable {
|
| private final long mNativeAwContents;
|
| @@ -693,7 +693,11 @@ public class AwContents implements SmartClipProvider,
|
|
|
| @Override
|
| public void onConfigurationChanged(Configuration configuration) {
|
| - setLocale(LocaleUtils.toLanguageTag(configuration.locale));
|
| + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
| + setLocale(LocaleUtils.toLanguageTags(configuration.getLocales()));
|
| + } else {
|
| + setLocale(LocaleUtils.toLanguageTag(configuration.locale));
|
| + }
|
| mSettings.updateAcceptLanguages();
|
| }
|
| };
|
| @@ -1002,11 +1006,12 @@ public class AwContents implements SmartClipProvider,
|
| return wrapper;
|
| }
|
|
|
| + // Deal with a string that represents either a single locale or a locale list.
|
| @VisibleForTesting
|
| - public static void setLocale(String locale) {
|
| - if (!sCurrentLocale.equals(locale)) {
|
| - sCurrentLocale = locale;
|
| - nativeSetLocale(sCurrentLocale);
|
| + public static void setLocale(String locales) {
|
| + if (!sCurrentLocales.equals(locales)) {
|
| + sCurrentLocales = locales;
|
| + nativeSetLocale(sCurrentLocales);
|
| }
|
| }
|
|
|
|
|