Check if IncFs supports fs-verity before trying to enable it.

Bug: 181242243
Test: atest ApkVerityInstallTest
Change-Id: I70225bb8a231cd4c0a7236cb0d845d5c65046ebc
This commit is contained in:
Alex Buynytskyy
2021-02-25 19:47:49 -08:00
parent 66a4de0653
commit e8533f9194
2 changed files with 7 additions and 0 deletions

View File

@@ -58,6 +58,8 @@ public final class IncrementalManager {
private static final String ALLOWED_PROPERTY = "incremental.allowed";
public static final int MIN_VERSION_TO_SUPPORT_FSVERITY = 2;
public static final int CREATE_MODE_TEMPORARY_BIND =
IIncrementalService.CREATE_MODE_TEMPORARY_BIND;
public static final int CREATE_MODE_PERMANENT_BIND =

View File

@@ -20368,6 +20368,11 @@ public class PackageManagerService extends IPackageManager.Stub
return;
}
if (isIncrementalPath(pkg.getPath()) && IncrementalManager.getVersion()
< IncrementalManager.MIN_VERSION_TO_SUPPORT_FSVERITY) {
return;
}
// Collect files we care for fs-verity setup.
ArrayMap<String, String> fsverityCandidates = new ArrayMap<>();
if (legacyMode) {