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

Commit e6691f34 authored by Jon Miranda's avatar Jon Miranda Committed by android-build-merger
Browse files

Add additional shortcutExists check to prevent same app from being auto added.

am: f788bbb0

Change-Id: I42f0c4d75f8be38b9e81c5932fc1def710a68f36
parents 1d222f9e f788bbb0
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -140,6 +140,15 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
                        // or app was already installed for another user.
                        itemInfo = new AppInfo(app.getContext(), activities.get(0), item.user)
                                .makeWorkspaceItem();

                        if (shortcutExists(dataModel, itemInfo.getIntent(), itemInfo.user)) {
                            // We need this additional check here since we treat all auto added
                            // workspace items as promise icons. At this point we now have the
                            // correct intent to compare against existing workspace icons.
                            // Icon already exists on the workspace and should not be auto-added.
                            continue;
                        }

                        WorkspaceItemInfo wii = (WorkspaceItemInfo) itemInfo;
                        wii.title = "";
                        wii.bitmap = app.getIconCache().getDefaultIcon(item.user);