Merge "Do not canonicalize overlay config test paths"

This commit is contained in:
Treehugger Robot
2021-06-04 17:04:49 +00:00
committed by Gerrit Code Review
2 changed files with 12 additions and 1 deletions

View File

@@ -119,6 +119,9 @@ public class PackagePartitions {
@Nullable @Nullable
private final DeferredCanonicalFile mOverlayFolder; private final DeferredCanonicalFile mOverlayFolder;
@NonNull
private final File mNonConicalFolder;
private SystemPartition(@NonNull File folder, @PartitionType int type, private SystemPartition(@NonNull File folder, @PartitionType int type,
boolean containsPrivApp, boolean containsOverlay) { boolean containsPrivApp, boolean containsOverlay) {
this.type = type; this.type = type;
@@ -128,6 +131,7 @@ public class PackagePartitions {
: null; : null;
this.mOverlayFolder = containsOverlay ? new DeferredCanonicalFile(folder, "overlay") this.mOverlayFolder = containsOverlay ? new DeferredCanonicalFile(folder, "overlay")
: null; : null;
this.mNonConicalFolder = folder;
} }
public SystemPartition(@NonNull SystemPartition original) { public SystemPartition(@NonNull SystemPartition original) {
@@ -136,6 +140,7 @@ public class PackagePartitions {
this.mAppFolder = original.mAppFolder; this.mAppFolder = original.mAppFolder;
this.mPrivAppFolder = original.mPrivAppFolder; this.mPrivAppFolder = original.mPrivAppFolder;
this.mOverlayFolder = original.mOverlayFolder; this.mOverlayFolder = original.mOverlayFolder;
this.mNonConicalFolder = original.mNonConicalFolder;
} }
/** /**
@@ -153,6 +158,12 @@ public class PackagePartitions {
return mFolder.getFile(); 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. */ /** Returns the canonical app folder of the partition. */
@Nullable @Nullable
public File getAppFolder() { public File getAppFolder() {

View File

@@ -111,7 +111,7 @@ public class OverlayConfig {
// Rebase the system partitions and settings file on the specified root directory. // Rebase the system partitions and settings file on the specified root directory.
partitions = new ArrayList<>(PackagePartitions.getOrderedPartitions( partitions = new ArrayList<>(PackagePartitions.getOrderedPartitions(
p -> new OverlayPartition( p -> new OverlayPartition(
new File(rootDirectory, p.getFolder().getPath()), new File(rootDirectory, p.getNonConicalFolder().getPath()),
p))); p)));
} }