本文整理汇总了Java中android.content.pm.PackageManager.MATCH_DEFAULT_ONLY属性的典型用法代码示例。如果您正苦于以下问题:Java PackageManager.MATCH_DEFAULT_ONLY属性的具体用法?Java PackageManager.MATCH_DEFAULT_ONLY怎么用?Java PackageManager.MATCH_DEFAULT_ONLY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.content.pm.PackageManager
的用法示例。
在下文中一共展示了PackageManager.MATCH_DEFAULT_ONLY属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: queryIntentForPackage
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);
}
示例2: queryIntentForPackage
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);
}
示例3: queryIntentForPackage
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);
}
示例4: resolveActivity
@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;
}
}
示例5: queryIntentActivities
@Override
public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) {
if (isDictionaryAction(intent) && flags == PackageManager.MATCH_DEFAULT_ONLY) {
return mRiList;
} else {
return new ArrayList<>();
}
}
示例6: queryIntent
public List<ResolveInfo> queryIntent(Intent intent, String resolvedType, int flags) {
mFlags = flags;
return super.queryIntent(intent, resolvedType, (flags & PackageManager.MATCH_DEFAULT_ONLY) != 0);
}
示例7: queryIntent
public List<?> queryIntent(Intent intent, String resolvedType, int flags,int userId) {
//mFlags = flags;
return super.queryIntent(intent, resolvedType,
(flags & PackageManager.MATCH_DEFAULT_ONLY) != 0);
}
示例8: queryIntent
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);
}
示例9: queryIntent
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);
}
示例10: queryIntent
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);
}