Revert "Revoke 'always' web handler status when not autoverifying"
This reverts commit 1c448eaab9.
Reason for revert: Inadvertently broke link handling stickiness even for well behaved apps
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'
Change-Id: If9046cb420961b8ef0333e9f1115eb69fb92242e
This commit is contained in:
committed by
Christopher Tate
parent
2104bd6ac5
commit
0a96f46ec1
@@ -17276,31 +17276,26 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
+ " Activities needs verification ...");
|
+ " Activities needs verification ...");
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
boolean handlesWebUris = false;
|
|
||||||
final boolean alreadyVerified;
|
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
// If this is a new install and we see that we've already run verification for this
|
// 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.
|
// package, we have nothing to do: it means the state was restored from backup.
|
||||||
final IntentFilterVerificationInfo ivi =
|
if (!replacing) {
|
||||||
|
IntentFilterVerificationInfo ivi =
|
||||||
mSettings.getIntentFilterVerificationLPr(packageName);
|
mSettings.getIntentFilterVerificationLPr(packageName);
|
||||||
alreadyVerified = (ivi != null);
|
if (ivi != null) {
|
||||||
if (!replacing && alreadyVerified) {
|
|
||||||
if (DEBUG_DOMAIN_VERIFICATION) {
|
if (DEBUG_DOMAIN_VERIFICATION) {
|
||||||
Slog.i(TAG, "Package " + packageName+ " already verified: status="
|
Slog.i(TAG, "Package " + packageName+ " already verified: status="
|
||||||
+ ivi.getStatusString());
|
+ ivi.getStatusString());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If any filters need to be verified, then all need to be. In addition, we need to
|
// If any filters need to be verified, then all need to be.
|
||||||
// know whether an updating app has any web navigation intent filters, to re-
|
|
||||||
// examine handling policy even if not re-verifying.
|
|
||||||
boolean needToVerify = false;
|
boolean needToVerify = false;
|
||||||
for (ParsedActivity a : activities) {
|
for (ParsedActivity a : activities) {
|
||||||
for (ParsedIntentInfo filter : a.getIntents()) {
|
for (ParsedIntentInfo filter : a.getIntents()) {
|
||||||
if (filter.handlesWebUris(true)) {
|
|
||||||
handlesWebUris = true;
|
|
||||||
}
|
|
||||||
if (filter.needsVerification()
|
if (filter.needsVerification()
|
||||||
&& needsNetworkVerificationLPr(a.getPackageName())) {
|
&& needsNetworkVerificationLPr(a.getPackageName())) {
|
||||||
if (DEBUG_DOMAIN_VERIFICATION) {
|
if (DEBUG_DOMAIN_VERIFICATION) {
|
||||||
@@ -17308,17 +17303,11 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
"Intent filter needs verification, so processing all filters");
|
"Intent filter needs verification, so processing all filters");
|
||||||
}
|
}
|
||||||
needToVerify = true;
|
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;
|
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) {
|
if (needToVerify) {
|
||||||
final boolean needsVerification = needsNetworkVerificationLPr(packageName);
|
final boolean needsVerification = needsNetworkVerificationLPr(packageName);
|
||||||
final int verificationId = mIntentFilterVerificationToken++;
|
final int verificationId = mIntentFilterVerificationToken++;
|
||||||
@@ -17339,23 +17328,13 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
// count > 0 means that we're running a full verification pass
|
|
||||||
if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, "Starting " + count
|
if (DEBUG_DOMAIN_VERIFICATION) Slog.d(TAG, "Starting " + count
|
||||||
+ " IntentFilter verification" + (count > 1 ? "s" : "")
|
+ " IntentFilter verification" + (count > 1 ? "s" : "")
|
||||||
+ " for userId:" + userId);
|
+ " for userId:" + userId);
|
||||||
mIntentFilterVerifier.startVerifications(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 {
|
} else {
|
||||||
if (DEBUG_DOMAIN_VERIFICATION) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1269,7 +1269,6 @@ public final class Settings {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ps.clearDomainVerificationStatusForUser(userId);
|
ps.clearDomainVerificationStatusForUser(userId);
|
||||||
ps.setIntentFilterVerificationInfo(null);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user