Lines Matching refs:match

40  * match against actions, categories, and data (either via its type, scheme,
58 * only match intents that contain no data.
63 * specified must match the contents of the Intent. If you specify a scheme
65 * match; a content: URI will never match because they always have a MIME type
67 * has somewhat special meaning: it will match either an Intent with no URI
69 * then only an Intent with no data or type will match. To specify an authority,
82 * <p>A match is based on the following rules. Note that
83 * for an IntentFilter to match an Intent, three conditions must hold:
84 * the <strong>action</strong> and <strong>category</strong> must match, and
86 * <strong>data scheme+authority+path</strong> if specified) must match
87 * (see {@link #match(ContentResolver, Intent, boolean, String)} for more details
88 * on how the data fields match).
90 * <p><strong>Action</strong> matches if any of the given values match the
91 * Intent action; if the filter specifies no actions, then it will only match
94 * <p><strong>Data Type</strong> matches if any of the given values match the
98 * type "audio/*" will match "audio/mpeg", "audio/aiff", "audio/*", etc.
103 * <p><strong>Data Scheme</strong> matches if any of the given values match the
111 * <p><strong>Data Scheme Specific Part</strong> matches if any of the given values match
118 * <p><strong>Data Authority</strong> matches if any of the given values match
127 * <p><strong>Data Path</strong> matches if any of the given values match the
133 * <p><strong>Categories</strong> match if <em>all</em> of the categories in
134 * the Intent match categories given in the filter. Extra categories in the
135 * filter that are not in the Intent will not cause the match to fail. Note
137 * will only match an Intent that does not have any categories.
175 * The part of a match constant that describes the category of match
180 * values indicate a better match.
185 * The part of a match constant that applies a quality adjustment to the
186 * basic category of match. The value {@link #MATCH_ADJUSTMENT_NORMAL}
193 * Quality adjustment applied to the category of match that signifies
233 * The filter didn't match due to different MIME types.
237 * The filter didn't match due to different data URIs.
241 * The filter didn't match due to different actions.
245 * The filter didn't match because it required one or more categories
337 * @param action The action to match, i.e. Intent.ACTION_VIEW.
338 * @param dataType The type to match, i.e. "vnd.android.cursor.dir/person".
363 * filter will only match intents that contain no data.
365 * @param action The action to match, i.e. Intent.ACTION_MAIN.
385 * @param action The action to match, i.e. Intent.ACTION_VIEW.
386 * @param dataType The type to match, i.e. "vnd.android.cursor.dir/person".
455 * Add a new Intent action to match against. If any actions are included
457 * it to match. If no actions are included, the Intent action is ignored.
459 * @param action Name of the action to match, i.e. Intent.ACTION_VIEW.
495 * specify any actions, the match will always fail.
514 * Add a new Intent data type to match against. If any types are
517 * are included, then an Intent will only match if it specifies no data.
528 * @param type Name of the data type to match, i.e. "vnd.android.cursor.dir/person".
589 * Add a new Intent data scheme to match against. If any schemes are
592 * are included, then an Intent will match only if it includes no data.
600 * @param scheme Name of the scheme to match, i.e. "http".
689 * @param data The Uri to match.
694 public int match(Uri data) {
721 * Add a new Intent data "scheme specific part" to match against. The filter must
724 * included in the filter, then an Intent's data must match one of
725 * them. If no scheme specific parts are included, then only the scheme must match.
733 * are empty, so this is the only way to match against the non-scheme part.</p>
735 * @param ssp Either a raw string that must exactly match the scheme specific part
738 * determine a match: either {@link PatternMatcher#PATTERN_LITERAL},
788 if (pe.match(data)) {
803 * Add a new Intent data authority to match against. The filter must
806 * included in the filter, then an Intent's data must match one of
807 * them. If no authorities are included, then only the scheme must match.
815 * @param host The host part of the authority to match. May start with a
817 * @param port Optional port part of the authority to match. If null, any
871 * Add a new Intent data path to match against. The filter must
875 * included in the filter, then an Intent's data must match one of
877 * match.
880 * match or match against a prefix, or it can be a simple globbing pattern.
881 * If the latter, you can use '*' anywhere in the pattern to match zero
882 * or more instances of the previous character, '.' as a wildcard to match
885 * @param path Either a raw string that must exactly match the file
888 * determine a match: either {@link PatternMatcher#PATTERN_LITERAL},
938 if (pe.match(data)) {
954 * the data scheme -- unlike {@link #matchData}, the authority will match
969 int match = ae.match(data);
970 if (match >= 0) {
971 return match;
980 * schemes/paths, the match will only succeed if the intent does not
982 * it will implicitly match intents with no scheme, or the schemes "content:"
983 * or "file:" (basically performing a MIME-type only match). If the filter
987 * <p>Be aware that to match against an authority, you must also specify a base
988 * scheme the authority is in. To match against a data path, both a scheme
1005 * @param data The full data string to match against, as supplied in
1008 * @return Returns either a valid match constant (a combination of
1010 * or one of the error codes {@link #NO_MATCH_TYPE} if the type didn't match
1011 * or {@link #NO_MATCH_DATA} if the scheme/path didn't match.
1013 * @see #match
1019 int match = MATCH_CATEGORY_EMPTY;
1028 match = MATCH_CATEGORY_SCHEME;
1035 match = hasDataSchemeSpecificPart(data.getSchemeSpecificPart())
1038 if (match != MATCH_CATEGORY_SCHEME_SPECIFIC_PART) {
1039 // If there isn't any matching ssp, we need to match an authority.
1046 match = authMatch;
1048 match = MATCH_CATEGORY_PATH;
1058 if (match == NO_MATCH_DATA) {
1062 // Special case: match either an Intent with no data URI,
1076 match = MATCH_CATEGORY_TYPE;
1081 // If no MIME types are specified, then we will only match against
1088 return match + MATCH_ADJUSTMENT_NORMAL;
1092 * Add a new Intent category to match against. The semantics of
1095 * filter in order to match. In other words, adding a category to the
1099 * @param category Name of category to match, i.e. Intent.CATEGORY_EMBED.
1145 * filter, the match fails.
1150 * @return If all categories match (success), null; else the name of the
1151 * first category that didn't match.
1179 * Intent.resolveType(); otherwise a simple match against
1183 * @return Returns either a valid match constant (a combination of
1185 * or one of the error codes {@link #NO_MATCH_TYPE} if the type didn't match,
1186 * {@link #NO_MATCH_DATA} if the scheme/path didn't match,
1187 * {@link #NO_MATCH_ACTION if the action didn't match, or
1188 * {@link #NO_MATCH_CATEGORY} if one or more categories didn't match.
1190 * @return How well the filter matches. Negative if it doesn't match,
1192 * value representing a better match.
1194 * @see #match(String, String, String, android.net.Uri , Set, String)
1196 public final int match(ContentResolver resolver, Intent intent,
1199 return match(intent.getAction(), type, intent.getScheme(),
1204 * Test whether this filter matches the given intent data. A match is
1205 * only successful if the actions and categories in the Intent match
1207 * the match result returned will be as per {@link #matchData}.
1209 * @param action The intent action to match against (Intent.getAction).
1210 * @param type The intent type to match against (Intent.resolveType()).
1211 * @param scheme The data scheme to match against (Intent.getScheme()).
1212 * @param data The data URI to match against (Intent.getData()).
1213 * @param categories The categories to match against
1217 * @return Returns either a valid match constant (a combination of
1219 * or one of the error codes {@link #NO_MATCH_TYPE} if the type didn't match,
1220 * {@link #NO_MATCH_DATA} if the scheme/path didn't match,
1221 * {@link #NO_MATCH_ACTION if the action didn't match, or
1222 * {@link #NO_MATCH_CATEGORY} if one or more categories didn't match.
1231 public final int match(String action, String type, String scheme,
1637 // Deal with an Intent wanting to match every type in the IntentFilter.
1643 // Deal with this IntentFilter wanting to match every Intent type.