本文整理汇总了Java中android.content.pm.PackageParser.ProviderIntentInfo方法的典型用法代码示例。如果您正苦于以下问题:Java PackageParser.ProviderIntentInfo方法的具体用法?Java PackageParser.ProviderIntentInfo怎么用?Java PackageParser.ProviderIntentInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.pm.PackageParser
的用法示例。
在下文中一共展示了PackageParser.ProviderIntentInfo方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: queryIntentForPackage
import android.content.pm.PackageParser; //导入方法依赖的package包/类
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);
}
示例2: newResult
import android.content.pm.PackageParser; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
protected ResolveInfo newResult(PackageParser.ProviderIntentInfo filter, int match) {
final PackageParser.Provider provider = filter.provider;
ProviderInfo pi = PackageParserCompat.generateProviderInfo(provider, mFlags);
if (pi == null) {
return null;
}
final ResolveInfo res = new ResolveInfo();
res.providerInfo = pi;
if ((mFlags & PackageManager.GET_RESOLVED_FILTER) != 0) {
res.filter = filter;
}
res.priority = filter.getPriority();
res.preferredOrder = provider.owner.mPreferredOrder;
res.match = match;
res.isDefault = filter.hasDefault;
res.labelRes = filter.labelRes;
res.nonLocalizedLabel = filter.nonLocalizedLabel;
res.icon = filter.icon;
return res;
}
示例3: addProvider
import android.content.pm.PackageParser; //导入方法依赖的package包/类
public final void addProvider(PackageParser.Provider p) {
if (mProviders.containsKey(p.getComponentName())) {
VLog.w(TAG, "Provider " + p.getComponentName() + " already defined; ignoring");
return;
}
mProviders.put(p.getComponentName(), p);
final int NI = p.intents.size();
int j;
for (j = 0; j < NI; j++) {
PackageParser.ProviderIntentInfo intent = p.intents.get(j);
addFilter(intent);
}
}
示例4: removeProvider
import android.content.pm.PackageParser; //导入方法依赖的package包/类
public final void removeProvider(PackageParser.Provider p) {
mProviders.remove(p.getComponentName());
final int NI = p.intents.size();
int j;
for (j = 0; j < NI; j++) {
PackageParser.ProviderIntentInfo intent = p.intents.get(j);
removeFilter(intent);
}
}
示例5: allowFilterResult
import android.content.pm.PackageParser; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
protected boolean allowFilterResult(PackageParser.ProviderIntentInfo filter, List<ResolveInfo> dest) {
ProviderInfo filterPi = filter.provider.info;
for (int i = dest.size() - 1; i >= 0; i--) {
ProviderInfo destPi = dest.get(i).providerInfo;
if (ObjectsCompat.equals(destPi.name, filterPi.name)
&& ObjectsCompat.equals(destPi.packageName, filterPi.packageName)) {
return false;
}
}
return true;
}
示例6: newArray
import android.content.pm.PackageParser; //导入方法依赖的package包/类
@Override
protected PackageParser.ProviderIntentInfo[] newArray(int size) {
return new PackageParser.ProviderIntentInfo[size];
}
示例7: isFilterStopped
import android.content.pm.PackageParser; //导入方法依赖的package包/类
@Override
protected boolean isFilterStopped(PackageParser.ProviderIntentInfo filter) {
return false;
}
示例8: isPackageForFilter
import android.content.pm.PackageParser; //导入方法依赖的package包/类
@Override
protected boolean isPackageForFilter(String packageName, PackageParser.ProviderIntentInfo info) {
return packageName.equals(info.provider.owner.packageName);
}
示例9: filterToLabel
import android.content.pm.PackageParser; //导入方法依赖的package包/类
@Override
protected Object filterToLabel(PackageParser.ProviderIntentInfo filter) {
return filter.provider;
}
示例10: dumpFilter
import android.content.pm.PackageParser; //导入方法依赖的package包/类
@Override
protected void dumpFilter(PrintWriter out, String prefix, PackageParser.ProviderIntentInfo filter) {
}