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

Commit c0c0e0ce authored by Victor Hsieh's avatar Victor Hsieh Committed by android-build-merger
Browse files

Merge "Skip legacy-fs-verity setup if file already has it" into qt-dev am:...

Merge "Skip legacy-fs-verity setup if file already has it" into qt-dev am: 4fd58706 am: 6ebd3bf5
am: 71cd9d66

Change-Id: I26226aa007bfa1126e0a4ba4870549b98646db89
parents a62010ac 71cd9d66
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -18056,9 +18056,15 @@ public class PackageManagerService extends IPackageManager.Stub
                if (Build.IS_DEBUGGABLE) Slog.i(TAG, "Enabling verity to " + filePath);
                final FileDescriptor fd = result.getUnownedFileDescriptor();
                try {
                    mInstaller.installApkVerity(filePath, fd, result.getContentSize());
                    final byte[] rootHash = VerityUtils.generateApkVerityRootHash(filePath);
                    try {
                        // A file may already have fs-verity, e.g. when reused during a split
                        // install. If the measurement succeeds, no need to attempt to set up.
                        mInstaller.assertFsverityRootHashMatches(filePath, rootHash);
                    } catch (InstallerException e) {
                        mInstaller.installApkVerity(filePath, fd, result.getContentSize());
                        mInstaller.assertFsverityRootHashMatches(filePath, rootHash);
                    }
                } finally {
                    IoUtils.closeQuietly(fd);
                }