From dbdf7c45380f7701e029a279932d2c97bf55fdc9 Mon Sep 17 00:00:00 2001 From: Nicolas Prevot Date: Wed, 15 Jul 2015 14:54:45 +0100 Subject: [PATCH] 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 --- .../com/android/server/pm/PackageManagerService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index eb84e181a8858..2a08c340bb3a1 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -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; }