PackageManager resolveService - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for PackageManager resolveService method.

This code example shows how to use the following methods:resolveService
    static Intent validateKatanaServiceIntent(Context context, Intent intent) {
        if (intent == null) {
            return null; 
        } 
 
        ResolveInfo resolveInfo = context.getPackageManager().resolveService(intent, 0);
        if (resolveInfo == null) {
            return null; 
        } 
 
        if (!validateSignature(context, resolveInfo.serviceInfo.packageName)) {
            return null; 
        } 
 
        return intent;
    } 
 
    static Intent createProxyAuthIntent(Context context, String applicationId, List<String> permissions) {
        Intent intent = new Intent()
                .setClassName(KATANA_PACKAGE, KATANA_PROXY_AUTH_ACTIVITY)

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:checkSignatures, getComponentEnabledSetting, resolveService
	 * @return true if ads should be hidden 
	 */ 
	public static boolean hideAds(final Context context) {
		PackageManager pm = context.getPackageManager();
		Intent donationCheck = new Intent(DONATOR_BROADCAST_CHECK);
		ResolveInfo ri = pm.resolveService(donationCheck, 0);
		// Log.d(TAG, "ri: " + ri); 
		int match = PackageManager.SIGNATURE_UNKNOWN_PACKAGE;
		if (ri != null) {
			Log.d(TAG, "found package: " + ri.serviceInfo.packageName);
			ComponentName cn = new ComponentName(ri.serviceInfo.packageName, ri.serviceInfo.name);
			// Log.d(TAG, "component name: " + cn); 
			int i = pm.getComponentEnabledSetting(cn);
			// Log.d(TAG, "component status: " + i); 
			// Log.d(TAG, "package status: " + ri.serviceInfo.enabled); 
			if (i == PackageManager.COMPONENT_ENABLED_STATE_ENABLED
					|| i == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
					&& ri.serviceInfo.enabled) {
				match = pm.checkSignatures(context.getPackageName(), ri.serviceInfo.packageName);
			} else { 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:resolveService
        return wrapped.queryBroadcastReceivers(intent, flags);
    } 
 
    @Override 
    public ResolveInfo resolveService(Intent intent, int flags) {
        return wrapped.resolveService(intent, flags);
    } 
 
    @Override 
    public List<ResolveInfo> queryIntentServices(Intent intent, int flags) {
        return wrapped.queryIntentServices(intent, flags);
    } 
 
    @Override 
    public ProviderInfo resolveContentProvider(String name, int flags) {
        return wrapped.resolveContentProvider(name, flags);
    } 
 
    @Override 
    public List<ProviderInfo> queryContentProviders(String processName, int uid, int flags) {
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
resolveService Method Overview
Determine the best service to handle for a given Intent.
See Code Examples for other Android PackageManager Methods: