buf.append(filter.getDataScheme(0));
dataSchemes.add(filter.getDataScheme(i));
@Test public void addDataScheme_shouldAddTheDataScheme() throws Exception { IntentFilter intentFilter = new IntentFilter(); intentFilter.addDataScheme("http"); intentFilter.addDataScheme("ftp"); assertThat(intentFilter.getDataScheme(0)).isEqualTo("http"); assertThat(intentFilter.getDataScheme(1)).isEqualTo("ftp"); }
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; } }
if (!f2.hasDataScheme(f1.getDataScheme(i))) { return false;
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 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; } }
info += " data path: " + filter.getDataScheme(j) + "\n";
if (!f2.hasDataScheme(f1.getDataScheme(i))) { return false;
if (!f2.hasDataScheme(f1.getDataScheme(i))) { return false;