use of com.android.launcher3.compat.ShortcutConfigActivityInfo.ShortcutConfigActivityInfoVO in project Neo-Launcher by NeoApplications.
the class LauncherAppsCompatVO method getCustomShortcutActivityList.
@Override
public List<ShortcutConfigActivityInfo> getCustomShortcutActivityList(@Nullable PackageUserKey packageUser) {
List<ShortcutConfigActivityInfo> result = new ArrayList<>();
UserHandle myUser = Process.myUserHandle();
final List<UserHandle> users;
final String packageName;
if (packageUser == null) {
users = UserManagerCompat.getInstance(mContext).getUserProfiles();
packageName = null;
} else {
users = new ArrayList<>(1);
users.add(packageUser.mUser);
packageName = packageUser.mPackageName;
}
for (UserHandle user : users) {
boolean ignoreTargetSdk = myUser.equals(user);
List<LauncherActivityInfo> activities = mLauncherApps.getShortcutConfigActivityList(packageName, user);
for (LauncherActivityInfo activityInfo : activities) {
if (ignoreTargetSdk || activityInfo.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.O) {
result.add(new ShortcutConfigActivityInfoVO(activityInfo));
}
}
}
return result;
}
Aggregations