Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-base: 提交

frameworks/base


Commit MetaInfo

修订版c3ad64222b2790b699d75cebccdeba40789c8251 (tree)
时间2020-09-11 19:04:19
作者Chris Tate <ctate@andr...>
CommiterVasyl Gello

Log Message

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

This reverts commit f697cd3b97b10a283c54b37d8448a011c570e2c6.

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: If9046cb420961b8ef0333e9f1115eb69fb92242e
Change-Id: I36d9c352e741e88b9fc773b084bef3991b6d96ed

更改概述

差异

--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -15565,47 +15565,35 @@ public class PackageManagerService extends IPackageManager.Stub {
1556515565 int count = 0;
1556615566 final String packageName = pkg.packageName;
1556715567
15568- boolean handlesWebUris = false;
15569- final boolean alreadyVerified;
1557015568 synchronized (mPackages) {
1557115569 // If this is a new install and we see that we've already run verification for this
1557215570 // package, we have nothing to do: it means the state was restored from backup.
15573- final IntentFilterVerificationInfo ivi =
15574- mSettings.getIntentFilterVerificationLPr(packageName);
15575- alreadyVerified = (ivi != null);
15576- if (!replacing && alreadyVerified) {
15577- if (DEBUG_DOMAIN_VERIFICATION) {
15578- Slog.i(TAG, "Package " + packageName + " already verified: status="
15579- + ivi.getStatusString());
15571+ if (!replacing) {
15572+ IntentFilterVerificationInfo ivi =
15573+ mSettings.getIntentFilterVerificationLPr(packageName);
15574+ if (ivi != null) {
15575+ if (DEBUG_DOMAIN_VERIFICATION) {
15576+ Slog.i(TAG, "Package " + packageName+ " already verified: status="
15577+ + ivi.getStatusString());
15578+ }
15579+ return;
1558015580 }
15581- return;
1558215581 }
1558315582
15584- // If any filters need to be verified, then all need to be. In addition, we need to
15585- // know whether an updating app has any web navigation intent filters, to re-
15586- // examine handling policy even if not re-verifying.
15583+ // If any filters need to be verified, then all need to be.
1558715584 boolean needToVerify = false;
1558815585 for (PackageParser.Activity a : pkg.activities) {
1558915586 for (ActivityIntentInfo filter : a.intents) {
15590- if (filter.handlesWebUris(true)) {
15591- handlesWebUris = true;
15592- }
1559315587 if (filter.needsVerification() && needsNetworkVerificationLPr(filter)) {
1559415588 if (DEBUG_DOMAIN_VERIFICATION) {
1559515589 Slog.d(TAG, "Intent filter needs verification, so processing all filters");
1559615590 }
1559715591 needToVerify = true;
15598- // It's safe to break out here because filter.needsVerification()
15599- // can only be true if filter.handlesWebUris(true) returns true, so
15600- // we've already noted that.
1560115592 break;
1560215593 }
1560315594 }
1560415595 }
1560515596
15606- // Note whether this app publishes any web navigation handling support at all,
15607- // and whether there are any web-nav filters that fit the profile for running
15608- // a verification pass now.
1560915597 if (needToVerify) {
1561015598 final int verificationId = mIntentFilterVerificationToken++;
1561115599 for (PackageParser.Activity a : pkg.activities) {
@@ -15625,23 +15613,13 @@ public class PackageManagerService extends IPackageManager.Stub {
1562515613 }
1562615614
1562715615 if (count > 0) {
15628- // count > 0 means that we're running a full verification pass
1562915616 if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, "Starting " + count
1563015617 + " IntentFilter verification" + (count > 1 ? "s" : "")
1563115618 + " for userId:" + userId);
1563215619 mIntentFilterVerifier.startVerifications(userId);
15633- } else if (alreadyVerified && handlesWebUris) {
15634- // App used autoVerify in the past, no longer does, but still handles web
15635- // navigation starts.
15636- if (DEBUG_DOMAIN_VERIFICATION) {
15637- Slog.d(TAG, "App changed web filters but no longer verifying - resetting policy");
15638- }
15639- synchronized (mPackages) {
15640- clearIntentFilterVerificationsLPw(packageName, userId);
15641- }
1564215620 } else {
1564315621 if (DEBUG_DOMAIN_VERIFICATION) {
15644- Slog.d(TAG, "No web filters or no prior verify policy for " + packageName);
15622+ Slog.d(TAG, "No filters or not all autoVerify for " + packageName);
1564515623 }
1564615624 }
1564715625 }
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -1331,7 +1331,6 @@ final class Settings {
13311331 return false;
13321332 }
13331333 ps.clearDomainVerificationStatusForUser(userId);
1334- ps.setIntentFilterVerificationInfo(null);
13351334 return true;
13361335 }
13371336
Show on old repository browser