summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/DragController.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-10-03 16:31:06 -0700
committerWinson Chung <winsonc@google.com>2011-10-04 11:29:11 -0700
commita182096cb20e0580dfca6661b2e5871c8886c834 (patch)
tree6634c1b30211ae7e165143894fdef4d0d431fa3b /src/com/android/launcher2/DragController.java
parent700eef7bc66687ba626e507d93dcb93f829a5fba (diff)
downloadandroid_packages_apps_Trebuchet-a182096cb20e0580dfca6661b2e5871c8886c834.tar.gz
android_packages_apps_Trebuchet-a182096cb20e0580dfca6661b2e5871c8886c834.tar.bz2
android_packages_apps_Trebuchet-a182096cb20e0580dfca6661b2e5871c8886c834.zip
Fixing crash when you are dragging an app and the packages change under you. (Bug: 5280181)
- Removing unused dimension for app icon content size Change-Id: If3910010577e902937d284296479f9a699516de3
Diffstat (limited to 'src/com/android/launcher2/DragController.java')
-rw-r--r--src/com/android/launcher2/DragController.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
index 107f8ef9d..82aa30fef 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/android/launcher2/DragController.java
@@ -16,6 +16,8 @@
package com.android.launcher2;
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Rect;
@@ -367,6 +369,21 @@ public class DragController {
}
endDrag();
}
+ public void onAppsRemoved(ArrayList<ApplicationInfo> apps, Context context) {
+ // Cancel the current drag if we are removing an app that we are dragging
+ if (mDragObject != null) {
+ Object rawDragInfo = mDragObject.dragInfo;
+ if (rawDragInfo instanceof ShortcutInfo) {
+ ShortcutInfo dragInfo = (ShortcutInfo) rawDragInfo;
+ for (ApplicationInfo info : apps) {
+ if (dragInfo.intent.getComponent().equals(info.intent.getComponent())) {
+ cancelDrag();
+ return;
+ }
+ }
+ }
+ }
+ }
private void endDrag() {
if (mDragging) {