Merge "Support floating but long-lived shortcuts to be pinned in ShortcutLauncher. Floating shortcuts can surface on sharesheet to be pinned." into tm-qpr-dev
This commit is contained in:
@@ -144,8 +144,8 @@ class ShortcutLauncher extends ShortcutPackageItem {
|
|||||||
final ArraySet<String> prevSet = mPinnedShortcuts.get(pu);
|
final ArraySet<String> prevSet = mPinnedShortcuts.get(pu);
|
||||||
|
|
||||||
// Actually pin shortcuts.
|
// Actually pin shortcuts.
|
||||||
// This logic here is to make sure a launcher cannot pin a shortcut that is floating
|
// This logic here is to make sure a launcher cannot pin a shortcut that is not dynamic
|
||||||
// (i.e. not dynamic nor manifest but is pinned) and pinned by another launcher.
|
// nor long-lived nor manifest but is pinned.
|
||||||
// In this case, technically the shortcut doesn't exist to this launcher, so it can't
|
// In this case, technically the shortcut doesn't exist to this launcher, so it can't
|
||||||
// pin it.
|
// pin it.
|
||||||
// (Maybe unnecessarily strict...)
|
// (Maybe unnecessarily strict...)
|
||||||
@@ -158,7 +158,7 @@ class ShortcutLauncher extends ShortcutPackageItem {
|
|||||||
if (si == null) {
|
if (si == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (si.isDynamic()
|
if (si.isDynamic() || si.isLongLived()
|
||||||
|| si.isManifestShortcut()
|
|| si.isManifestShortcut()
|
||||||
|| (prevSet != null && prevSet.contains(id))
|
|| (prevSet != null && prevSet.contains(id))
|
||||||
|| forPinRequest) {
|
|| forPinRequest) {
|
||||||
|
|||||||
Reference in New Issue
Block a user