Merge "Mask bitmap creation errors while dragging shortcuts." into froyo
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 132f0e9..52f1224 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -204,7 +204,6 @@
     private ImageView mNextView;
 
     // Hotseats (quick-launch icons next to AllApps)
-    // TODO: move these intial intents out to Uris in an XML resource
     private static final int NUM_HOTSEATS = 2;
     private String[] mHotseatConfig = null;
     private Intent[] mHotseats = null;
@@ -782,6 +781,8 @@
 
     @SuppressWarnings({"UnusedDeclaration"})
     public void launchHotSeat(View v) {
+        if (isAllAppsVisible()) return;
+
         int index = -1;
         if (v.getId() == R.id.hotseat_left) {
             index = 0;
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index a867200..6127649 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -623,6 +623,14 @@
                     // sections.
                     mLoaderThread = null;
                 }
+
+                // Trigger a gc to try to clean up after the stuff is done, since the
+                // renderscript allocations aren't charge to the java heap.
+                mHandler.post(new Runnable() {
+                        public void run() {
+                            System.gc();
+                        }
+                    });
             }
 
             public void stopLocked() {
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index f65d956..c337c30 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -36,6 +36,7 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.util.AttributeSet;
+import android.util.Log;
 import android.view.MotionEvent;
 import android.view.VelocityTracker;
 import android.view.View;
@@ -363,7 +364,9 @@
      */
     void addInScreen(View child, int screen, int x, int y, int spanX, int spanY, boolean insert) {
         if (screen < 0 || screen >= getChildCount()) {
-            throw new IllegalStateException("The screen must be >= 0 and < " + getChildCount());
+            Log.e(TAG, "The screen must be >= 0 and < " + getChildCount()
+                + " (was " + screen + "); skipping child");
+            return;
         }
 
         clearVacantCache();