diff options
author | Stefan Li <stefan.li@sonyericsson.com> | 2010-11-12 15:53:41 +0100 |
---|---|---|
committer | Johan Redestig <johan.redestig@sonyericsson.com> | 2010-11-12 15:53:41 +0100 |
commit | bc423039676ed9d5255151489e27a054e8ed6899 (patch) | |
tree | 0b479c731c3c3cce857c0bd3ce70e3646394abe9 /src | |
parent | 35e79e32808456a7f5f21126ed2fa7badf8dc0bc (diff) | |
download | android_packages_apps_Trebuchet-bc423039676ed9d5255151489e27a054e8ed6899.tar.gz android_packages_apps_Trebuchet-bc423039676ed9d5255151489e27a054e8ed6899.tar.bz2 android_packages_apps_Trebuchet-bc423039676ed9d5255151489e27a054e8ed6899.zip |
Fix for a Launcher crash.
A forced close will occur in Launcher homescreen if you
are holding the edge portion of the touch screen and slide
close or open the touch screen. This is caused by the
display changing configurations but the touch events are
passed through the framework. So the coordinates will be
wrong which causes a out of bounds exception.
Added a bounds check for the pointer index on ACTION_UP.
Change-Id: I67d7e428f55694969d43948c37b6acda2a5c6eb6
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index c337c3078..cba1a3bd7 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -732,10 +732,12 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag getLocationOnScreen(mTempCell); // Send a tap to the wallpaper if the last down was on empty space final int pointerIndex = ev.findPointerIndex(mActivePointerId); - mWallpaperManager.sendWallpaperCommand(getWindowToken(), - "android.wallpaper.tap", - mTempCell[0] + (int) ev.getX(pointerIndex), - mTempCell[1] + (int) ev.getY(pointerIndex), 0, null); + if (pointerIndex >= 0) { + mWallpaperManager.sendWallpaperCommand(getWindowToken(), + "android.wallpaper.tap", + mTempCell[0] + (int) ev.getX(pointerIndex), + mTempCell[1] + (int) ev.getY(pointerIndex), 0, null); + } } } |