Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -34445,6 +34445,7 @@ package android.util { ctor public LocaleList(java.util.Locale[]); method public static android.util.LocaleList forLanguageTags(java.lang.String); method public java.util.Locale get(int); method public java.util.Locale getBestMatch(java.lang.String[]); method public static android.util.LocaleList getDefault(); method public static android.util.LocaleList getEmptyLocaleList(); method public java.util.Locale getPrimary(); api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -36768,6 +36768,7 @@ package android.util { ctor public LocaleList(java.util.Locale[]); method public static android.util.LocaleList forLanguageTags(java.lang.String); method public java.util.Locale get(int); method public java.util.Locale getBestMatch(java.lang.String[]); method public static android.util.LocaleList getDefault(); method public static android.util.LocaleList getEmptyLocaleList(); method public java.util.Locale getPrimary(); core/java/android/util/LocaleList.java +7 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ public final class LocaleList { return location < mList.length ? mList[location] : null; } @Nullable public Locale getPrimary() { return mList.length == 0 ? null : get(0); } Loading Loading @@ -179,6 +180,12 @@ public final class LocaleList { } } @Nullable public Locale getBestMatch(String[] locales) { // TODO: Fix this to actually do locale negotiation and choose the best match return getPrimary(); } private final static Object sLock = new Object(); @GuardedBy("sLock") Loading services/core/java/com/android/server/am/ActivityManagerService.java +12 −5 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ import android.util.ArraySet; import android.util.AtomicFile; import android.util.DebugUtils; import android.util.EventLog; import android.util.LocaleList; import android.util.Log; import android.util.Pair; import android.util.PrintWriterPrinter; Loading Loading @@ -2445,7 +2446,7 @@ public final class ActivityManagerService extends ActivityManagerNative mTrackingAssociations = "1".equals(SystemProperties.get("debug.track-associations")); mConfiguration.setToDefaults(); mConfiguration.setLocale(Locale.getDefault()); mConfiguration.setLocales(LocaleList.getDefault()); mConfigurationSeq = mConfiguration.seq = 1; mProcessCpuTracker.init(); Loading Loading @@ -17709,6 +17710,9 @@ public final class ActivityManagerService extends ActivityManagerNative UserHandle.USER_NULL); } // To cache the list of supported system locales private String[] mSupportedSystemLocales = null; /** * Do either or both things: (1) change the current configuration, and (2) * make sure the given activity is running with the (now) current Loading @@ -17732,11 +17736,14 @@ public final class ActivityManagerService extends ActivityManagerNative EventLog.writeEvent(EventLogTags.CONFIGURATION_CHANGED, changes); if (!initLocale && values.locale != null && values.userSetLocale) { final String languageTag = values.locale.toLanguageTag(); SystemProperties.set("persist.sys.locale", languageTag); if (!initLocale && !values.getLocales().isEmpty() && values.userSetLocale) { if (mSupportedSystemLocales == null) { mSupportedSystemLocales = Resources.getSystem().getAssets().getLocales(); } final Locale locale = values.getLocales().getBestMatch(mSupportedSystemLocales); SystemProperties.set("persist.sys.locale", locale.toLanguageTag()); mHandler.sendMessage(mHandler.obtainMessage(SEND_LOCALE_TO_MOUNT_DAEMON_MSG, values.locale)); locale)); } mConfigurationSeq++; Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -34445,6 +34445,7 @@ package android.util { ctor public LocaleList(java.util.Locale[]); method public static android.util.LocaleList forLanguageTags(java.lang.String); method public java.util.Locale get(int); method public java.util.Locale getBestMatch(java.lang.String[]); method public static android.util.LocaleList getDefault(); method public static android.util.LocaleList getEmptyLocaleList(); method public java.util.Locale getPrimary();
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -36768,6 +36768,7 @@ package android.util { ctor public LocaleList(java.util.Locale[]); method public static android.util.LocaleList forLanguageTags(java.lang.String); method public java.util.Locale get(int); method public java.util.Locale getBestMatch(java.lang.String[]); method public static android.util.LocaleList getDefault(); method public static android.util.LocaleList getEmptyLocaleList(); method public java.util.Locale getPrimary();
core/java/android/util/LocaleList.java +7 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ public final class LocaleList { return location < mList.length ? mList[location] : null; } @Nullable public Locale getPrimary() { return mList.length == 0 ? null : get(0); } Loading Loading @@ -179,6 +180,12 @@ public final class LocaleList { } } @Nullable public Locale getBestMatch(String[] locales) { // TODO: Fix this to actually do locale negotiation and choose the best match return getPrimary(); } private final static Object sLock = new Object(); @GuardedBy("sLock") Loading
services/core/java/com/android/server/am/ActivityManagerService.java +12 −5 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ import android.util.ArraySet; import android.util.AtomicFile; import android.util.DebugUtils; import android.util.EventLog; import android.util.LocaleList; import android.util.Log; import android.util.Pair; import android.util.PrintWriterPrinter; Loading Loading @@ -2445,7 +2446,7 @@ public final class ActivityManagerService extends ActivityManagerNative mTrackingAssociations = "1".equals(SystemProperties.get("debug.track-associations")); mConfiguration.setToDefaults(); mConfiguration.setLocale(Locale.getDefault()); mConfiguration.setLocales(LocaleList.getDefault()); mConfigurationSeq = mConfiguration.seq = 1; mProcessCpuTracker.init(); Loading Loading @@ -17709,6 +17710,9 @@ public final class ActivityManagerService extends ActivityManagerNative UserHandle.USER_NULL); } // To cache the list of supported system locales private String[] mSupportedSystemLocales = null; /** * Do either or both things: (1) change the current configuration, and (2) * make sure the given activity is running with the (now) current Loading @@ -17732,11 +17736,14 @@ public final class ActivityManagerService extends ActivityManagerNative EventLog.writeEvent(EventLogTags.CONFIGURATION_CHANGED, changes); if (!initLocale && values.locale != null && values.userSetLocale) { final String languageTag = values.locale.toLanguageTag(); SystemProperties.set("persist.sys.locale", languageTag); if (!initLocale && !values.getLocales().isEmpty() && values.userSetLocale) { if (mSupportedSystemLocales == null) { mSupportedSystemLocales = Resources.getSystem().getAssets().getLocales(); } final Locale locale = values.getLocales().getBestMatch(mSupportedSystemLocales); SystemProperties.set("persist.sys.locale", locale.toLanguageTag()); mHandler.sendMessage(mHandler.obtainMessage(SEND_LOCALE_TO_MOUNT_DAEMON_MSG, values.locale)); locale)); } mConfigurationSeq++;