summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Victor Hsieh <victorhsieh@google.com> 2022-11-30 23:18:13 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-11-30 23:18:13 +0000
commit627b85d9fc08cad96e1628779d01f9921316da49 (patch)
treee0d666c0d4949dc0836e78ffcc81d7ce1c1b2e78
parent4684ff1f676e3359aed40ba441c0fbc106dc17c1 (diff)
parentc6f0fa25ccbf7ee4ac21d9c0b21ba7d2cd0fc9ee (diff)
Merge "Revert "Enable fs-verity in background thread""
-rw-r--r--services/core/java/com/android/server/pm/InstallPackageHelper.java30
1 files changed, 12 insertions, 18 deletions
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index 3c720190fd66..283640d7613a 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -2259,26 +2259,20 @@ 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);
- }
- for (String path : pkg.getSplitCodePaths()) {
- if (!VerityUtils.hasFsverity(path)) {
- VerityUtils.setUpFsverity(path, (byte[]) null);
- }
- }
- } 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 " + packageName);
+ try {
+ if (!VerityUtils.hasFsverity(pkg.getBaseApkPath())) {
+ VerityUtils.setUpFsverity(pkg.getBaseApkPath(), (byte[]) null);
+ }
+ for (String path : pkg.getSplitCodePaths()) {
+ if (!VerityUtils.hasFsverity(path)) {
+ VerityUtils.setUpFsverity(path, (byte[]) null);
}
}
- }.start();
+ } 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 " + packageName);
+ }
// Hardcode previousAppId to 0 to disable any data migration (http://b/221088088)
mAppDataHelper.prepareAppDataPostCommitLIF(pkg, 0);