Unregistering receiver in onStart/Stop vs onCreate/Destroy. (Bug 16513124)

Change-Id: I11ccc3cea41311d74811dc19e6950da3bbddbfe2
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 cd2cbe7..1a32b81 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -121,6 +121,17 @@
         }
     }
 
+    /** Removes all the task stack views from this recents view. */
+    public void removeAllTaskStacks() {
+        int childCount = getChildCount();
+        for (int i = childCount - 1; i >= 0; i--) {
+            View child = getChildAt(i);
+            if (child != mSearchBar) {
+                removeViewAt(i);
+            }
+        }
+    }
+
     /** Launches the focused task from the first stack if possible */
     public boolean launchFocusedTask() {
         // Get the first stack view