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

Commit 4e4e5d41 authored by Jeremy Meyer's avatar Jeremy Meyer
Browse files

Disable resource multilocale support

Fixes: 298133983
Test: manual, presubmits
Change-Id: Ibd4d04e353288c5af27051ec39d1831a4e9c56c3
parent a2c45757
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) {