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

Commit bd5cac67 authored by Seigo Nonaka's avatar Seigo Nonaka Committed by Roozbeh Pournader
Browse files

Clear locales without changing layout direction.

Calling Configuration.setLocales with emtpy LocaleList may change the
layout direction to LTR. To clear the locales in Configuration without
layout direction change, introduce hidden API to Configuration.

Bug: 28695661
Change-Id: I47c339dffb83099bd329ddb60237dab27b05f593
parent 31884efd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1484,6 +1484,16 @@ public final class Configuration implements Parcelable, Comparable<Configuration
        setLocales(loc == null ? LocaleList.getEmptyLocaleList() : new LocaleList(loc));
    }

    /**
     * @hide
     *
     * Clears the locale without changing layout direction.
     */
    public void clearLocales() {
        mLocaleList = LocaleList.getEmptyLocaleList();
        locale = null;
    }

    /**
     * Return the layout direction. Will be either {@link View#LAYOUT_DIRECTION_LTR} or
     * {@link View#LAYOUT_DIRECTION_RTL}.
+1 −1
Original line number Diff line number Diff line
@@ -2241,7 +2241,7 @@ public final class Settings {
        public static void clearConfiguration(Configuration inoutConfig) {
            inoutConfig.fontScale = 0;
            if (!inoutConfig.userSetLocale && !inoutConfig.getLocales().isEmpty()) {
                inoutConfig.setLocales(LocaleList.getEmptyLocaleList());
                inoutConfig.clearLocales();
            }
        }