Don't send app links to the parent if status = never (part 2)

To qualify for cross-profile app linking, an intent should resolve
with a better status than "NEVER". Moved this check from canForwardTo
into the source method, getCrossProfileDomainPreferredLpr, to stop
bad resolutions leaking out.

BUG:22287521
Change-Id: I195979d78a783864d841a81f358780912bbf168e
This commit is contained in:
Nicolas Prevot
2015-07-15 14:54:45 +01:00
parent 47e0409062
commit dbdf7c4538

View File

@@ -4417,9 +4417,7 @@ public class PackageManagerService extends IPackageManager.Stub {
synchronized(mPackages) {
CrossProfileDomainInfo xpDomainInfo = getCrossProfileDomainPreferredLpr(
intent, resolvedType, 0, sourceUserId, parent.id);
return xpDomainInfo != null
&& xpDomainInfo.bestDomainVerificationStatus !=
INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER;
return xpDomainInfo != null;
}
}
return false;
@@ -4576,6 +4574,11 @@ public class PackageManagerService extends IPackageManager.Stub {
result.bestDomainVerificationStatus);
}
}
// Don't consider matches with status NEVER across profiles.
if (result != null && result.bestDomainVerificationStatus
== INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER) {
return null;
}
return result;
}