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

Commit 2c968557 authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

Do not canonicalize overlay config test paths

Some devices may not have certain partitions available and the
OverlayConfigTests use hardcoded paths to test OverlayConfig
functionality. This change ensures that the temporary directory
created to test OverlayConfig has all of the partitions defined in
PackagePartitions#SYSTEM_PARTITIONS within it.

Bug: 187020117
Bug: 187020675
Test: atest OverlayConfigTest
Change-Id: I511e24b7ccfe82e6e89ceea7107457439793ef77
parent 82cb76f9
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -119,6 +119,9 @@ public class PackagePartitions {
        @Nullable
        private final DeferredCanonicalFile mOverlayFolder;

        @NonNull
        private final File mNonConicalFolder;

        private SystemPartition(@NonNull File folder, @PartitionType int type,
                boolean containsPrivApp, boolean containsOverlay) {
            this.type = type;
@@ -128,6 +131,7 @@ public class PackagePartitions {
                    : null;
            this.mOverlayFolder = containsOverlay ? new DeferredCanonicalFile(folder, "overlay")
                    : null;
            this.mNonConicalFolder = folder;
        }

        public SystemPartition(@NonNull SystemPartition original) {
@@ -136,6 +140,7 @@ public class PackagePartitions {
            this.mAppFolder = original.mAppFolder;
            this.mPrivAppFolder = original.mPrivAppFolder;
            this.mOverlayFolder = original.mOverlayFolder;
            this.mNonConicalFolder = original.mNonConicalFolder;
        }

        /**
@@ -153,6 +158,12 @@ public class PackagePartitions {
            return mFolder.getFile();
        }

        /** Returns the non-canonical folder of the partition. */
        @NonNull
        public File getNonConicalFolder() {
            return mNonConicalFolder;
        }

        /** Returns the canonical app folder of the partition. */
        @Nullable
        public File getAppFolder() {
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ public class OverlayConfig {
            // Rebase the system partitions and settings file on the specified root directory.
            partitions = new ArrayList<>(PackagePartitions.getOrderedPartitions(
                    p -> new OverlayPartition(
                            new File(rootDirectory, p.getFolder().getPath()),
                            new File(rootDirectory, p.getNonConicalFolder().getPath()),
                            p)));
        }