mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Do not allow duplicate shortcuts when ALL_APPS is disabled.
When DISABLE_ALL_APPS is true, we want to have only one shortcut for each activityexposed via the Application's manifest. We ignore INSTALL_SHORTCUT broadcasts which have launch intents with ACTION_MAIN and CATEGORY_LAUNCHER. Applications can still create shortcuts pointing to an already exposed component if they provide data or extras in the intent. Change-Id: I0b05283ea6c522d197e0262c2997f7298e08740b
This commit is contained in:
@@ -266,19 +266,8 @@ public class DeleteDropTarget extends ButtonDropTarget {
|
||||
private boolean isUninstallFromWorkspace(DragObject d) {
|
||||
if (AppsCustomizePagedView.DISABLE_ALL_APPS && isWorkspaceOrFolderApplication(d)) {
|
||||
ShortcutInfo shortcut = (ShortcutInfo) d.dragInfo;
|
||||
if (shortcut.intent != null && shortcut.intent.getComponent() != null) {
|
||||
Set<String> categories = shortcut.intent.getCategories();
|
||||
boolean includesLauncherCategory = false;
|
||||
if (categories != null) {
|
||||
for (String category : categories) {
|
||||
if (category.equals(Intent.CATEGORY_LAUNCHER)) {
|
||||
includesLauncherCategory = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return includesLauncherCategory;
|
||||
}
|
||||
// Only allow manifest shortcuts to initiate an un-install.
|
||||
return !InstallShortcutReceiver.isValidShortcutLaunchIntent(shortcut.intent);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user