Loading services/core/java/com/android/server/pm/AppsFilter.java +44 −19 Original line number Diff line number Diff line Loading @@ -195,19 +195,19 @@ public class AppsFilter { return false; } for (Intent intent : querying.mQueriesIntents) { if (matches(intent, potentialTarget.providers, potentialTarget.activities, potentialTarget.services, potentialTarget.receivers)) { if (matches(intent, potentialTarget)) { return true; } } return false; } private static boolean matches(Intent intent, ArrayList<PackageParser.Provider> providerList, ArrayList<? extends Component<? extends IntentInfo>>... componentLists) { for (int p = providerList.size() - 1; p >= 0; p--) { PackageParser.Provider provider = providerList.get(p); private static boolean matches(Intent intent, PackageParser.Package potentialTarget) { for (int p = potentialTarget.providers.size() - 1; p >= 0; p--) { PackageParser.Provider provider = potentialTarget.providers.get(p); if (!provider.info.exported) { continue; } final ProviderInfo providerInfo = provider.info; final Uri data = intent.getData(); if ("content".equalsIgnoreCase(intent.getScheme()) Loading @@ -216,11 +216,38 @@ public class AppsFilter { return true; } } for (int s = potentialTarget.services.size() - 1; s >= 0; s--) { PackageParser.Service service = potentialTarget.services.get(s); if (!service.info.exported) { continue; } if (matchesAnyFilter(intent, service)) { return true; } } for (int a = potentialTarget.activities.size() - 1; a >= 0; a--) { PackageParser.Activity activity = potentialTarget.activities.get(a); if (!activity.info.exported) { continue; } if (matchesAnyFilter(intent, activity)) { return true; } } for (int r = potentialTarget.receivers.size() - 1; r >= 0; r--) { PackageParser.Activity receiver = potentialTarget.receivers.get(r); if (!receiver.info.exported) { continue; } if (matchesAnyFilter(intent, receiver)) { return true; } } return false; } for (int l = componentLists.length - 1; l >= 0; l--) { ArrayList<? extends Component<? extends IntentInfo>> components = componentLists[l]; for (int c = components.size() - 1; c >= 0; c--) { Component<? extends IntentInfo> component = components.get(c); private static boolean matchesAnyFilter( Intent intent, Component<? extends IntentInfo> component) { ArrayList<? extends IntentInfo> intents = component.intents; for (int i = intents.size() - 1; i >= 0; i--) { IntentFilter intentFilter = intents.get(i); Loading @@ -229,8 +256,6 @@ public class AppsFilter { return true; } } } } return false; } Loading Loading
services/core/java/com/android/server/pm/AppsFilter.java +44 −19 Original line number Diff line number Diff line Loading @@ -195,19 +195,19 @@ public class AppsFilter { return false; } for (Intent intent : querying.mQueriesIntents) { if (matches(intent, potentialTarget.providers, potentialTarget.activities, potentialTarget.services, potentialTarget.receivers)) { if (matches(intent, potentialTarget)) { return true; } } return false; } private static boolean matches(Intent intent, ArrayList<PackageParser.Provider> providerList, ArrayList<? extends Component<? extends IntentInfo>>... componentLists) { for (int p = providerList.size() - 1; p >= 0; p--) { PackageParser.Provider provider = providerList.get(p); private static boolean matches(Intent intent, PackageParser.Package potentialTarget) { for (int p = potentialTarget.providers.size() - 1; p >= 0; p--) { PackageParser.Provider provider = potentialTarget.providers.get(p); if (!provider.info.exported) { continue; } final ProviderInfo providerInfo = provider.info; final Uri data = intent.getData(); if ("content".equalsIgnoreCase(intent.getScheme()) Loading @@ -216,11 +216,38 @@ public class AppsFilter { return true; } } for (int s = potentialTarget.services.size() - 1; s >= 0; s--) { PackageParser.Service service = potentialTarget.services.get(s); if (!service.info.exported) { continue; } if (matchesAnyFilter(intent, service)) { return true; } } for (int a = potentialTarget.activities.size() - 1; a >= 0; a--) { PackageParser.Activity activity = potentialTarget.activities.get(a); if (!activity.info.exported) { continue; } if (matchesAnyFilter(intent, activity)) { return true; } } for (int r = potentialTarget.receivers.size() - 1; r >= 0; r--) { PackageParser.Activity receiver = potentialTarget.receivers.get(r); if (!receiver.info.exported) { continue; } if (matchesAnyFilter(intent, receiver)) { return true; } } return false; } for (int l = componentLists.length - 1; l >= 0; l--) { ArrayList<? extends Component<? extends IntentInfo>> components = componentLists[l]; for (int c = components.size() - 1; c >= 0; c--) { Component<? extends IntentInfo> component = components.get(c); private static boolean matchesAnyFilter( Intent intent, Component<? extends IntentInfo> component) { ArrayList<? extends IntentInfo> intents = component.intents; for (int i = intents.size() - 1; i >= 0; i--) { IntentFilter intentFilter = intents.get(i); Loading @@ -229,8 +256,6 @@ public class AppsFilter { return true; } } } } return false; } Loading