Workaround to prevent starting the same task from Recents twice. (Bug 17322903)
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 1ac3bc3..0c6e7b6 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -67,6 +67,7 @@
     ArrayList<TaskStack> mStacks;
     View mSearchBar;
     RecentsViewCallbacks mCb;
+    boolean mAlreadyLaunchingTask;
 
     public RecentsView(Context context) {
         super(context);
@@ -120,6 +121,9 @@
             }
             addView(stackView);
         }
+
+        // Reset the launched state
+        mAlreadyLaunchingTask = false;
     }
 
     /** Removes all the task stack views from this recents view. */
@@ -381,6 +385,11 @@
         if (mCb != null) {
             mCb.onTaskViewClicked();
         }
+        // Skip if we are already launching tasks
+        if (mAlreadyLaunchingTask) {
+            return;
+        }
+        mAlreadyLaunchingTask = true;
 
         // Upfront the processing of the thumbnail
         TaskViewTransform transform = new TaskViewTransform();