summaryrefslogtreecommitdiff
path: root/core/java/android/view/DragEvent.java
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2011-01-19 16:22:07 -0800
committerChristopher Tate <ctate@google.com>2011-01-19 16:25:22 -0800
commitf01af7551b3cf8853d3a76412c2745a543063434 (patch)
tree2fdd5002c7d442f834b777e54b47ed0a483314d1 /core/java/android/view/DragEvent.java
parent5383d077ed79e9fec95361046fcd7491ee9a0fd4 (diff)
Fail more gracefully when window state changes during drags
In particular, if a new window was created out from under the drag, the drag-move event dispatch logic would wind up blithly assuming that it would find a valid touch-dispatchable window under the finger. When this was untrue, it would NPE, but the NPE was caught and discarded safely by higher-level guard code. With this change, we now avoid the NPE entirely and report the spurious condition as part of the debugging log stream. (Also add the local-state object to DragEvent.toString()'s output.) Change-Id: Idfa5f45d049e48415ee59c8b0ffb5b0ed4098ce3
Diffstat (limited to 'core/java/android/view/DragEvent.java')
-rw-r--r--core/java/android/view/DragEvent.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/view/DragEvent.java b/core/java/android/view/DragEvent.java
index 6634f008ecc0..25b680e65b94 100644
--- a/core/java/android/view/DragEvent.java
+++ b/core/java/android/view/DragEvent.java
@@ -274,7 +274,7 @@ public static final int ACTION_DRAG_EXITED = 6;
public String toString() {
return "DragEvent{" + Integer.toHexString(System.identityHashCode(this))
+ " action=" + mAction + " @ (" + mX + ", " + mY + ") desc=" + mClipDescription
- + " data=" + mClipData + " result=" + mDragResult
+ + " data=" + mClipData + " local=" + mLocalState + " result=" + mDragResult
+ "}";
}