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

Commit 2e98a110 authored by Roozbeh Pournader's avatar Roozbeh Pournader Committed by Android (Google) Code Review
Browse files

Merge "Set the default locale list when it is changed."

parents 1fedd8c8 cada57a5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ import android.util.AndroidRuntimeException;
import android.util.ArrayMap;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.LocaleList;
import android.util.Log;
import android.util.LogPrinter;
import android.util.Pair;
@@ -128,7 +129,6 @@ import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.TimeZone;
@@ -4887,9 +4887,9 @@ public final class ActivityThread {
        TimeZone.setDefault(null);

        /*
         * Initialize the default locale in this process for the reasons we set the time zone.
         * Initialize the default locales in this process for the reasons we set the time zone.
         */
        Locale.setDefault(data.config.locale);
        LocaleList.setDefault(data.config.getLocales());

        /*
         * Update the system configuration since its preloaded and might not
+4 −3
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.content.res.ResourcesKey;
import android.hardware.display.DisplayManagerGlobal;
import android.util.ArrayMap;
import android.util.DisplayMetrics;
import android.util.LocaleList;
import android.util.Log;
import android.util.Pair;
import android.util.Slog;
@@ -34,7 +35,6 @@ import android.view.Display;
import android.view.DisplayAdjustments;

import java.lang.ref.WeakReference;
import java.util.Locale;

/** @hide */
public class ResourcesManager {
@@ -284,8 +284,9 @@ public class ResourcesManager {
        }

        // set it for java, this also affects newly created Resources
        if (config.locale != null) {
            Locale.setDefault(config.locale);
        final LocaleList localeList = config.getLocales();
        if (!localeList.isEmpty()) {
            LocaleList.setDefault(localeList);
        }

        Resources.updateSystemConfiguration(config, defaultDisplayMetrics, compat);