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

Commit 153f66fb authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix "Allow the system AssetManager to be reinitialized for testing""

parents 27682191 3286a5f6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ public final class AssetManager implements AutoCloseable {
    @VisibleForTesting
    public static void createSystemAssetsInZygoteLocked(boolean reinitialize,
            String frameworkPath) {
        if (sSystem != null || reinitialize) {
        if (sSystem != null && !reinitialize) {
            return;
        }

@@ -225,7 +225,9 @@ public final class AssetManager implements AutoCloseable {

            sSystemApkAssetsSet = new ArraySet<>(apkAssets);
            sSystemApkAssets = apkAssets.toArray(new ApkAssets[apkAssets.size()]);
            if (sSystem == null) {
                sSystem = new AssetManager(true /*sentinel*/);
            }
            sSystem.setApkAssets(sSystemApkAssets, false /*invalidateCaches*/);
        } catch (IOException e) {
            throw new IllegalStateException("Failed to create system AssetManager", e);