Removing "remove" accessibility action for deep shortcuts in menu
Bug: 116023881
Test: Manual
Change-Id: Ia9c25e2e1b4cbca9d2c87a17464c175733955ccf
diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java
index d60dc87..70c8aaa 100644
--- a/src/com/android/launcher3/DeleteDropTarget.java
+++ b/src/com/android/launcher3/DeleteDropTarget.java
@@ -16,6 +16,8 @@
package com.android.launcher3;
+import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
+
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
@@ -62,8 +64,12 @@
*/
@Override
public boolean supportsAccessibilityDrop(ItemInfo info, View view) {
- return (info instanceof ShortcutInfo)
- || (info instanceof LauncherAppWidgetInfo)
+ if (info instanceof ShortcutInfo) {
+ // Support the action unless the item is in a context menu.
+ return info.screenId >= 0;
+ }
+
+ return (info instanceof LauncherAppWidgetInfo)
|| (info instanceof FolderInfo);
}