use of com.lody.virtual.server.pm.parser.VPackage in project VirtualApp by asLody.
the class VAppManagerService method getInstalledAppsAsUser.
@Override
public List<InstalledAppInfo> getInstalledAppsAsUser(int userId, int flags) {
List<InstalledAppInfo> infoList = new ArrayList<>(getInstalledAppCount());
for (VPackage p : PackageCacheManager.PACKAGE_CACHE.values()) {
PackageSetting setting = (PackageSetting) p.mExtras;
boolean visible = setting.isInstalled(userId);
if ((flags & VirtualCore.GET_HIDDEN_APP) == 0 && setting.isHidden(userId)) {
visible = false;
}
if (visible) {
infoList.add(setting.getAppInfo(flags));
}
}
return infoList;
}
use of com.lody.virtual.server.pm.parser.VPackage in project VirtualApp by asLody.
the class VPackageManagerService method queryIntentContentProviders.
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
public List<ResolveInfo> queryIntentContentProviders(Intent intent, String resolvedType, int flags, int userId) {
checkUserId(userId);
flags = updateFlagsNought(flags);
ComponentName comp = intent.getComponent();
if (comp == null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
if (intent.getSelector() != null) {
intent = intent.getSelector();
comp = intent.getComponent();
}
}
}
if (comp != null) {
final List<ResolveInfo> list = new ArrayList<ResolveInfo>(1);
final ProviderInfo pi = getProviderInfo(comp, flags, userId);
if (pi != null) {
final ResolveInfo ri = new ResolveInfo();
ri.providerInfo = pi;
list.add(ri);
}
return list;
}
// reader
synchronized (mPackages) {
String pkgName = intent.getPackage();
if (pkgName == null) {
return mProviders.queryIntent(intent, resolvedType, flags, userId);
}
final VPackage pkg = mPackages.get(pkgName);
if (pkg != null) {
return mProviders.queryIntentForPackage(intent, resolvedType, flags, pkg.providers, userId);
}
return null;
}
}
use of com.lody.virtual.server.pm.parser.VPackage in project VirtualApp by asLody.
the class VPackageManagerService method getProviderInfo.
@Override
public ProviderInfo getProviderInfo(ComponentName component, int flags, int userId) {
checkUserId(userId);
flags = updateFlagsNought(flags);
synchronized (mPackages) {
VPackage p = mPackages.get(component.getPackageName());
if (p != null) {
PackageSetting ps = (PackageSetting) p.mExtras;
VPackage.ProviderComponent provider = mProvidersByComponent.get(component);
if (provider != null) {
ProviderInfo providerInfo = PackageParserEx.generateProviderInfo(provider, flags, ps.readUserState(userId), userId);
ComponentFixer.fixComponentInfo(ps, providerInfo, userId);
return providerInfo;
}
}
}
return null;
}
use of com.lody.virtual.server.pm.parser.VPackage in project VirtualApp by asLody.
the class VPackageManagerService method queryIntentReceivers.
@Override
public List<ResolveInfo> queryIntentReceivers(Intent intent, String resolvedType, int flags, int userId) {
checkUserId(userId);
flags = updateFlagsNought(flags);
ComponentName comp = intent.getComponent();
if (comp == null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
if (intent.getSelector() != null) {
intent = intent.getSelector();
comp = intent.getComponent();
}
}
}
if (comp != null) {
List<ResolveInfo> list = new ArrayList<ResolveInfo>(1);
ActivityInfo ai = getReceiverInfo(comp, flags, userId);
if (ai != null) {
ResolveInfo ri = new ResolveInfo();
ri.activityInfo = ai;
list.add(ri);
}
return list;
}
// reader
synchronized (mPackages) {
String pkgName = intent.getPackage();
if (pkgName == null) {
return mReceivers.queryIntent(intent, resolvedType, flags, userId);
}
final VPackage pkg = mPackages.get(pkgName);
if (pkg != null) {
return mReceivers.queryIntentForPackage(intent, resolvedType, flags, pkg.receivers, userId);
}
return null;
}
}
use of com.lody.virtual.server.pm.parser.VPackage in project VirtualApp by asLody.
the class PackagePersistenceLayer method writePersistenceData.
@Override
public void writePersistenceData(Parcel p) {
synchronized (PackageCacheManager.PACKAGE_CACHE) {
p.writeInt(PackageCacheManager.PACKAGE_CACHE.size());
for (VPackage pkg : PackageCacheManager.PACKAGE_CACHE.values()) {
PackageSetting ps = (PackageSetting) pkg.mExtras;
ps.writeToParcel(p, 0);
}
}
}
Aggregations