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

The following examples show how to use android.content.pm.PackageManager#MATCH_DEFAULT_ONLY .
Example 1
Project: AndroidComponentPlugin   File: ComponentResolver.java    License: Apache License 2.0 6 votes vote down vote up
List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType,
        int flags, List<PackageParser.Activity> packageActivities, int userId) {
    if (!sUserManager.exists(userId)) {
        return null;
    }
    if (packageActivities == null) {
        return null;
    }
    mFlags = flags;
    final boolean defaultOnly = (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0;
    final int activitiesSize = packageActivities.size();
    ArrayList<PackageParser.ActivityIntentInfo[]> listCut = new ArrayList<>(activitiesSize);

    ArrayList<PackageParser.ActivityIntentInfo> intentFilters;
    for (int i = 0; i < activitiesSize; ++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, userId);
}
 
Example 2
Project: AndroidComponentPlugin   File: ComponentResolver.java    License: Apache License 2.0 6 votes vote down vote up
List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType,
        int flags, List<PackageParser.Provider> packageProviders, int userId) {
    if (!sUserManager.exists(userId)) {
        return null;
    }
    if (packageProviders == null) {
        return null;
    }
    mFlags = flags;
    final boolean defaultOnly = (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0;
    final int providersSize = packageProviders.size();
    ArrayList<PackageParser.ProviderIntentInfo[]> listCut = new ArrayList<>(providersSize);

    ArrayList<PackageParser.ProviderIntentInfo> intentFilters;
    for (int i = 0; i < providersSize; ++i) {
        intentFilters = packageProviders.get(i).intents;
        if (intentFilters != null && intentFilters.size() > 0) {
            PackageParser.ProviderIntentInfo[] array =
                    new PackageParser.ProviderIntentInfo[intentFilters.size()];
            intentFilters.toArray(array);
            listCut.add(array);
        }
    }
    return super.queryIntentFromList(intent, resolvedType, defaultOnly, listCut, userId);
}
 
Example 3
Project: koala--Android-Plugin-Runtime-   File: ActivityIntentResolver.java    License: Apache License 2.0 6 votes vote down vote up
public List 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;
	int N = packageActivities.size();
	ArrayList<ArrayList<PackageParser.ActivityIntentInfo>> listCut = new ArrayList<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) {
			listCut.add(intentFilters);
		}
	}
	return super.queryIntentFromList(intent, resolvedType, defaultOnly,
			listCut);
}
 
Example 4
Project: AndroidComponentPlugin   File: ComponentResolver.java    License: Apache License 2.0 6 votes vote down vote up
List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType,
        int flags, List<PackageParser.Service> packageServices, int userId) {
    if (!sUserManager.exists(userId)) return null;
    if (packageServices == null) {
        return null;
    }
    mFlags = flags;
    final boolean defaultOnly = (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0;
    final int servicesSize = packageServices.size();
    ArrayList<PackageParser.ServiceIntentInfo[]> listCut = new ArrayList<>(servicesSize);

    ArrayList<PackageParser.ServiceIntentInfo> intentFilters;
    for (int i = 0; i < servicesSize; ++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, userId);
}
 
Example 5
Project: container   File: VPackageManagerService.java    License: GNU General Public License v3.0 6 votes vote down vote up
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 6
Project: koala--Android-Plugin-Runtime-   File: ServiceIntentResolver.java    License: Apache License 2.0 6 votes vote down vote up
public List 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;
	int N = packageServices.size();
	ArrayList<ArrayList<PackageParser.ServiceIntentInfo>> listCut = new ArrayList<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) {
			listCut.add(intentFilters);
		}
	}
	return super.queryIntentFromList(intent, resolvedType, defaultOnly,
			listCut);
}
 
Example 7
Project: container   File: VPackageManagerService.java    License: GNU General Public License v3.0 6 votes vote down vote up
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 8
Project: container   File: ProviderIntentResolver.java    License: GNU General Public License v3.0 6 votes vote down vote up
public List<ResolveInfo> queryIntentForPackage(Intent intent, String resolvedType, int flags,
		ArrayList<PackageParser.Provider> packageProviders) {
	if (packageProviders == null) {
		return null;
	}
	mFlags = flags;
	final boolean defaultOnly = (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0;
	final int N = packageProviders.size();
	ArrayList<PackageParser.ProviderIntentInfo[]> listCut = new ArrayList<>(N);

	ArrayList<PackageParser.ProviderIntentInfo> intentFilters;
	for (int i = 0; i < N; ++i) {
		intentFilters = packageProviders.get(i).intents;
		if (intentFilters != null && intentFilters.size() > 0) {
			PackageParser.ProviderIntentInfo[] array = new PackageParser.ProviderIntentInfo[intentFilters
					.size()];
			intentFilters.toArray(array);
			listCut.add(array);
		}
	}
	return super.queryIntentFromList(intent, resolvedType, defaultOnly, listCut);
}
 
Example 9
Project: AndroidComponentPlugin   File: ComponentResolver.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType,
        boolean defaultOnly, int userId) {
    if (!sUserManager.exists(userId)) return null;
    mFlags = (defaultOnly ? PackageManager.MATCH_DEFAULT_ONLY : 0);
    return super.queryIntent(intent, resolvedType, defaultOnly, userId);
}
 
Example 10
Project: AndroidComponentPlugin   File: ComponentResolver.java    License: Apache License 2.0 5 votes vote down vote up
List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags,
        int userId) {
    if (!sUserManager.exists(userId)) {
        return null;
    }
    mFlags = flags;
    return super.queryIntent(intent, resolvedType,
            (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0,
            userId);
}
 
Example 11
Project: AndroidComponentPlugin   File: ComponentResolver.java    License: Apache License 2.0 5 votes vote down vote up
List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags,
        int userId) {
    if (!sUserManager.exists(userId)) {
        return null;
    }
    mFlags = flags;
    return super.queryIntent(intent, resolvedType,
            (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0,
            userId);
}
 
Example 12
Project: AndroidComponentPlugin   File: ComponentResolver.java    License: Apache License 2.0 5 votes vote down vote up
List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags,
        int userId) {
    if (!sUserManager.exists(userId)) return null;
    mFlags = flags;
    return super.queryIntent(intent, resolvedType,
            (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0,
            userId);
}
 
Example 13
Project: AndroidComponentPlugin   File: ComponentResolver.java    License: Apache License 2.0 4 votes vote down vote up
@Override
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: container   File: VPackageManagerService.java    License: GNU General Public License v3.0 4 votes vote down vote up
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, boolean defaultOnly) {
	mFlags = defaultOnly ? PackageManager.MATCH_DEFAULT_ONLY : 0;
	return super.queryIntent(intent, resolvedType, defaultOnly);
}
 
Example 15
Project: container   File: VPackageManagerService.java    License: GNU General Public License v3.0 4 votes vote down vote up
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags) {
	mFlags = flags;
	return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0);
}
 
Example 16
Project: container   File: VPackageManagerService.java    License: GNU General Public License v3.0 4 votes vote down vote up
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, boolean defaultOnly) {
	mFlags = defaultOnly ? PackageManager.MATCH_DEFAULT_ONLY : 0;
	return super.queryIntent(intent, resolvedType, defaultOnly);
}
 
Example 17
Project: container   File: ProviderIntentResolver.java    License: GNU General Public License v3.0 4 votes vote down vote up
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, boolean defaultOnly) {
	mFlags = defaultOnly ? PackageManager.MATCH_DEFAULT_ONLY : 0;
	return super.queryIntent(intent, resolvedType, defaultOnly);
}
 
Example 18
Project: container   File: ProviderIntentResolver.java    License: GNU General Public License v3.0 4 votes vote down vote up
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags) {
	mFlags = flags;
	return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0);
}
 
Example 19
Project: koala--Android-Plugin-Runtime-   File: ServiceIntentResolver.java    License: Apache License 2.0 4 votes vote down vote up
public List queryIntent(Intent intent, String resolvedType, int flags) {
	mFlags = flags;
	return super.queryIntent(intent, resolvedType,
			(flags & PackageManager.MATCH_DEFAULT_ONLY) != 0);
}
 
Example 20
Project: koala--Android-Plugin-Runtime-   File: ProviderIntentResolver.java    License: Apache License 2.0 4 votes vote down vote up
public List queryIntent(Intent intent, String resolvedType, int flags) {
	mFlags = flags;
	return super.queryIntent(intent, resolvedType,
			(flags & PackageManager.MATCH_DEFAULT_ONLY) != 0);
}