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

Commit 03a0c6c7 authored by Victor Hsieh's avatar Victor Hsieh
Browse files

Enable fs-verity in background thread

This is another attempt to reduce the install time impact.

Bug: 259179666
Test: m
Change-Id: I964f463e7c2e03fcce3b0865f1a7062f2b28f5b9
parent c2665dd8
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -2228,6 +2228,10 @@ final class InstallPackageHelper {
                incrementalStorages.add(storage);
            }

            // Enabling fs-verity is a blocking operation. To reduce the impact to the install time,
            // run in a background thread.
            new Thread("fsverity-setup") {
                @Override public void run() {
                    try {
                        if (!VerityUtils.hasFsverity(pkg.getBaseApkPath())) {
                            VerityUtils.setUpFsverity(pkg.getBaseApkPath(), (byte[]) null);
@@ -2242,6 +2246,8 @@ final class InstallPackageHelper {
                        // optional, just ignore the error for now.
                        Slog.e(TAG, "Failed to fully enable fs-verity to " + packageName);
                    }
                }
            }.start();

            // Hardcode previousAppId to 0 to disable any data migration (http://b/221088088)
            mAppDataHelper.prepareAppDataPostCommitLIF(pkg, 0);