use of io.virtualapp.home.models.PackageAppData in project VirtualApp by asLody.
the class AppRepository method getVirtualApps.
@Override
public Promise<List<AppData>, Throwable, Void> getVirtualApps() {
return VUiKit.defer().when(() -> {
List<InstalledAppInfo> infos = VirtualCore.get().getInstalledApps(0);
List<AppData> models = new ArrayList<>();
for (InstalledAppInfo info : infos) {
if (!VirtualCore.get().isPackageLaunchable(info.packageName)) {
continue;
}
PackageAppData data = new PackageAppData(mContext, info);
if (VirtualCore.get().isAppInstalledAsUser(0, info.packageName)) {
models.add(data);
}
int[] userIds = info.getInstalledUsers();
for (int userId : userIds) {
if (userId != 0) {
models.add(new MultiplePackageAppData(data, userId));
}
}
}
return models;
});
}
Aggregations