Loading services/core/java/com/android/server/pm/InstallPackageHelper.java +16 −15 Original line number Diff line number Diff line Loading @@ -2242,6 +2242,7 @@ 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); Loading @@ -2261,25 +2262,11 @@ final class InstallPackageHelper { } // Enabling fs-verity is a blocking operation. To reduce the impact to the install time, // run in a background thread. final ArrayList<String> apkPaths = new ArrayList<>(); // collect the files to later enable in a background thread. apkPaths.add(pkg.getBaseApkPath()); if (pkg.getSplitCodePaths() != null) { Collections.addAll(apkPaths, pkg.getSplitCodePaths()); } mInjector.getBackgroundHandler().post(() -> { try { for (String path : apkPaths) { 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); } }); // Hardcode previousAppId to 0 to disable any data migration (http://b/221088088) mAppDataHelper.prepareAppDataPostCommitLIF(pkg, 0); Loading Loading @@ -2393,6 +2380,20 @@ final class InstallPackageHelper { } PackageManagerServiceUtils.waitForNativeBinariesExtractionForIncremental( incrementalStorages); mInjector.getBackgroundHandler().post(() -> { for (String path : apkPaths) { if (!VerityUtils.hasFsverity(path)) { try { 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 " + path); } } } }); } Pair<Integer, String> verifyReplacingVersionCode(PackageInfoLite pkgLite, Loading Loading
services/core/java/com/android/server/pm/InstallPackageHelper.java +16 −15 Original line number Diff line number Diff line Loading @@ -2242,6 +2242,7 @@ 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); Loading @@ -2261,25 +2262,11 @@ final class InstallPackageHelper { } // Enabling fs-verity is a blocking operation. To reduce the impact to the install time, // run in a background thread. final ArrayList<String> apkPaths = new ArrayList<>(); // collect the files to later enable in a background thread. apkPaths.add(pkg.getBaseApkPath()); if (pkg.getSplitCodePaths() != null) { Collections.addAll(apkPaths, pkg.getSplitCodePaths()); } mInjector.getBackgroundHandler().post(() -> { try { for (String path : apkPaths) { 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); } }); // Hardcode previousAppId to 0 to disable any data migration (http://b/221088088) mAppDataHelper.prepareAppDataPostCommitLIF(pkg, 0); Loading Loading @@ -2393,6 +2380,20 @@ final class InstallPackageHelper { } PackageManagerServiceUtils.waitForNativeBinariesExtractionForIncremental( incrementalStorages); mInjector.getBackgroundHandler().post(() -> { for (String path : apkPaths) { if (!VerityUtils.hasFsverity(path)) { try { 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 " + path); } } } }); } Pair<Integer, String> verifyReplacingVersionCode(PackageInfoLite pkgLite, Loading