summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Bryce Lee <brycelee@google.com> 2015-10-23 21:21:16 +0000
committer android-build-merger <android-build-merger@google.com> 2015-10-23 21:21:16 +0000
commit23915d40118ffa4511edbaf5b968a1e3a34b3903 (patch)
tree3804a46f63c697fc1a9ad594800f1a009bc1bcda
parent62192ccd4e98eaabf1d0d61c73ae9d277df75132 (diff)
parent64677dbaf6177ac35c8e2297dfa034f03fc06dd6 (diff)
Merge branch 'master' of /usr/local/google/game/mirror/googleplex-android_googlesource_com/platform/frameworks/base
-rw-r--r--services/core/java/com/android/server/wm/DragState.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/DragState.java b/services/core/java/com/android/server/wm/DragState.java
index 352168283229..f5e97e5a5d7c 100644
--- a/services/core/java/com/android/server/wm/DragState.java
+++ b/services/core/java/com/android/server/wm/DragState.java
@@ -265,21 +265,27 @@ class DragState {
}
void broadcastDragEndedLw() {
+ final int myPid = Process.myPid();
+
if (WindowManagerService.DEBUG_DRAG) {
Slog.d(WindowManagerService.TAG, "broadcasting DRAG_ENDED");
}
- DragEvent evt = DragEvent.obtain(DragEvent.ACTION_DRAG_ENDED,
- 0, 0, null, null, null, null, mDragResult);
- for (WindowState ws: mNotifiedWindows) {
+ for (WindowState ws : mNotifiedWindows) {
+ DragEvent evt = DragEvent.obtain(DragEvent.ACTION_DRAG_ENDED,
+ 0, 0, null, null, null, null, mDragResult);
try {
ws.mClient.dispatchDragEvent(evt);
} catch (RemoteException e) {
Slog.w(WindowManagerService.TAG, "Unable to drag-end window " + ws);
}
+ // if the current window is in the same process,
+ // the dispatch has already recycled the event
+ if (myPid != ws.mSession.mPid) {
+ evt.recycle();
+ }
}
mNotifiedWindows.clear();
mDragInProgress = false;
- evt.recycle();
}
void endDragLw() {