private int register_intent_filter(F filter, Iterator<String> i, HashMap<String, F[]> dest, String prefix) { if (i == null) { return 0; } int num = 0; while (i.hasNext()) { String name = i.next(); num++; addFilter(dest, name, filter); } return num; }
if (packageName != null && !isPackageForFilter(packageName, filter)) { continue; if (!allowFilterResult(filter, dest)) { continue; if (match >= 0) { if (!defaultOnly || filter.filter.hasCategory(Intent.CATEGORY_DEFAULT)) { final R oneResult = newResult(filter, match, userId); if (oneResult != null) { dest.add(oneResult);
public List<R> queryIntentFromList(Intent intent, String resolvedType, boolean defaultOnly, ArrayList<F[]> listCut, int userId) { ArrayList<R> resultList = new ArrayList<R>(); FastImmutableArraySet<String> categories = getFastIntentCategories(intent); final String scheme = intent.getScheme(); int N = listCut.size(); for (int i = 0; i < N; ++i) { buildResolveList(intent, categories, defaultOnly, resolvedType, scheme, listCut.get(i), resultList, userId); } sortResults(resultList); return resultList; }
public ArrayList<F> findFilters(IntentFilter matching) { if (matching.countDataSchemes() == 1) { // Fast case. return collectFilters(mSchemeToFilter.get(matching.getDataScheme(0)), matching); } else if (matching.countDataTypes() != 0 && matching.countActions() == 1) { // Another fast case. return collectFilters(mTypedActionToFilter.get(matching.getAction(0)), matching); } else if (matching.countDataTypes() == 0 && matching.countDataSchemes() == 0 && matching.countActions() == 1) { // Last fast case. return collectFilters(mActionToFilter.get(matching.getAction(0)), matching); } else { ArrayList<F> res = null; for (F cur : mFilters) { if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } return res; } }
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, boolean defaultOnly, int userId) { mFlags = defaultOnly ? PackageManager.MATCH_DEFAULT_ONLY : 0; return super.queryIntent(intent, resolvedType, defaultOnly, userId); }
private void addFilter(HashMap<String, F[]> map, String name, F filter) { F[] array = map.get(name); if (array == null) { array = newArray(2); map.put(name, array); array[0] = filter; } else { final int N = array.length; int i = N; while (i > 0 && array[i - 1] == null) { i--; } if (i < N) { array[i] = filter; } else { F[] newa = newArray((N * 3) / 2); System.arraycopy(array, 0, newa, 0, N); newa[N] = filter; map.put(name, newa); } } }
private ArrayList<F> collectFilters(F[] array, IntentFilter matching) { ArrayList<F> res = null; if (array != null) { for (int i = 0; i < array.length; i++) { F cur = array[i]; if (cur == null) { break; } if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } } return res; }
List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags, int userId) { mFlags = flags; return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); }
public ArrayList<F> findFilters(IntentFilter matching) { if (matching.countDataSchemes() == 1) { // Fast case. return collectFilters(mSchemeToFilter.get(matching.getDataScheme(0)), matching); } else if (matching.countDataTypes() != 0 && matching.countActions() == 1) { // Another fast case. return collectFilters(mTypedActionToFilter.get(matching.getAction(0)), matching); } else if (matching.countDataTypes() == 0 && matching.countDataSchemes() == 0 && matching.countActions() == 1) { // Last fast case. return collectFilters(mActionToFilter.get(matching.getAction(0)), matching); } else { ArrayList<F> res = null; for (F cur : mFilters) { if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } return res; } }
private void remove_all_objects(HashMap<String, F[]> map, String name, Object object) { F[] array = map.get(name); if (array != null) { int LAST = array.length - 1; while (LAST >= 0 && array[LAST] == null) { LAST--; } for (int idx = LAST; idx >= 0; idx--) { if (array[idx] == object) { final int remain = LAST - idx; if (remain > 0) { System.arraycopy(array, idx + 1, array, idx, remain); } array[LAST] = null; LAST--; } } if (LAST < 0) { map.remove(name); } else if (LAST < (array.length / 2)) { F[] newa = newArray(LAST + 2); System.arraycopy(array, 0, newa, 0, LAST + 1); map.put(name, newa); } } }
private ArrayList<F> collectFilters(F[] array, IntentFilter matching) { ArrayList<F> res = null; if (array != null) { for (int i = 0; i < array.length; i++) { F cur = array[i]; if (cur == null) { break; } if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } } return res; }
FastImmutableArraySet<String> categories = getFastIntentCategories(intent); if (firstTypeCut != null) { buildResolveList(intent, categories, defaultOnly, resolvedType, scheme, firstTypeCut, finalList, userId); buildResolveList(intent, categories, defaultOnly, resolvedType, scheme, secondTypeCut, finalList, userId); buildResolveList(intent, categories, defaultOnly, resolvedType, scheme, thirdTypeCut, finalList, userId); buildResolveList(intent, categories, defaultOnly, resolvedType, scheme, schemeCut, finalList, userId); sortResults(finalList); return finalList;
if (packageName != null && !isPackageForFilter(packageName, filter)) { continue; if (!allowFilterResult(filter, dest)) { continue; if (match >= 0) { if (!defaultOnly || filter.filter.hasCategory(Intent.CATEGORY_DEFAULT)) { final R oneResult = newResult(filter, match, userId); if (oneResult != null) { dest.add(oneResult);
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags, int userId) { mFlags = flags; return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0, userId); }
public ArrayList<F> findFilters(IntentFilter matching) { if (matching.countDataSchemes() == 1) { // Fast case. return collectFilters(mSchemeToFilter.get(matching.getDataScheme(0)), matching); } else if (matching.countDataTypes() != 0 && matching.countActions() == 1) { // Another fast case. return collectFilters(mTypedActionToFilter.get(matching.getAction(0)), matching); } else if (matching.countDataTypes() == 0 && matching.countDataSchemes() == 0 && matching.countActions() == 1) { // Last fast case. return collectFilters(mActionToFilter.get(matching.getAction(0)), matching); } else { ArrayList<F> res = null; for (F cur : mFilters) { if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } return res; } }
private int register_mime_types(F filter, String prefix) { final Iterator<String> i = filter.filter.typesIterator(); if (i == null) { return 0; } int num = 0; while (i.hasNext()) { String name = i.next(); num++; String baseName = name; final int slashpos = name.indexOf('/'); if (slashpos > 0) { baseName = name.substring(0, slashpos).intern(); } else { name = name + "/*"; } addFilter(mTypeToFilter, name, filter); if (slashpos > 0) { addFilter(mBaseTypeToFilter, baseName, filter); } else { addFilter(mWildTypeToFilter, baseName, filter); } } return num; }
private void addFilter(HashMap<String, F[]> map, String name, F filter) { F[] array = map.get(name); if (array == null) { array = newArray(2); map.put(name, array); array[0] = filter; } else { final int N = array.length; int i = N; while (i > 0 && array[i - 1] == null) { i--; } if (i < N) { array[i] = filter; } else { F[] newa = newArray((N * 3) / 2); System.arraycopy(array, 0, newa, 0, N); newa[N] = filter; map.put(name, newa); } } }
private ArrayList<F> collectFilters(F[] array, IntentFilter matching) { ArrayList<F> res = null; if (array != null) { for (int i = 0; i < array.length; i++) { F cur = array[i]; if (cur == null) { break; } if (filterEquals(cur.filter, matching)) { if (res == null) { res = new ArrayList<>(); } res.add(cur); } } } return res; }
public List<R> queryIntentFromList(Intent intent, String resolvedType, boolean defaultOnly, ArrayList<F[]> listCut, int userId) { ArrayList<R> resultList = new ArrayList<R>(); FastImmutableArraySet<String> categories = getFastIntentCategories(intent); final String scheme = intent.getScheme(); int N = listCut.size(); for (int i = 0; i < N; ++i) { buildResolveList(intent, categories, defaultOnly, resolvedType, scheme, listCut.get(i), resultList, userId); } sortResults(resultList); return resultList; }
if (packageName != null && !isPackageForFilter(packageName, filter)) { continue; if (!allowFilterResult(filter, dest)) { continue; if (match >= 0) { if (!defaultOnly || filter.filter.hasCategory(Intent.CATEGORY_DEFAULT)) { final R oneResult = newResult(filter, match, userId); if (oneResult != null) { dest.add(oneResult);