diff options
| author | 2020-03-20 18:33:28 +0000 | |
|---|---|---|
| committer | 2020-03-30 17:50:48 +0000 | |
| commit | 8cd8797876e5e6feae4bc6b5d407e594db2d2eec (patch) | |
| tree | 08a6596f6f4d31505b16d7f2bfa519e4cf996aac | |
| parent | ef5220e5b2a4b90d4260eb058475fdcdf30d861d (diff) | |
Revert "Revoke 'always' web handler status when not autoverifying"
This reverts commit ef5220e5b2a4b90d4260eb058475fdcdf30d861d.
Reason for revert: Inadvertently broke link handling stickiness even for well behaved apps
Bug: 146204120
Test: install app that handles web urls; set to 'always' in Settings;
install same apk again. Verify that app is still in 'always' state via
'adb shell dumpsys package d'
Merged-In: Ife6cd66e0bae5738c08962a8fa9397973e33f28e
Merged-In: If9046cb420961b8ef0333e9f1115eb69fb92242e
Change-Id: I2b108064794b961904811c5d9f54c37dd2c7f482
| -rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 44 | ||||
| -rw-r--r-- | services/core/java/com/android/server/pm/Settings.java | 1 |
2 files changed, 11 insertions, 34 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 599753b024ce..bf1da5625857 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -19061,47 +19061,35 @@ public class PackageManagerService extends IPackageManager.Stub int count = 0; final String packageName = pkg.packageName; - boolean handlesWebUris = false; - final boolean alreadyVerified; synchronized (mPackages) { // 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 = - mSettings.getIntentFilterVerificationLPr(packageName); - alreadyVerified = (ivi != null); - if (!replacing && alreadyVerified) { - if (DEBUG_DOMAIN_VERIFICATION) { - Slog.i(TAG, "Package " + packageName + " already verified: status=" - + ivi.getStatusString()); + if (!replacing) { + IntentFilterVerificationInfo ivi = + mSettings.getIntentFilterVerificationLPr(packageName); + if (ivi != null) { + if (DEBUG_DOMAIN_VERIFICATION) { + Slog.i(TAG, "Package " + packageName+ " already verified: status=" + + ivi.getStatusString()); + } + return; } - 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 (PackageParser.Activity a : pkg.activities) { for (ActivityIntentInfo filter : a.intents) { - if (filter.handlesWebUris(true)) { - handlesWebUris = true; - } if (filter.needsVerification() && needsNetworkVerificationLPr(filter)) { if (DEBUG_DOMAIN_VERIFICATION) { Slog.d(TAG, "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 (PackageParser.Activity a : pkg.activities) { @@ -19119,23 +19107,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 (mPackages) { - 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); } } } diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java index 0e1f3c295784..56835f69a3c7 100644 --- a/services/core/java/com/android/server/pm/Settings.java +++ b/services/core/java/com/android/server/pm/Settings.java @@ -1380,7 +1380,6 @@ final class Settings { return false; } ps.clearDomainVerificationStatusForUser(userId); - ps.setIntentFilterVerificationInfo(null); return true; } |