OSDN Git Service

Checking for duplicate intent with proper source bounds.
authorSunny Goyal <sunnygoyal@google.com>
Tue, 23 Aug 2016 20:25:58 +0000 (13:25 -0700)
committerAdam Cohen <adamcohen@google.com>
Wed, 24 Aug 2016 00:46:01 +0000 (00:46 +0000)
Since we are doing a equality check on the intent, items which already have
the bounds attached to the intent will not get matched, causing duplicate
icons

Bug: 27176189
Change-Id: Ia9ed9120b04e9c234304995aed13777a5773119e
(cherry picked from commit cbfe71dba38af1d1cd2d2372b649537d7d94610b)

src/com/android/launcher3/LauncherModel.java

index 6a63110..60e07f9 100644 (file)
@@ -862,7 +862,9 @@ public class LauncherModel extends BroadcastReceiver
                     Intent targetIntent = info.promisedIntent == null
                             ? info.intent : info.promisedIntent;
                     if (targetIntent != null && info.user.equals(user)) {
-                        String s = targetIntent.toUri(0);
+                        Intent copyIntent = new Intent(targetIntent);
+                        copyIntent.setSourceBounds(intent.getSourceBounds());
+                        String s = copyIntent.toUri(0);
                         if (intentWithPkg.equals(s) || intentWithoutPkg.equals(s)) {
                             return true;
                         }