summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/DragEvent.java
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2011-01-20 13:46:41 -0800
committerChristopher Tate <ctate@google.com>2011-01-20 13:53:17 -0800
commit7fb8b565f9cd2ec6a63ff4d8a89f98f68a1a138c (patch)
tree06fe7e356fbc2a103fe02828e35f783343173dbf /core/java/android/view/DragEvent.java
parenta7cb63a15319c5a4b59f67e66c93b5b9616475d4 (diff)
downloadframeworks_base-7fb8b565f9cd2ec6a63ff4d8a89f98f68a1a138c.zip
frameworks_base-7fb8b565f9cd2ec6a63ff4d8a89f98f68a1a138c.tar.gz
frameworks_base-7fb8b565f9cd2ec6a63ff4d8a89f98f68a1a138c.tar.bz2
Include the local state obj in ACTION_DRAG_STARTED events
Fixes bug 3362502 The underlying cause was that the DragEvent.obtain() variant which clones an existing event was failing to copy the local state field. This change also moves the logic for inserting the local state object into DragEvents about to be dispatched from the Binder incall thread into the main-thread code sequence. This is to eliminate any potential SMP memory coherency issues around drag start vs incoming events needing to refer to the local state object. Change-Id: I368e8936dbf8a00b7d5cc19c2ef0101bd75b6b2d
Diffstat (limited to 'core/java/android/view/DragEvent.java')
-rw-r--r--core/java/android/view/DragEvent.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/view/DragEvent.java b/core/java/android/view/DragEvent.java
index 25b680e..4d83891 100644
--- a/core/java/android/view/DragEvent.java
+++ b/core/java/android/view/DragEvent.java
@@ -130,12 +130,13 @@ public static final int ACTION_DRAG_EXITED = 6;
}
private void init(int action, float x, float y, ClipDescription description, ClipData data,
- boolean result) {
+ Object localState, boolean result) {
mAction = action;
mX = x;
mY = y;
mClipDescription = description;
mClipData = data;
+ mLocalState = localState;
mDragResult = result;
}
@@ -150,7 +151,7 @@ public static final int ACTION_DRAG_EXITED = 6;
synchronized (gRecyclerLock) {
if (gRecyclerTop == null) {
ev = new DragEvent();
- ev.init(action, x, y, description, data, result);
+ ev.init(action, x, y, description, data, localState, result);
return ev;
}
ev = gRecyclerTop;
@@ -161,7 +162,7 @@ public static final int ACTION_DRAG_EXITED = 6;
ev.mRecycled = false;
ev.mNext = null;
- ev.init(action, x, y, description, data, result);
+ ev.init(action, x, y, description, data, localState, result);
return ev;
}