From 672d07f3f0bee663ad8447fbbb2890760c1a18ce Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 27 Jul 2016 18:22:41 -0700 Subject: [PATCH] Check package name and user handle in onShortcutsChanged(). Otherwise shortcuts with the same id would be updated, even if they were in different packages. Bug: 28980830 Change-Id: Ideefe3aaac83af38c03a38d821bac192ae55fe67 --- src/com/android/launcher3/LauncherModel.java | 8 +++++--- src/com/android/launcher3/ShortcutInfo.java | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 4561111158..17c39faa2b 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -3332,9 +3332,11 @@ public class LauncherModel extends BroadcastReceiver for (ItemInfo itemInfo : sBgItemsIdMap) { if (itemInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) { ShortcutInfo si = (ShortcutInfo) itemInfo; - String shortcutId = si.getDeepShortcutId(); - if (idsToShortcuts.containsKey(shortcutId)) { - idsToWorkspaceShortcutInfos.addToList(shortcutId, si); + if (si.getIntent().getPackage().equals(mPackageName) && si.user.equals(mUser)) { + String shortcutId = si.getDeepShortcutId(); + if (idsToShortcuts.containsKey(shortcutId)) { + idsToWorkspaceShortcutInfos.addToList(shortcutId, si); + } } } } diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java index 0cc5a1b926..c87bc08c94 100644 --- a/src/com/android/launcher3/ShortcutInfo.java +++ b/src/com/android/launcher3/ShortcutInfo.java @@ -28,7 +28,6 @@ import android.text.TextUtils; import com.android.launcher3.LauncherSettings.Favorites; import com.android.launcher3.compat.LauncherActivityInfoCompat; -import com.android.launcher3.compat.LauncherAppsCompat; import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.folder.FolderIcon;