Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 834e5c34 authored by Sally's avatar Sally
Browse files

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
parent 16b02d48
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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;