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

Commit ffde524a authored by Chris Tate's avatar Chris Tate Committed by Automerger Merge Worker
Browse files

Merge "Revert "Revoke 'always' web handler status when not autoverifying""...

Merge "Revert "Revoke 'always' web handler status when not autoverifying"" into rvc-dev am: 7f7dff72

Change-Id: I57cb4cea9207a7f54186bb9bd7dbfed86c307985
parents 6da12f97 7f7dff72
Loading
Loading
Loading
Loading
+12 −33
Original line number Diff line number Diff line
@@ -17534,31 +17534,26 @@ public class PackageManagerService extends IPackageManager.Stub
                + " Activities needs verification ...");
        int count = 0;
        boolean handlesWebUris = false;
        final boolean alreadyVerified;
        synchronized (mLock) {
            // If this is a new install and we see that we've already run verification for this
            // package, we have nothing to do: it means the state was restored from backup.
            final IntentFilterVerificationInfo ivi =
            if (!replacing) {
                IntentFilterVerificationInfo ivi =
                        mSettings.getIntentFilterVerificationLPr(packageName);
            alreadyVerified = (ivi != null);
            if (!replacing && alreadyVerified) {
                if (ivi != null) {
                    if (DEBUG_DOMAIN_VERIFICATION) {
                        Slog.i(TAG, "Package " + packageName+ " already verified: status="
                                + ivi.getStatusString());
                    }
                    return;
                }
            }
            // If any filters need to be verified, then all need to be.  In addition, we need to
            // know whether an updating app has any web navigation intent filters, to re-
            // examine handling policy even if not re-verifying.
            // If any filters need to be verified, then all need to be.
            boolean needToVerify = false;
            for (ParsedActivity a : activities) {
                for (ParsedIntentInfo filter : a.getIntents()) {
                    if (filter.handlesWebUris(true)) {
                        handlesWebUris = true;
                    }
                    if (filter.needsVerification()
                            && needsNetworkVerificationLPr(a.getPackageName())) {
                        if (DEBUG_DOMAIN_VERIFICATION) {
@@ -17566,17 +17561,11 @@ public class PackageManagerService extends IPackageManager.Stub
                                    "Intent filter needs verification, so processing all filters");
                        }
                        needToVerify = true;
                        // It's safe to break out here because filter.needsVerification()
                        // can only be true if filter.handlesWebUris(true) returns true, so
                        // we've already noted that.
                        break;
                    }
                }
            }
            // Note whether this app publishes any web navigation handling support at all,
            // and whether there are any web-nav filters that fit the profile for running
            // a verification pass now.
            if (needToVerify) {
                final int verificationId = mIntentFilterVerificationToken++;
                for (ParsedActivity a : activities) {
@@ -17595,23 +17584,13 @@ public class PackageManagerService extends IPackageManager.Stub
        }
        if (count > 0) {
            // count > 0 means that we're running a full verification pass
            if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, "Starting " + count
                    + " IntentFilter verification" + (count > 1 ? "s" : "")
                    +  " for userId:" + userId);
            mIntentFilterVerifier.startVerifications(userId);
        } else if (alreadyVerified && handlesWebUris) {
            // App used autoVerify in the past, no longer does, but still handles web
            // navigation starts.
            if (DEBUG_DOMAIN_VERIFICATION) {
                Slog.d(TAG, "App changed web filters but no longer verifying - resetting policy");
            }
            synchronized (mLock) {
                clearIntentFilterVerificationsLPw(packageName, userId);
            }
        } else {
            if (DEBUG_DOMAIN_VERIFICATION) {
                Slog.d(TAG, "No web filters or no prior verify policy for " + packageName);
                Slog.d(TAG, "No filters or not all autoVerify for " + packageName);
            }
        }
    }
+0 −1
Original line number Diff line number Diff line
@@ -1291,7 +1291,6 @@ public final class Settings {
            return false;
        }
        ps.clearDomainVerificationStatusForUser(userId);
        ps.setIntentFilterVerificationInfo(null);
        return true;
    }