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

Commit 1eab8cb6 authored by Song Hu's avatar Song Hu
Browse files

Support floating but long-lived shortcuts to be pinned in ShortcutLauncher....

Support floating but long-lived shortcuts to be pinned in ShortcutLauncher. Floating shortcuts can surface on sharesheet to be pinned.

Bug: 234842557
Test: manual test on local phone
Test: atest
Change-Id: I91fce93b477ae7d1fdd8867948bd28a028a7cc5f
parent 3b628d7c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -144,8 +144,8 @@ class ShortcutLauncher extends ShortcutPackageItem {
            final ArraySet<String> prevSet = mPinnedShortcuts.get(pu);

            // Actually pin shortcuts.
            // This logic here is to make sure a launcher cannot pin a shortcut that is floating
            // (i.e. not dynamic nor manifest but is pinned) and pinned by another launcher.
            // This logic here is to make sure a launcher cannot pin a shortcut that is not dynamic
            // nor long-lived nor manifest but is pinned.
            // In this case, technically the shortcut doesn't exist to this launcher, so it can't
            // pin it.
            // (Maybe unnecessarily strict...)
@@ -158,7 +158,7 @@ class ShortcutLauncher extends ShortcutPackageItem {
                if (si == null) {
                    continue;
                }
                if (si.isDynamic()
                if (si.isDynamic() || si.isLongLived()
                        || si.isManifestShortcut()
                        || (prevSet != null && prevSet.contains(id))
                        || forPinRequest) {