Search in sources :

Example 1 with ShortcutConfigActivityInfoVL

use of com.android.launcher3.compat.ShortcutConfigActivityInfo.ShortcutConfigActivityInfoVL in project Neo-Launcher by NeoApplications.

the class LauncherAppsCompatVL method getCustomShortcutActivityList.

@Override
public List<ShortcutConfigActivityInfo> getCustomShortcutActivityList(@Nullable PackageUserKey packageUser) {
    List<ShortcutConfigActivityInfo> result = new ArrayList<>();
    if (packageUser != null && !packageUser.mUser.equals(Process.myUserHandle())) {
        return result;
    }
    PackageManager pm = mContext.getPackageManager();
    for (ResolveInfo info : pm.queryIntentActivities(new Intent(Intent.ACTION_CREATE_SHORTCUT), 0)) {
        if (packageUser == null || packageUser.mPackageName.equals(info.activityInfo.packageName)) {
            result.add(new ShortcutConfigActivityInfoVL(info.activityInfo));
        }
    }
    return result;
}
Also used : ResolveInfo(android.content.pm.ResolveInfo) PackageManager(android.content.pm.PackageManager) ArrayList(java.util.ArrayList) Intent(android.content.Intent) ShortcutConfigActivityInfoVL(com.android.launcher3.compat.ShortcutConfigActivityInfo.ShortcutConfigActivityInfoVL)

Aggregations

Intent (android.content.Intent)1 PackageManager (android.content.pm.PackageManager)1 ResolveInfo (android.content.pm.ResolveInfo)1 ShortcutConfigActivityInfoVL (com.android.launcher3.compat.ShortcutConfigActivityInfo.ShortcutConfigActivityInfoVL)1 ArrayList (java.util.ArrayList)1