Search in sources :

Example 1 with VParceledListSlice

use of com.lody.virtual.remote.VParceledListSlice in project VirtualXposed by android-hacker.

the class VPackageManagerService method getInstalledPackages.

@Override
public VParceledListSlice<PackageInfo> getInstalledPackages(int flags, int userId) {
    checkUserId(userId);
    ArrayList<PackageInfo> pkgList = new ArrayList<>(mPackages.size());
    synchronized (mPackages) {
        for (VPackage p : mPackages.values()) {
            PackageSetting ps = (PackageSetting) p.mExtras;
            PackageInfo info = generatePackageInfo(p, ps, flags, userId);
            if (info != null) {
                pkgList.add(info);
            }
        }
    }
    return new VParceledListSlice<>(pkgList);
}
Also used : VPackage(com.lody.virtual.server.pm.parser.VPackage) VParceledListSlice(com.lody.virtual.remote.VParceledListSlice) PackageInfo(android.content.pm.PackageInfo) ArrayList(java.util.ArrayList)

Example 2 with VParceledListSlice

use of com.lody.virtual.remote.VParceledListSlice in project UnityModManager by xausky.

the class VPackageManagerService method getInstalledPackages.

@Override
public VParceledListSlice<PackageInfo> getInstalledPackages(int flags, int userId) {
    checkUserId(userId);
    ArrayList<PackageInfo> pkgList = new ArrayList<>(mPackages.size());
    synchronized (mPackages) {
        for (VPackage p : mPackages.values()) {
            PackageSetting ps = (PackageSetting) p.mExtras;
            PackageInfo info = generatePackageInfo(p, ps, flags, userId);
            if (info != null) {
                pkgList.add(info);
            }
        }
    }
    return new VParceledListSlice<>(pkgList);
}
Also used : VPackage(com.lody.virtual.server.pm.parser.VPackage) VParceledListSlice(com.lody.virtual.remote.VParceledListSlice) PackageInfo(android.content.pm.PackageInfo) ArrayList(java.util.ArrayList)

Example 3 with VParceledListSlice

use of com.lody.virtual.remote.VParceledListSlice in project UnityModManager by xausky.

the class VPackageManagerService method queryContentProviders.

@Override
public VParceledListSlice<ProviderInfo> queryContentProviders(String processName, int vuid, int flags) {
    int userId = VUserHandle.getUserId(vuid);
    checkUserId(userId);
    flags = updateFlagsNought(flags);
    ArrayList<ProviderInfo> finalList = new ArrayList<>(3);
    // reader
    synchronized (mPackages) {
        for (VPackage.ProviderComponent p : mProvidersByComponent.values()) {
            PackageSetting ps = (PackageSetting) p.owner.mExtras;
            if (processName == null || ps.appId == VUserHandle.getAppId(vuid) && p.info.processName.equals(processName)) {
                ProviderInfo providerInfo = PackageParserEx.generateProviderInfo(p, flags, ps.readUserState(userId), userId);
                finalList.add(providerInfo);
            }
        }
    }
    if (!finalList.isEmpty()) {
        Collections.sort(finalList, sProviderInitOrderSorter);
    }
    return new VParceledListSlice<>(finalList);
}
Also used : VPackage(com.lody.virtual.server.pm.parser.VPackage) VParceledListSlice(com.lody.virtual.remote.VParceledListSlice) ProviderInfo(android.content.pm.ProviderInfo) ArrayList(java.util.ArrayList)

Example 4 with VParceledListSlice

use of com.lody.virtual.remote.VParceledListSlice in project UnityModManager by xausky.

the class VPackageManagerService method getInstalledApplications.

@Override
public VParceledListSlice<ApplicationInfo> getInstalledApplications(int flags, int userId) {
    checkUserId(userId);
    flags = updateFlagsNought(flags);
    ArrayList<ApplicationInfo> list = new ArrayList<>(mPackages.size());
    synchronized (mPackages) {
        for (VPackage p : mPackages.values()) {
            PackageSetting ps = (PackageSetting) p.mExtras;
            ApplicationInfo info = PackageParserEx.generateApplicationInfo(p, flags, ps.readUserState(userId), userId);
            list.add(info);
        }
    }
    return new VParceledListSlice<>(list);
}
Also used : VPackage(com.lody.virtual.server.pm.parser.VPackage) VParceledListSlice(com.lody.virtual.remote.VParceledListSlice) ApplicationInfo(android.content.pm.ApplicationInfo) ArrayList(java.util.ArrayList)

Example 5 with VParceledListSlice

use of com.lody.virtual.remote.VParceledListSlice in project VirtualXposed by android-hacker.

the class VPackageManagerService method queryContentProviders.

@Override
public VParceledListSlice<ProviderInfo> queryContentProviders(String processName, int vuid, int flags) {
    int userId = VUserHandle.getUserId(vuid);
    checkUserId(userId);
    flags = updateFlagsNought(flags);
    ArrayList<ProviderInfo> finalList = new ArrayList<>(3);
    // reader
    synchronized (mPackages) {
        for (VPackage.ProviderComponent p : mProvidersByComponent.values()) {
            PackageSetting ps = (PackageSetting) p.owner.mExtras;
            if (processName == null || ps.appId == VUserHandle.getAppId(vuid) && p.info.processName.equals(processName)) {
                ProviderInfo providerInfo = PackageParserEx.generateProviderInfo(p, flags, ps.readUserState(userId), userId);
                finalList.add(providerInfo);
            }
        }
    }
    if (!finalList.isEmpty()) {
        Collections.sort(finalList, sProviderInitOrderSorter);
    }
    return new VParceledListSlice<>(finalList);
}
Also used : VPackage(com.lody.virtual.server.pm.parser.VPackage) VParceledListSlice(com.lody.virtual.remote.VParceledListSlice) ProviderInfo(android.content.pm.ProviderInfo) ArrayList(java.util.ArrayList)

Aggregations

VParceledListSlice (com.lody.virtual.remote.VParceledListSlice)9 VPackage (com.lody.virtual.server.pm.parser.VPackage)9 ArrayList (java.util.ArrayList)9 ApplicationInfo (android.content.pm.ApplicationInfo)3 PackageInfo (android.content.pm.PackageInfo)3 ProviderInfo (android.content.pm.ProviderInfo)3