Loading apct-tests/perftests/core/src/android/app/ResourcesManagerPerfTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class ResourcesManagerPerfTest { } private void getResourcesForPath(String path) { ResourcesManager.getInstance().getResources(null, path, null, null, null, ResourcesManager.getInstance().getResources(null, path, null, null, null, null, Display.DEFAULT_DISPLAY, null, sContext.getResources().getCompatibilityInfo(), null, null); } Loading apct-tests/perftests/core/src/android/app/ResourcesThemePerfTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -95,8 +95,9 @@ public class ResourcesThemePerfTest { ? Configuration.ORIENTATION_LANDSCAPE : Configuration.ORIENTATION_PORTRAIT; Resources destResources = resourcesManager.getResources(null, ai.sourceDir, ai.splitSourceDirs, ai.resourceDirs, ai.sharedLibraryFiles, Display.DEFAULT_DISPLAY, c, mContext.getResources().getCompatibilityInfo(), null, null); ai.splitSourceDirs, ai.resourceDirs, ai.overlayPaths, ai.sharedLibraryFiles, Display.DEFAULT_DISPLAY, c, mContext.getResources().getCompatibilityInfo(), null, null); Assert.assertNotEquals(destResources.getAssets(), mContext.getAssets()); Resources.Theme destTheme = destResources.newTheme(); Loading core/java/android/app/ActivityThread.java +13 −9 Original line number Diff line number Diff line Loading @@ -2289,11 +2289,12 @@ public final class ActivityThread extends ClientTransactionHandler { * Creates the top level resources for the given package. Will return an existing * Resources if one has already been created. */ Resources getTopLevelResources(String resDir, String[] splitResDirs, String[] overlayDirs, String[] libDirs, LoadedApk pkgInfo, Configuration overrideConfig) { return mResourcesManager.getResources(null, resDir, splitResDirs, overlayDirs, libDirs, null, overrideConfig, pkgInfo.getCompatibilityInfo(), pkgInfo.getClassLoader(), null); Resources getTopLevelResources(String resDir, String[] splitResDirs, String[] legacyOverlayDirs, String[] overlayPaths, String[] libDirs, LoadedApk pkgInfo, Configuration overrideConfig) { return mResourcesManager.getResources(null, resDir, splitResDirs, legacyOverlayDirs, overlayPaths, libDirs, null, overrideConfig, pkgInfo.getCompatibilityInfo(), pkgInfo.getClassLoader(), null); } @UnsupportedAppUsage Loading Loading @@ -2462,12 +2463,15 @@ public final class ActivityThread extends ClientTransactionHandler { private static boolean isLoadedApkResourceDirsUpToDate(LoadedApk loadedApk, ApplicationInfo appInfo) { Resources packageResources = loadedApk.mResources; String[] overlayDirs = ArrayUtils.defeatNullable(loadedApk.getOverlayDirs()); String[] resourceDirs = ArrayUtils.defeatNullable(appInfo.resourceDirs); boolean resourceDirsUpToDate = Arrays.equals( ArrayUtils.defeatNullable(appInfo.resourceDirs), ArrayUtils.defeatNullable(loadedApk.getOverlayDirs())); boolean overlayPathsUpToDate = Arrays.equals( ArrayUtils.defeatNullable(appInfo.overlayPaths), ArrayUtils.defeatNullable(loadedApk.getOverlayPaths())); return (packageResources == null || packageResources.getAssets().isUpToDate()) && overlayDirs.length == resourceDirs.length && ArrayUtils.containsAll(overlayDirs, resourceDirs); && resourceDirsUpToDate && overlayPathsUpToDate; } @UnsupportedAppUsage Loading core/java/android/app/ApplicationPackageManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1728,7 +1728,7 @@ public class ApplicationPackageManager extends PackageManager { final Resources r = mContext.mMainThread.getTopLevelResources( sameUid ? app.sourceDir : app.publicSourceDir, sameUid ? app.splitSourceDirs : app.splitPublicSourceDirs, app.resourceDirs, app.sharedLibraryFiles, app.resourceDirs, app.overlayPaths, app.sharedLibraryFiles, mContext.mPackageInfo, configuration); if (r != null) { return r; Loading core/java/android/app/ContextImpl.java +6 −2 Original line number Diff line number Diff line Loading @@ -2345,6 +2345,7 @@ class ContextImpl extends Context { pi.getResDir(), splitResDirs, pi.getOverlayDirs(), pi.getOverlayPaths(), pi.getApplicationInfo().sharedLibraryFiles, overrideDisplayId, overrideConfig, Loading Loading @@ -2442,6 +2443,7 @@ class ContextImpl extends Context { mPackageInfo.getResDir(), paths, mPackageInfo.getOverlayDirs(), mPackageInfo.getOverlayPaths(), mPackageInfo.getApplicationInfo().sharedLibraryFiles, mForceDisplayOverrideInResources ? getDisplayId() : null, null, Loading Loading @@ -2558,7 +2560,8 @@ class ContextImpl extends Context { Resources createWindowContextResources() { final String resDir = mPackageInfo.getResDir(); final String[] splitResDirs = mPackageInfo.getSplitResDirs(); final String[] overlayDirs = mPackageInfo.getOverlayDirs(); final String[] legacyOverlayDirs = mPackageInfo.getOverlayDirs(); final String[] overlayPaths = mPackageInfo.getOverlayPaths(); final String[] libDirs = mPackageInfo.getApplicationInfo().sharedLibraryFiles; final int displayId = getDisplayId(); final CompatibilityInfo compatInfo = (displayId == Display.DEFAULT_DISPLAY) Loading @@ -2567,7 +2570,7 @@ class ContextImpl extends Context { final List<ResourcesLoader> loaders = mResources.getLoaders(); return mResourcesManager.createBaseTokenResources(mToken, resDir, splitResDirs, overlayDirs, libDirs, displayId, null /* overrideConfig */, legacyOverlayDirs, overlayPaths, libDirs, displayId, null /* overrideConfig */, compatInfo, mClassLoader, loaders); } Loading Loading @@ -2855,6 +2858,7 @@ class ContextImpl extends Context { packageInfo.getResDir(), splitDirs, packageInfo.getOverlayDirs(), packageInfo.getOverlayPaths(), packageInfo.getApplicationInfo().sharedLibraryFiles, displayId, overrideConfiguration, Loading Loading
apct-tests/perftests/core/src/android/app/ResourcesManagerPerfTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class ResourcesManagerPerfTest { } private void getResourcesForPath(String path) { ResourcesManager.getInstance().getResources(null, path, null, null, null, ResourcesManager.getInstance().getResources(null, path, null, null, null, null, Display.DEFAULT_DISPLAY, null, sContext.getResources().getCompatibilityInfo(), null, null); } Loading
apct-tests/perftests/core/src/android/app/ResourcesThemePerfTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -95,8 +95,9 @@ public class ResourcesThemePerfTest { ? Configuration.ORIENTATION_LANDSCAPE : Configuration.ORIENTATION_PORTRAIT; Resources destResources = resourcesManager.getResources(null, ai.sourceDir, ai.splitSourceDirs, ai.resourceDirs, ai.sharedLibraryFiles, Display.DEFAULT_DISPLAY, c, mContext.getResources().getCompatibilityInfo(), null, null); ai.splitSourceDirs, ai.resourceDirs, ai.overlayPaths, ai.sharedLibraryFiles, Display.DEFAULT_DISPLAY, c, mContext.getResources().getCompatibilityInfo(), null, null); Assert.assertNotEquals(destResources.getAssets(), mContext.getAssets()); Resources.Theme destTheme = destResources.newTheme(); Loading
core/java/android/app/ActivityThread.java +13 −9 Original line number Diff line number Diff line Loading @@ -2289,11 +2289,12 @@ public final class ActivityThread extends ClientTransactionHandler { * Creates the top level resources for the given package. Will return an existing * Resources if one has already been created. */ Resources getTopLevelResources(String resDir, String[] splitResDirs, String[] overlayDirs, String[] libDirs, LoadedApk pkgInfo, Configuration overrideConfig) { return mResourcesManager.getResources(null, resDir, splitResDirs, overlayDirs, libDirs, null, overrideConfig, pkgInfo.getCompatibilityInfo(), pkgInfo.getClassLoader(), null); Resources getTopLevelResources(String resDir, String[] splitResDirs, String[] legacyOverlayDirs, String[] overlayPaths, String[] libDirs, LoadedApk pkgInfo, Configuration overrideConfig) { return mResourcesManager.getResources(null, resDir, splitResDirs, legacyOverlayDirs, overlayPaths, libDirs, null, overrideConfig, pkgInfo.getCompatibilityInfo(), pkgInfo.getClassLoader(), null); } @UnsupportedAppUsage Loading Loading @@ -2462,12 +2463,15 @@ public final class ActivityThread extends ClientTransactionHandler { private static boolean isLoadedApkResourceDirsUpToDate(LoadedApk loadedApk, ApplicationInfo appInfo) { Resources packageResources = loadedApk.mResources; String[] overlayDirs = ArrayUtils.defeatNullable(loadedApk.getOverlayDirs()); String[] resourceDirs = ArrayUtils.defeatNullable(appInfo.resourceDirs); boolean resourceDirsUpToDate = Arrays.equals( ArrayUtils.defeatNullable(appInfo.resourceDirs), ArrayUtils.defeatNullable(loadedApk.getOverlayDirs())); boolean overlayPathsUpToDate = Arrays.equals( ArrayUtils.defeatNullable(appInfo.overlayPaths), ArrayUtils.defeatNullable(loadedApk.getOverlayPaths())); return (packageResources == null || packageResources.getAssets().isUpToDate()) && overlayDirs.length == resourceDirs.length && ArrayUtils.containsAll(overlayDirs, resourceDirs); && resourceDirsUpToDate && overlayPathsUpToDate; } @UnsupportedAppUsage Loading
core/java/android/app/ApplicationPackageManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1728,7 +1728,7 @@ public class ApplicationPackageManager extends PackageManager { final Resources r = mContext.mMainThread.getTopLevelResources( sameUid ? app.sourceDir : app.publicSourceDir, sameUid ? app.splitSourceDirs : app.splitPublicSourceDirs, app.resourceDirs, app.sharedLibraryFiles, app.resourceDirs, app.overlayPaths, app.sharedLibraryFiles, mContext.mPackageInfo, configuration); if (r != null) { return r; Loading
core/java/android/app/ContextImpl.java +6 −2 Original line number Diff line number Diff line Loading @@ -2345,6 +2345,7 @@ class ContextImpl extends Context { pi.getResDir(), splitResDirs, pi.getOverlayDirs(), pi.getOverlayPaths(), pi.getApplicationInfo().sharedLibraryFiles, overrideDisplayId, overrideConfig, Loading Loading @@ -2442,6 +2443,7 @@ class ContextImpl extends Context { mPackageInfo.getResDir(), paths, mPackageInfo.getOverlayDirs(), mPackageInfo.getOverlayPaths(), mPackageInfo.getApplicationInfo().sharedLibraryFiles, mForceDisplayOverrideInResources ? getDisplayId() : null, null, Loading Loading @@ -2558,7 +2560,8 @@ class ContextImpl extends Context { Resources createWindowContextResources() { final String resDir = mPackageInfo.getResDir(); final String[] splitResDirs = mPackageInfo.getSplitResDirs(); final String[] overlayDirs = mPackageInfo.getOverlayDirs(); final String[] legacyOverlayDirs = mPackageInfo.getOverlayDirs(); final String[] overlayPaths = mPackageInfo.getOverlayPaths(); final String[] libDirs = mPackageInfo.getApplicationInfo().sharedLibraryFiles; final int displayId = getDisplayId(); final CompatibilityInfo compatInfo = (displayId == Display.DEFAULT_DISPLAY) Loading @@ -2567,7 +2570,7 @@ class ContextImpl extends Context { final List<ResourcesLoader> loaders = mResources.getLoaders(); return mResourcesManager.createBaseTokenResources(mToken, resDir, splitResDirs, overlayDirs, libDirs, displayId, null /* overrideConfig */, legacyOverlayDirs, overlayPaths, libDirs, displayId, null /* overrideConfig */, compatInfo, mClassLoader, loaders); } Loading Loading @@ -2855,6 +2858,7 @@ class ContextImpl extends Context { packageInfo.getResDir(), splitDirs, packageInfo.getOverlayDirs(), packageInfo.getOverlayPaths(), packageInfo.getApplicationInfo().sharedLibraryFiles, displayId, overrideConfiguration, Loading