summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2010-05-24 16:03:53 -0400
committerDaniel Sandler <dsandler@android.com>2010-05-25 10:35:44 -0400
commit291ad12232c98e383d44d76ffe09e97e204c61bc (patch)
tree8f060021968efbfeb9c1f88c22c24f07be8d996f /src
parent3e9454a9ac98eafd0ac92a2762b03a50a28c8eeb (diff)
downloadandroid_packages_apps_Trebuchet-291ad12232c98e383d44d76ffe09e97e204c61bc.tar.gz
android_packages_apps_Trebuchet-291ad12232c98e383d44d76ffe09e97e204c61bc.tar.bz2
android_packages_apps_Trebuchet-291ad12232c98e383d44d76ffe09e97e204c61bc.zip
Ignore requests to add items to non-existant screens.
Should avoid crashes when using Launcher2 alongside third-party launchers that add additional workspaces. Bug: 2709532 Change-Id: I7775b43e582346ba686524e357a2b262e9fc4dcd
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/Workspace.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index f65d956f0..c337c3078 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -36,6 +36,7 @@ import android.os.IBinder;
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 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
*/
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();