Merge "Add IntentFilter auto verification - part 11" into mnc-dev

This commit is contained in:
Fabrice Di Meglio
2015-05-14 01:21:56 +00:00
committed by Android (Google) Code Review

View File

@@ -4137,7 +4137,9 @@ public class PackageManagerService extends IPackageManager.Stub {
synchronized (mPackages) { synchronized (mPackages) {
final int count = candidates.size(); final int count = candidates.size();
// First, try to use the domain prefered App // First, try to use the domain prefered App. 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".
for (int n=0; n<count; n++) { for (int n=0; n<count; n++) {
ResolveInfo info = candidates.get(n); ResolveInfo info = candidates.get(n);
String packageName = info.activityInfo.packageName; String packageName = info.activityInfo.packageName;
@@ -4159,19 +4161,19 @@ public class PackageManagerService extends IPackageManager.Stub {
} }
} }
} }
// Add all undefined Apps as we want them to appear in the Disambiguation dialog.
result.addAll(undefinedList);
// If there is nothing selected, add all candidates and remove the ones that the User // If there is nothing selected, add all candidates and remove the ones that the User
// has explicitely put into the INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER state and // has explicitely put into the INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER state and
// also remove any undefined ones and Browser Apps ones. // also remove Browser Apps ones.
// If there is still none after this pass, add all undefined one and Browser Apps and // If there is still none after this pass, add all Browser Apps and
// let the User decide with the Disambiguation dialog if there are several ones. // let the User decide with the Disambiguation dialog if there are several ones.
if (result.size() == 0) { if (result.size() == 0) {
result.addAll(candidates); result.addAll(candidates);
} }
result.removeAll(neverList); result.removeAll(neverList);
result.removeAll(matchAllList); result.removeAll(matchAllList);
result.removeAll(undefinedList);
if (result.size() == 0) { if (result.size() == 0) {
result.addAll(undefinedList);
if ((flags & MATCH_ALL) != 0) { if ((flags & MATCH_ALL) != 0) {
result.addAll(matchAllList); result.addAll(matchAllList);
} else { } else {