Loading core/java/android/app/ActivityThread.java +20 −20 Original line number Diff line number Diff line Loading @@ -5077,26 +5077,6 @@ public final class ActivityThread { */ TimeZone.setDefault(null); synchronized (mResourcesManager) { /* * Initialize the default locales in this process for the reasons we set the time zone. * * We do this through ResourcesManager, since we need to do locale negotiation. */ mResourcesManager.setDefaultLocalesLocked(data.config.getLocales()); /* * Update the system configuration since its preloaded and might not * reflect configuration changes. The configuration object passed * in AppBindData can be safely assumed to be up to date */ mResourcesManager.applyConfigurationToResourcesLocked(data.config, data.compatInfo); mCurDefaultDisplayDpi = data.config.densityDpi; // This calls mResourcesManager so keep it within the synchronized block. applyCompatConfiguration(mCurDefaultDisplayDpi); } data.info = getPackageInfoNoCheck(data.appInfo, data.compatInfo); /** Loading Loading @@ -5221,6 +5201,26 @@ public final class ActivityThread { } final ContextImpl appContext = ContextImpl.createAppContext(this, data.info); synchronized (mResourcesManager) { /* * Initialize the default locales in this process for the reasons we set the time zone. * * We do this through ResourcesManager, since we need to do locale negotiation. */ mResourcesManager.setDefaultLocalesLocked(data.config.getLocales()); /* * Update the system configuration since its preloaded and might not * reflect configuration changes. The configuration object passed * in AppBindData can be safely assumed to be up to date */ mResourcesManager.applyConfigurationToResourcesLocked(data.config, data.compatInfo); mCurDefaultDisplayDpi = data.config.densityDpi; // This calls mResourcesManager so keep it within the synchronized block. applyCompatConfiguration(mCurDefaultDisplayDpi); } if (!Process.isIsolated() && !"android".equals(appContext.getPackageName())) { // This cache location probably points at credential-encrypted // storage which may not be accessible yet; assign it anyway instead Loading core/java/android/app/ResourcesManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ public class ResourcesManager { } }; private String[] mSystemLocales = {}; private String[] mSystemLocales = null; private final HashSet<String> mNonSystemLocales = new HashSet<>(); private boolean mHasNonSystemLocales = false; Loading Loading @@ -431,7 +431,7 @@ public class ResourcesManager { final boolean findSystemLocales; final boolean hasNonSystemLocales; synchronized (this) { findSystemLocales = (mSystemLocales.length == 0); findSystemLocales = (mSystemLocales == null || mSystemLocales.length == 0); hasNonSystemLocales = mHasNonSystemLocales; if (DEBUG) { Loading Loading @@ -483,7 +483,7 @@ public class ResourcesManager { LocaleList.isPseudoLocalesOnly(nonSystemLocales); synchronized (this) { if (mSystemLocales.length == 0) { if (mSystemLocales == null || mSystemLocales.length == 0) { mSystemLocales = systemLocales; } mNonSystemLocales.addAll(Arrays.asList(nonSystemLocales)); Loading Loading @@ -552,6 +552,9 @@ public class ResourcesManager { } /* package */ void setDefaultLocalesLocked(@NonNull LocaleList locales) { if (mSystemLocales == null) { throw new RuntimeException("ResourcesManager is not ready to negotiate locales."); } final int bestLocale; if (mHasNonSystemLocales) { bestLocale = locales.getFirstMatchIndexWithEnglishSupported(mNonSystemLocales); Loading Loading
core/java/android/app/ActivityThread.java +20 −20 Original line number Diff line number Diff line Loading @@ -5077,26 +5077,6 @@ public final class ActivityThread { */ TimeZone.setDefault(null); synchronized (mResourcesManager) { /* * Initialize the default locales in this process for the reasons we set the time zone. * * We do this through ResourcesManager, since we need to do locale negotiation. */ mResourcesManager.setDefaultLocalesLocked(data.config.getLocales()); /* * Update the system configuration since its preloaded and might not * reflect configuration changes. The configuration object passed * in AppBindData can be safely assumed to be up to date */ mResourcesManager.applyConfigurationToResourcesLocked(data.config, data.compatInfo); mCurDefaultDisplayDpi = data.config.densityDpi; // This calls mResourcesManager so keep it within the synchronized block. applyCompatConfiguration(mCurDefaultDisplayDpi); } data.info = getPackageInfoNoCheck(data.appInfo, data.compatInfo); /** Loading Loading @@ -5221,6 +5201,26 @@ public final class ActivityThread { } final ContextImpl appContext = ContextImpl.createAppContext(this, data.info); synchronized (mResourcesManager) { /* * Initialize the default locales in this process for the reasons we set the time zone. * * We do this through ResourcesManager, since we need to do locale negotiation. */ mResourcesManager.setDefaultLocalesLocked(data.config.getLocales()); /* * Update the system configuration since its preloaded and might not * reflect configuration changes. The configuration object passed * in AppBindData can be safely assumed to be up to date */ mResourcesManager.applyConfigurationToResourcesLocked(data.config, data.compatInfo); mCurDefaultDisplayDpi = data.config.densityDpi; // This calls mResourcesManager so keep it within the synchronized block. applyCompatConfiguration(mCurDefaultDisplayDpi); } if (!Process.isIsolated() && !"android".equals(appContext.getPackageName())) { // This cache location probably points at credential-encrypted // storage which may not be accessible yet; assign it anyway instead Loading
core/java/android/app/ResourcesManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ public class ResourcesManager { } }; private String[] mSystemLocales = {}; private String[] mSystemLocales = null; private final HashSet<String> mNonSystemLocales = new HashSet<>(); private boolean mHasNonSystemLocales = false; Loading Loading @@ -431,7 +431,7 @@ public class ResourcesManager { final boolean findSystemLocales; final boolean hasNonSystemLocales; synchronized (this) { findSystemLocales = (mSystemLocales.length == 0); findSystemLocales = (mSystemLocales == null || mSystemLocales.length == 0); hasNonSystemLocales = mHasNonSystemLocales; if (DEBUG) { Loading Loading @@ -483,7 +483,7 @@ public class ResourcesManager { LocaleList.isPseudoLocalesOnly(nonSystemLocales); synchronized (this) { if (mSystemLocales.length == 0) { if (mSystemLocales == null || mSystemLocales.length == 0) { mSystemLocales = systemLocales; } mNonSystemLocales.addAll(Arrays.asList(nonSystemLocales)); Loading Loading @@ -552,6 +552,9 @@ public class ResourcesManager { } /* package */ void setDefaultLocalesLocked(@NonNull LocaleList locales) { if (mSystemLocales == null) { throw new RuntimeException("ResourcesManager is not ready to negotiate locales."); } final int bestLocale; if (mHasNonSystemLocales) { bestLocale = locales.getFirstMatchIndexWithEnglishSupported(mNonSystemLocales); Loading