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

Commit ee27adfc authored by Songchun Fan's avatar Songchun Fan
Browse files

[Archiving] fix app links restoration

Prevent calling into DomainVerificationManager for pre-archived app
installations, which can cause restored app links data to be lost and
future app link verification results to be discarded.

BUG: 335232727
Test: manual with steps in go/archiving-and-settings

Change-Id: I2ef99a3f698a8abdd96263f7cdd78a1815cc7c71
parent e57410c1
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -573,6 +573,9 @@ final class InstallPackageHelper {
                    (scanFlags & SCAN_DONT_KILL_APP) != 0 /* retainImplicitGrantOnReplace */);
            mPm.addAllPackageProperties(pkg);

            // Only verify app links for non-archival installations, otherwise there won't be any
            // declared app links.
            if (!request.isArchived()) {
                if (oldPkgSetting == null || oldPkgSetting.getPkg() == null) {
                    mPm.mDomainVerificationManager.addPackage(pkgSetting,
                            request.getPreVerifiedDomains());
@@ -580,6 +583,7 @@ final class InstallPackageHelper {
                    mPm.mDomainVerificationManager.migrateState(oldPkgSetting, pkgSetting,
                            request.getPreVerifiedDomains());
                }
            }

            int collectionSize = ArrayUtils.size(pkg.getInstrumentations());
            StringBuilder r = null;