Loading core/java/android/provider/Settings.java +23 −2 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import android.text.TextUtils; import android.util.AndroidException; import android.util.ArrayMap; import android.util.ArraySet; import android.util.LocaleList; import android.util.Log; import com.android.internal.util.ArrayUtils; Loading Loading @@ -2071,6 +2072,8 @@ public final class Settings { if (outConfig.fontScale < 0) { outConfig.fontScale = 1; } outConfig.setLocales(LocaleList.forLanguageTags( Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle))); } /** Loading @@ -2079,6 +2082,9 @@ public final class Settings { */ public static void clearConfiguration(Configuration inoutConfig) { inoutConfig.fontScale = 0; if (!inoutConfig.userSetLocale) { inoutConfig.setLocales(LocaleList.getEmptyLocaleList()); } } /** Loading @@ -2096,12 +2102,15 @@ public final class Settings { /** @hide */ public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle) { return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle); return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && Settings.System.putStringForUser( cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle); } /** @hide */ public static boolean hasInterestingConfigurationChanges(int changes) { return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0; return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || (changes & ActivityInfo.CONFIG_LOCALE) != 0; } /** @deprecated - Do not use */ Loading Loading @@ -2479,6 +2488,18 @@ public final class Settings { } }; /** * The serialized system locale value. * * Do not use this value directory. * To get system locale, use {@link android.util.LocaleList#getDefault} instead. * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} * instead. * @hide */ public static final String SYSTEM_LOCALES = "system_locales"; /** * Name of an application package to be debugged. * Loading core/java/com/android/internal/app/LocalePicker.java +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ public class LocalePicker extends ListFragment { config.setLocales(locales); config.userSetLocale = true; am.updateConfiguration(config); am.updatePersistentConfiguration(config); // Trigger the dirty bit for the Settings Provider. BackupManager.dataChanged("com.android.providers.settings"); } catch (RemoteException e) { Loading Loading
core/java/android/provider/Settings.java +23 −2 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import android.text.TextUtils; import android.util.AndroidException; import android.util.ArrayMap; import android.util.ArraySet; import android.util.LocaleList; import android.util.Log; import com.android.internal.util.ArrayUtils; Loading Loading @@ -2071,6 +2072,8 @@ public final class Settings { if (outConfig.fontScale < 0) { outConfig.fontScale = 1; } outConfig.setLocales(LocaleList.forLanguageTags( Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle))); } /** Loading @@ -2079,6 +2082,9 @@ public final class Settings { */ public static void clearConfiguration(Configuration inoutConfig) { inoutConfig.fontScale = 0; if (!inoutConfig.userSetLocale) { inoutConfig.setLocales(LocaleList.getEmptyLocaleList()); } } /** Loading @@ -2096,12 +2102,15 @@ public final class Settings { /** @hide */ public static boolean putConfigurationForUser(ContentResolver cr, Configuration config, int userHandle) { return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle); return Settings.System.putFloatForUser(cr, FONT_SCALE, config.fontScale, userHandle) && Settings.System.putStringForUser( cr, SYSTEM_LOCALES, config.getLocales().toLanguageTags(), userHandle); } /** @hide */ public static boolean hasInterestingConfigurationChanges(int changes) { return (changes&ActivityInfo.CONFIG_FONT_SCALE) != 0; return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 || (changes & ActivityInfo.CONFIG_LOCALE) != 0; } /** @deprecated - Do not use */ Loading Loading @@ -2479,6 +2488,18 @@ public final class Settings { } }; /** * The serialized system locale value. * * Do not use this value directory. * To get system locale, use {@link android.util.LocaleList#getDefault} instead. * To update system locale, use {@link com.android.internal.app.LocalePicker#updateLocales} * instead. * @hide */ public static final String SYSTEM_LOCALES = "system_locales"; /** * Name of an application package to be debugged. * Loading
core/java/com/android/internal/app/LocalePicker.java +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ public class LocalePicker extends ListFragment { config.setLocales(locales); config.userSetLocale = true; am.updateConfiguration(config); am.updatePersistentConfiguration(config); // Trigger the dirty bit for the Settings Provider. BackupManager.dataChanged("com.android.providers.settings"); } catch (RemoteException e) { Loading