For Force Bold Text, adjust the configuration between users

When the user changes, populate the global config with the current
user's setting state. For new users, don't keep the previous user's
preference

Test: manual, switched between users
Bug: b/110991537
Change-Id: Iae412bccd64784a597ed8d493f1bda4984841cac
This commit is contained in:
Sally
2020-09-28 23:02:42 +00:00
parent 16b02d4899
commit 834e5c3410

View File

@@ -3567,6 +3567,9 @@ public final class Settings {
if (outConfig.fontScale < 0) {
outConfig.fontScale = DEFAULT_FONT_SCALE;
}
outConfig.forceBoldText = Settings.Secure.getIntForUser(
cr, Settings.Secure.FORCE_BOLD_TEXT, Configuration.FORCE_BOLD_TEXT_NO,
userHandle);
final String localeValue =
Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
@@ -3597,6 +3600,7 @@ public final class Settings {
if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
inoutConfig.clearLocales();
}
inoutConfig.forceBoldText = Configuration.FORCE_BOLD_TEXT_UNDEFINED;
}
/**
@@ -3620,7 +3624,11 @@ public final class Settings {
DEFAULT_OVERRIDEABLE_BY_RESTORE);
}
/** @hide */
/**
* Convenience function for checking if settings should be overwritten with config changes.
* @see #putConfigurationForUser(ContentResolver, Configuration, int)
* @hide
*/
public static boolean hasInterestingConfigurationChanges(int changes) {
return (changes & ActivityInfo.CONFIG_FONT_SCALE) != 0 ||
(changes & ActivityInfo.CONFIG_LOCALE) != 0;