From 050aee236509512f7098941946f12e1fbf2ab8ae Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Wed, 1 Jul 2015 16:50:43 -0700 Subject: [PATCH] App linking: permit overlapping link handling Allow multiple apps to be enabled as link handlers even their set of accepted domains overlaps. Also, allow app linking to be turned on even for unverified apps if the user wishes. Bug 21817604 Change-Id: I8bc7f1764318e5d4bb6ce93c66483fe07e922b1d --- .../server/pm/PackageManagerService.java | 28 ++++++++++++----- .../java/com/android/server/pm/Settings.java | 30 +------------------ 2 files changed, 21 insertions(+), 37 deletions(-) diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 0240dbb7a7853..450393ae99e4e 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -4568,8 +4568,8 @@ public class PackageManagerService extends IPackageManager.Stub { private List filterCandidatesWithDomainPreferredActivitiesLPr( int flags, List candidates, CrossProfileDomainInfo xpDomainInfo) { - if (DEBUG_PREFERRED) { - Slog.v("TAG", "Filtering results with prefered activities. Candidates count: " + + if (DEBUG_PREFERRED || DEBUG_DOMAIN_VERIFICATION) { + Slog.v("TAG", "Filtering results with preferred activities. Candidates count: " + candidates.size()); } @@ -4582,9 +4582,9 @@ public class PackageManagerService extends IPackageManager.Stub { synchronized (mPackages) { final int count = candidates.size(); - // First, try to use the domain preferred app. Partition the candidates into four lists: + // First, try to use linked apps. Partition the candidates into four lists: // one for the final results, one for the "do not use ever", one for "undefined status" - // and finally one for "Browser App type". + // and finally one for "browser app type". for (int n=0; n currentDomains = current.getIntentFilterVerificationInfo().getDomains(); - if (status == INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS) { - for (PackageSetting ps : mPackages.values()) { - if (ps == null || ps.pkg == null || packageName.equals(ps.pkg.packageName)) { - continue; - } - IntentFilterVerificationInfo ivi = ps.getIntentFilterVerificationInfo(); - if (ivi == null) { - continue; - } - ArraySet set = ivi.getDomains(); - set.retainAll(currentDomains); - if (set.size() > 0) { - ps.setDomainVerificationStatusForUser( - INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER, userId); - } - } - } return true; }