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

Commit 8a412e0b authored by Roozbeh Pournader's avatar Roozbeh Pournader
Browse files

Fix null locale edge cases in Configuration and Resources

Previously, Configuration#setTo() would not copy a null locale, and
Resources#updateConfiguration() could fail if it was updated with a
configuration with a null locale or empty locale list.

Bug: 25874762
Change-Id: I76ef5769a16a5165b91c8e5ec5d926c67ef4f3c5
parent 47040d62
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -724,9 +724,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
        fontScale = o.fontScale;
        mcc = o.mcc;
        mnc = o.mnc;
        if (o.locale != null) {
            locale = (Locale) o.locale.clone();
        }
        locale = o.locale == null ? null : (Locale) o.locale.clone();
        o.fixUpLocaleList();
        mLocaleList = o.mLocaleList;
        userSetLocale = o.userSetLocale;
+1 −1
Original line number Diff line number Diff line
@@ -1988,7 +1988,7 @@ public class Resources {
        }
        synchronized (sSync) {
            if (mPluralRule != null) {
                mPluralRule = PluralRules.forLocale(config.getLocales().getPrimary());
                mPluralRule = PluralRules.forLocale(mConfiguration.getLocales().getPrimary());
            }
        }
    }