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

Commit 12917797 authored by Victor Hsieh's avatar Victor Hsieh Committed by Android (Google) Code Review
Browse files

Merge "Revert fs-verity for all APKs"

parents dff6a36c 76a3e548
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -2325,7 +2325,6 @@ final class InstallPackageHelper {
    @GuardedBy("mPm.mInstallLock")
    private void executePostCommitStepsLIF(List<ReconciledPackage> reconciledPackages) {
        final ArraySet<IncrementalStorage> incrementalStorages = new ArraySet<>();
        final ArrayList<String> apkPaths = new ArrayList<>();
        for (ReconciledPackage reconciledPkg : reconciledPackages) {
            final InstallRequest installRequest = reconciledPkg.mInstallRequest;
            final boolean instantApp = ((installRequest.getScanFlags() & SCAN_AS_INSTANT_APP) != 0);
@@ -2344,13 +2343,6 @@ final class InstallPackageHelper {
                incrementalStorages.add(storage);
            }

            // Enabling fs-verity is a blocking operation. To reduce the impact to the install time,
            // collect the files to later enable in a background thread.
            apkPaths.add(pkg.getBaseApkPath());
            if (pkg.getSplitCodePaths() != null) {
                Collections.addAll(apkPaths, pkg.getSplitCodePaths());
            }

            // Hardcode previousAppId to 0 to disable any data migration (http://b/221088088)
            mAppDataHelper.prepareAppDataPostCommitLIF(pkg, 0);
            if (installRequest.isClearCodeCache()) {
@@ -2479,20 +2471,6 @@ final class InstallPackageHelper {
        }
        PackageManagerServiceUtils.waitForNativeBinariesExtractionForIncremental(
                incrementalStorages);

        mInjector.getBackgroundHandler().post(() -> {
            for (String path : apkPaths) {
                if (!VerityUtils.hasFsverity(path)) {
                    try {
                        VerityUtils.setUpFsverity(path);
                    } catch (IOException e) {
                        // There's nothing we can do if the setup failed. Since fs-verity is
                        // optional, just ignore the error for now.
                        Slog.e(TAG, "Failed to fully enable fs-verity to " + path);
                    }
                }
            }
        });
    }

    Pair<Integer, String> verifyReplacingVersionCode(PackageInfoLite pkgLite,