summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-09-09 18:56:55 -0700
committerYorke Lee <yorkelee@google.com>2014-09-09 18:58:25 -0700
commitd5f58da1c9d39983e0fae90893b2292d259ca3b7 (patch)
treec6aa9d3dc89dff67c1e758c7c1f637ab018e700d
parent03610993bf2adf12a6962c32851095551ffd0043 (diff)
Fix drag events transfering through dialpad
Ignore drag events sent by the dialpad's EditText Bug: 17375188 Change-Id: Ia2f83ee1c1b2f59a54bd226c44f28609d2bc195e
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteListView.java5
-rw-r--r--src/com/android/dialer/list/PhoneFavoriteTileView.java2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteListView.java b/src/com/android/dialer/list/PhoneFavoriteListView.java
index 4ecc1cd90..667681e01 100644
--- a/src/com/android/dialer/list/PhoneFavoriteListView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteListView.java
@@ -149,6 +149,11 @@ public class PhoneFavoriteListView extends GridView implements OnDragDropListene
final int eY = (int) event.getY();
switch (action) {
case DragEvent.ACTION_DRAG_STARTED: {
+ if (PhoneFavoriteTileView.EMPTY_CLIP_DATA != event.getClipData()) {
+ // Ignore any drag events that were not propagated by long pressing
+ // on a {@link PhoneFavoriteTileView}
+ return false;
+ }
if (!mDragDropController.handleDragStarted(eX, eY)) {
return false;
}
diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java
index 208e3507d..2aedd9479 100644
--- a/src/com/android/dialer/list/PhoneFavoriteTileView.java
+++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java
@@ -56,7 +56,7 @@ public abstract class PhoneFavoriteTileView extends ContactTileView {
// Dummy clip data object that is attached to drag shadows so that text views
// don't crash with an NPE if the drag shadow is released in their bounds
- private static final ClipData EMPTY_CLIP_DATA = ClipData.newPlainText("", "");
+ static final ClipData EMPTY_CLIP_DATA = ClipData.newPlainText("", "");
public PhoneFavoriteTileView(Context context, AttributeSet attrs) {
super(context, attrs);