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

Commit ae1a8fdf authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Disable resource multilocale support" into main

parents 1e28cdfa 4e4e5d41
Loading
Loading
Loading
Loading
+20 −35
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import android.annotation.PluralsRes;
import android.annotation.RawRes;
import android.annotation.StyleRes;
import android.annotation.StyleableRes;
import android.app.ResourcesManager;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.pm.ActivityInfo;
import android.content.pm.ActivityInfo.Config;
@@ -430,7 +429,6 @@ public class ResourcesImpl {
                if ((configChanges & ActivityInfo.CONFIG_LOCALE) != 0) {
                    if (locales.size() > 1) {
                        String[] availableLocales;
                        if (ResourcesManager.getInstance().getLocaleList().isEmpty()) {
                        // The LocaleList has changed. We must query the AssetManager's
                        // available Locales and figure out the best matching Locale in the new
                        // LocaleList.
@@ -455,24 +453,11 @@ public class ResourcesImpl {
                                }
                            }
                        }
                        } else {
                            selectedLocales = locales.getIntersection(
                                    ResourcesManager.getInstance().getLocaleList());
                            defaultLocale = ResourcesManager.getInstance()
                                    .getLocaleList().get(0).toLanguageTag();
                        }
                    }
                }
                if (selectedLocales == null) {
                    if (ResourcesManager.getInstance().getLocaleList().isEmpty()) {
                    selectedLocales = new String[]{
                            adjustLanguageTag(locales.get(0).toLanguageTag())};
                    } else {
                        selectedLocales = new String[locales.size()];
                        for (int i = 0; i < locales.size(); i++) {
                            selectedLocales[i] = adjustLanguageTag(locales.get(i).toLanguageTag());
                        }
                    }
                }

                if (mConfiguration.densityDpi != Configuration.DENSITY_DPI_UNDEFINED) {