Java Code Examples for android.content.pm.PackageManager.MATCH_DEFAULT_ONLY

The following are Jave code examples for showing how to use MATCH_DEFAULT_ONLY of the android.content.pm.PackageManager 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: container   File: VPackageManagerService.java   View Source Code Vote up 7 votes
public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, int flags,
		ArrayList<PackageParser.Service> packageServices) {
	if (packageServices == null) {
		return null;
	}
	mFlags = flags;
	final boolean defaultOnly = (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0;
	final int N = packageServices.size();
	ArrayList<PackageParser.ServiceIntentInfo[]> listCut = new ArrayList<PackageParser.ServiceIntentInfo[]>(N);

	ArrayList<PackageParser.ServiceIntentInfo> intentFilters;
	for (int i = 0; i < N; ++i) {
		intentFilters = packageServices.get(i).intents;
		if (intentFilters != null && intentFilters.size() > 0) {
			PackageParser.ServiceIntentInfo[] array = new PackageParser.ServiceIntentInfo[intentFilters.size()];
			intentFilters.toArray(array);
			listCut.add(array);
		}
	}
	return super.queryIntentFromList(intent, resolvedType, defaultOnly, listCut);
}
 
Example 2
Project: VirtualHook   File: VPackageManagerService.java   View Source Code Vote up 6 votes
public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, int flags,
                                               ArrayList<VPackage.ServiceComponent> packageServices, int userId) {
    if (packageServices == null) {
        return null;
    }
    mFlags = flags;
    final boolean defaultOnly = (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0;
    final int N = packageServices.size();
    ArrayList<VPackage.ServiceIntentInfo[]> listCut = new ArrayList<VPackage.ServiceIntentInfo[]>(N);

    ArrayList<VPackage.ServiceIntentInfo> intentFilters;
    for (int i = 0; i < N; ++i) {
        intentFilters = packageServices.get(i).intents;
        if (intentFilters != null && intentFilters.size() > 0) {
            VPackage.ServiceIntentInfo[] array = new VPackage.ServiceIntentInfo[intentFilters.size()];
            intentFilters.toArray(array);
            listCut.add(array);
        }
    }
    return super.queryIntentFromList(intent, resolvedType, defaultOnly, listCut, userId);
}
 
Example 3
Project: VirtualHook   File: ProviderIntentResolver.java   View Source Code Vote up 6 votes
public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, int flags,
                                               ArrayList<VPackage.ProviderComponent> packageProviders, int userId) {
    if (packageProviders == null) {
        return null;
    }
    mFlags = flags;
    final boolean defaultOnly = (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0;
    final int N = packageProviders.size();
    ArrayList<VPackage.ProviderIntentInfo[]> listCut = new ArrayList<>(N);

    ArrayList<VPackage.ProviderIntentInfo> intentFilters;
    for (int i = 0; i < N; ++i) {
        intentFilters = packageProviders.get(i).intents;
        if (intentFilters != null && intentFilters.size() > 0) {
            VPackage.ProviderIntentInfo[] array = new VPackage.ProviderIntentInfo[intentFilters
                    .size()];
            intentFilters.toArray(array);
            listCut.add(array);
        }
    }
    return super.queryIntentFromList(intent, resolvedType, defaultOnly, listCut, userId);
}
 
Example 4
Project: container   File: VPackageManagerService.java   View Source Code Vote up 6 votes
public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, int flags,
		ArrayList<PackageParser.Activity> packageActivities) {
	if (packageActivities == null) {
		return null;
	}
	mFlags = flags;
	final boolean defaultOnly = (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0;
	final int N = packageActivities.size();
	ArrayList<PackageParser.ActivityIntentInfo[]> listCut = new ArrayList<PackageParser.ActivityIntentInfo[]>(
			N);

	ArrayList<PackageParser.ActivityIntentInfo> intentFilters;
	for (int i = 0; i < N; ++i) {
		intentFilters = packageActivities.get(i).intents;
		if (intentFilters != null && intentFilters.size() > 0) {
			PackageParser.ActivityIntentInfo[] array = new PackageParser.ActivityIntentInfo[intentFilters
					.size()];
			intentFilters.toArray(array);
			listCut.add(array);
		}
	}
	return super.queryIntentFromList(intent, resolvedType, defaultOnly, listCut);
}
 
Example 5
Project: aDictOnCopy   File: StubPackageMangerBuilder.java   View Source Code Vote up 5 votes
@Override
public ResolveInfo resolveActivity(Intent intent, int flags) {
    if (isDictionaryAction(intent) && flags == PackageManager.MATCH_DEFAULT_ONLY) {
        for (ResolveInfo ri : mRiList) {
            if (ri.activityInfo.packageName.equals(intent.getPackage())) {
                return ri;
            }
            // else continue to check the next candidate.
        }
        return null; // none found
    } else {
        return null;
    }
}
 
Example 6
Project: aDictOnCopy   File: StubPackageMangerBuilder.java   View Source Code Vote up 5 votes
@Override
public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) {
    if (isDictionaryAction(intent) && flags == PackageManager.MATCH_DEFAULT_ONLY) {
        return mRiList;
    } else {
        return new ArrayList<>();
    }
}
 
Example 7
Project: container   File: VPackageManagerService.java   View Source Code Vote up 4 votes
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags) {
	mFlags = flags;
	return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0);
}
 
Example 8
Project: atlas   File: AdditionalComponentIntentResolver.java   View Source Code Vote up 4 votes
public List<?> queryIntent(Intent intent, String resolvedType, int flags,int userId) {
    //mFlags = flags;
    return super.queryIntent(intent, resolvedType,
            (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0);
}
 
Example 9
Project: VirtualHook   File: VPackageManagerService.java   View Source Code Vote up 4 votes
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);
}
 
Example 10
Project: container   File: VPackageManagerService.java   View Source Code Vote up 4 votes
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, boolean defaultOnly) {
	mFlags = defaultOnly ? PackageManager.MATCH_DEFAULT_ONLY : 0;
	return super.queryIntent(intent, resolvedType, defaultOnly);
}
 
Example 11
Project: container   File: ProviderIntentResolver.java   View Source Code Vote up 4 votes
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags) {
	mFlags = flags;
	return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0);
}
 
Example 12
Project: VirtualHook   File: VPackageManagerService.java   View Source Code Vote up 4 votes
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);
}
 
Example 13
Project: VirtualHook   File: ProviderIntentResolver.java   View Source Code Vote up 4 votes
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);
}
 
Example 14
Project: VirtualHook   File: ProviderIntentResolver.java   View Source Code Vote up 4 votes
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);
}
 
Example 15
Project: TPlayer   File: VPackageManagerService.java   View Source Code Vote up 4 votes
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);
}
 
Example 16
Project: TPlayer   File: VPackageManagerService.java   View Source Code Vote up 4 votes
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);
}
 
Example 17
Project: TPlayer   File: VPackageManagerService.java   View Source Code Vote up 4 votes
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);
}
 
Example 18
Project: TPlayer   File: VPackageManagerService.java   View Source Code Vote up 4 votes
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);
}
 
Example 19
Project: container   File: VPackageManagerService.java   View Source Code Vote up 4 votes
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, boolean defaultOnly) {
	mFlags = defaultOnly ? PackageManager.MATCH_DEFAULT_ONLY : 0;
	return super.queryIntent(intent, resolvedType, defaultOnly);
}
 
Example 20
Project: TPlayer   File: ProviderIntentResolver.java   View Source Code Vote up 4 votes
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);
}