Java Code Examples for android.content.Intent.FLAG_DEBUG_LOG_RESOLUTION

The following are Jave code examples for showing how to use FLAG_DEBUG_LOG_RESOLUTION of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: atlas   File: IntentResolver.java   View Source Code Vote up 7 votes
public List<R> queryIntentFromList(Intent intent, String resolvedType, 
        boolean defaultOnly, ArrayList<F[]> listCut) {
    ArrayList<R> resultList = new ArrayList<R>();

    final boolean debug = localLOGV ||
            ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);

    FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
    final String scheme = intent.getScheme();
    int N = listCut.size();
    for (int i = 0; i < N; ++i) {
        buildResolveList(intent, categories, debug, defaultOnly,
                resolvedType, scheme, listCut.get(i), resultList);
    }
    sortResults(resultList);
    return resultList;
}
 
Example 2
Project: IFWManager   File: IntentResolver.java   View Source Code Vote up 7 votes
public List<R> queryIntentFromList(Intent intent, String resolvedType,
                                   boolean defaultOnly, ArrayList<F[]> listCut, int userId) {
    ArrayList<R> resultList = new ArrayList<R>();

    final boolean debug = localLOGV ||
            ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);

    FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
    final String scheme = intent.getScheme();
    int N = listCut.size();
    for (int i = 0; i < N; ++i) {
        buildResolveList(intent, categories, debug, defaultOnly,
                resolvedType, scheme, listCut.get(i), resultList, userId);
    }
    sortResults(resultList);
    return resultList;
}
 
Example 3
Project: container   File: IntentResolver.java   View Source Code Vote up 6 votes
public List<R> queryIntentFromList(Intent intent, String resolvedType, boolean defaultOnly,
		ArrayList<F[]> listCut) {
	ArrayList<R> resultList = new ArrayList<R>();

	final boolean debug = localLOGV || ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);

	FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
	final String scheme = intent.getScheme();
	int N = listCut.size();
	for (int i = 0; i < N; ++i) {
		buildResolveList(intent, categories, debug, defaultOnly, resolvedType, scheme, listCut.get(i), resultList);
	}
	sortResults(resultList);
	return resultList;
}
 
Example 4
Project: atlas   File: IntentResolver.java   View Source Code Vote up 5 votes
public List<R> queryIntent(Intent intent, String resolvedType, boolean defaultOnly) {
    String scheme = intent.getScheme();

    ArrayList<R> finalList = new ArrayList<R>();

    final boolean debug = localLOGV ||
            ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);
    F[] firstTypeCut = null;
    F[] secondTypeCut = null;
    F[] thirdTypeCut = null;
    F[] schemeCut = null;

    // If the intent includes a MIME type, then we want to collect all of
    // the filters that match that MIME type.
    if (resolvedType != null) {
        int slashpos = resolvedType.indexOf('/');
        if (slashpos > 0) {
            final String baseType = resolvedType.substring(0, slashpos);
            if (!baseType.equals("*")) {
                if (resolvedType.length() != slashpos+2
                        || resolvedType.charAt(slashpos+1) != '*') {
                    // Not a wild card, so we can just look for all filters that
                    // completely match or wildcards whose base type matches.
                    firstTypeCut = mTypeToFilter.get(resolvedType);
                    secondTypeCut = mWildTypeToFilter.get(baseType);
                } else {
                    // We can match anything with our base type.
                    firstTypeCut = mBaseTypeToFilter.get(baseType);
                    secondTypeCut = mWildTypeToFilter.get(baseType);
                }
                // Any */* types always apply, but we only need to do this
                // if the intent type was not already */*.
                thirdTypeCut = mWildTypeToFilter.get("*");
            } else if (intent.getAction() != null) {
                // The intent specified any type ({@literal *}/*).  This
                // can be a whole heck of a lot of things, so as a first
                // cut let's use the action instead.
                firstTypeCut = mTypedActionToFilter.get(intent.getAction());
            }
        }
    }

    // If the intent includes a data URI, then we want to collect all of
    // the filters that match its scheme (we will further refine matches
    // on the authority and path by directly matching each resulting filter).
    if (scheme != null) {
        schemeCut = mSchemeToFilter.get(scheme);
    }

    // If the intent does not specify any data -- either a MIME type or
    // a URI -- then we will only be looking for matches against empty
    // data.
    if (resolvedType == null && scheme == null && intent.getAction() != null) {
        firstTypeCut = mActionToFilter.get(intent.getAction());
    }

    FastImmutableArraySet<String> categories = getFastIntentCategories(intent);
    if (firstTypeCut != null) {
        buildResolveList(intent, categories, debug, defaultOnly,
                resolvedType, scheme, firstTypeCut, finalList);
    }
    if (secondTypeCut != null) {
        buildResolveList(intent, categories, debug, defaultOnly,
                resolvedType, scheme, secondTypeCut, finalList);
    }
    if (thirdTypeCut != null) {
        buildResolveList(intent, categories, debug, defaultOnly,
                resolvedType, scheme, thirdTypeCut, finalList);
    }
    if (schemeCut != null) {
        buildResolveList(intent, categories, debug, defaultOnly,
                resolvedType, scheme, schemeCut, finalList);
    }
    sortResults(finalList);

    return finalList;
}