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

Commit 22a20891 authored by M Krzak's avatar M Krzak
Browse files

Allow font scaling setting persist

This hopefully fixes issue 3530. Bugs intruduced by previous commits, i.e.:
- font not visible if user preference for scaling has not been set
- font not visible for dialog (Volume dialog, toasts etc.)
should be fixed now. I have tested that commit quite extensively yet please
check if it doesn't introduce any unnoticed bugs before merging.

Change-Id: I67c28acd9629129d3f3b76177a063327529725ac
parent 4037deda
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
     * Set this object to the system defaults.
     */
    public void setToDefaults() {
        fontScale = 1;
        fontScale = 0;
        mcc = mnc = 0;
        locale = null;
        userSetLocale = false;
+3 −0
Original line number Diff line number Diff line
@@ -1305,6 +1305,9 @@ public class Resources {
                mMetrics.updateMetrics(mCompatibilityInfo,
                        mConfiguration.orientation, mConfiguration.screenLayout);
            }
            if (mConfiguration.fontScale <= 0 ) {
                mConfiguration.fontScale = 1;
            }
            mMetrics.scaledDensity = mMetrics.density * mConfiguration.fontScale;

            String locale = null;
+1 −1
Original line number Diff line number Diff line
@@ -1081,7 +1081,7 @@ public final class Settings {
        public static void getConfiguration(ContentResolver cr, Configuration outConfig) {
            outConfig.fontScale = Settings.System.getFloat(
                cr, FONT_SCALE, outConfig.fontScale);
            if (outConfig.fontScale < 0) {
            if (outConfig.fontScale <= 0) {
                outConfig.fontScale = 1;
            }
        }