本文整理汇总了Java中com.lody.virtual.helper.compat.PackageParserCompat.generateProviderInfo方法的典型用法代码示例。如果您正苦于以下问题:Java PackageParserCompat.generateProviderInfo方法的具体用法?Java PackageParserCompat.generateProviderInfo怎么用?Java PackageParserCompat.generateProviderInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lody.virtual.helper.compat.PackageParserCompat
的用法示例。
在下文中一共展示了PackageParserCompat.generateProviderInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: queryContentProviders
import com.lody.virtual.helper.compat.PackageParserCompat; //导入方法依赖的package包/类
@Override
public VParceledListSlice<ProviderInfo> queryContentProviders(String processName, int vuid, int flags) {
int userId = VUserHandle.getUserId(vuid);
checkUserId(userId);
ArrayList<ProviderInfo> finalList = new ArrayList<>(3);
// reader
synchronized (mPackages) {
for (PackageParser.Provider p : mProvidersByComponent.values()) {
AppSetting setting = (AppSetting) p.owner.mExtras;
if (processName == null || setting.appId == VUserHandle.getAppId(vuid) && p.info.processName.equals(processName)) {
ProviderInfo providerInfo = PackageParserCompat.generateProviderInfo(p, flags);
ComponentFixer.fixApplicationInfo(setting, providerInfo.applicationInfo, userId);
finalList.add(providerInfo);
}
}
}
if (!finalList.isEmpty()) {
Collections.sort(finalList, mProviderInitOrderSorter);
}
return new VParceledListSlice<>(finalList);
}
示例2: newResult
import com.lody.virtual.helper.compat.PackageParserCompat; //导入方法依赖的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: getProviderInfo
import com.lody.virtual.helper.compat.PackageParserCompat; //导入方法依赖的package包/类
@Override
public ProviderInfo getProviderInfo(ComponentName component, int flags, int userId) {
checkUserId(userId);
synchronized (mPackages) {
PackageParser.Provider p = mProvidersByComponent.get(component);
if (p != null) {
ProviderInfo providerInfo = PackageParserCompat.generateProviderInfo(p, flags);
PackageParser.Package pkg = mPackages.get(providerInfo.packageName);
AppSetting settings = (AppSetting) pkg.mExtras;
ComponentFixer.fixComponentInfo(settings, providerInfo, userId);
return providerInfo;
}
}
return null;
}
示例4: resolveContentProvider
import com.lody.virtual.helper.compat.PackageParserCompat; //导入方法依赖的package包/类
@Override
public ProviderInfo resolveContentProvider(String name, int flags, int userId) {
checkUserId(userId);
synchronized (mPackages) {
final PackageParser.Provider provider = mProvidersByAuthority.get(name);
if (provider != null) {
ProviderInfo providerInfo = PackageParserCompat.generateProviderInfo(provider, flags);
PackageParser.Package p = mPackages.get(providerInfo.packageName);
AppSetting settings = (AppSetting) p.mExtras;
ComponentFixer.fixComponentInfo(settings, providerInfo, userId);
return providerInfo;
}
}
return null;
}