Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca258b36 authored by Tony Wickham's avatar Tony Wickham
Browse files

Only add shortcuts to the deep shortcut map if they are dynamic/manifest.

Bug: 30475465
Change-Id: I93aff6330b86a3bfa3e6b5741ab759d835618f0b
parent 55f5bd73
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2842,7 +2842,9 @@ public class LauncherModel extends BroadcastReceiver

        // Now add the new shortcuts to the map.
        for (ShortcutInfoCompat shortcut : shortcuts) {
            if (shortcut.isEnabled()) {
            boolean shouldShowInContainer = shortcut.isEnabled()
                    && (shortcut.isDeclaredInManifest() || shortcut.isDynamic());
            if (shouldShowInContainer) {
                ComponentKey targetComponent
                        = new ComponentKey(shortcut.getActivity(), shortcut.getUserHandle());
                mBgDeepShortcutMap.addToList(targetComponent, shortcut.getId());
+4 −1
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.os.Build;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.compat.UserHandleCompat;
import com.android.launcher3.compat.UserManagerCompat;
import com.android.launcher3.util.ComponentKey;

/**
 * Wrapper class for {@link android.content.pm.ShortcutInfo}, representing deep shortcuts into apps.
@@ -105,6 +104,10 @@ public class ShortcutInfoCompat {
        return mShortcutInfo.isEnabled();
    }

    public boolean isDynamic() {
        return mShortcutInfo.isDynamic();
    }

    public int getRank() {
        return mShortcutInfo.getRank();
    }