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

Commit 3286a5f6 authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

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

The logic was incorrect and prevented the test from reinitializing
the system assets.

Bug: 136085555
Test: tradefed.sh
Change-Id: If95417d29a8a1110560b670900a53ff3db2604a2
parent 62121f1e
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);