Loading services/core/java/com/android/server/wm/DragState.java +9 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.content.ClipDescription; import android.graphics.Point; import android.graphics.Rect; import android.graphics.Region; import android.os.Binder; import android.os.IBinder; import android.os.Message; import android.os.Process; Loading @@ -52,6 +51,7 @@ class DragState { SurfaceControl mSurfaceControl; int mFlags; IBinder mLocalWin; int mPid; int mUid; ClipData mData; ClipDescription mDataDescription; Loading Loading @@ -270,8 +270,15 @@ class DragState { Slog.d(WindowManagerService.TAG, "broadcasting DRAG_ENDED"); } for (WindowState ws : mNotifiedWindows) { float x = 0; float y = 0; if (!mDragResult && (ws.mSession.mPid == mPid)) { // Report unconsumed drop location back to the app that started the drag. x = mCurrentX; y = mCurrentY; } DragEvent evt = DragEvent.obtain(DragEvent.ACTION_DRAG_ENDED, 0, 0, null, null, null, null, mDragResult); x, y, null, null, null, null, mDragResult); try { ws.mClient.dispatchDragEvent(evt); } catch (RemoteException e) { Loading services/core/java/com/android/server/wm/WindowManagerService.java +10 −4 Original line number Diff line number Diff line Loading @@ -701,7 +701,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_DRAG) Slog.d(TAG, "Button no longer pressed; dropping at " + newX + "," + newY); synchronized (mWindowMap) { endDrag = completeDrop(newX, newY); endDrag = completeDropLw(newX, newY); } } else { synchronized (mWindowMap) { Loading @@ -715,7 +715,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_DRAG) Slog.d(TAG, "Got UP on move channel; dropping at " + newX + "," + newY); synchronized (mWindowMap) { endDrag = completeDrop(newX, newY); endDrag = completeDropLw(newX, newY); } } break; Loading Loading @@ -745,11 +745,15 @@ public class WindowManagerService extends IWindowManager.Stub } } private boolean completeDrop(float x, float y) { private boolean completeDropLw(float x, float y) { WindowState dropTargetWin = mDragState.getDropTargetWinLw(x, y); mDragState.mCurrentX = x; mDragState.mCurrentY = y; DropPermissionHolder dropPermissionHolder = null; if ((mDragState.mFlags & View.DRAG_FLAG_GLOBAL) != 0 && if (dropTargetWin != null && (mDragState.mFlags & View.DRAG_FLAG_GLOBAL) != 0 && (mDragState.mFlags & DRAG_FLAGS_URI_ACCESS) != 0) { dropPermissionHolder = new DropPermissionHolder( mDragState.mData, Loading Loading @@ -7104,6 +7108,7 @@ public class WindowManagerService extends IWindowManager.Stub + " asbinder=" + window.asBinder()); } final int callerPid = Binder.getCallingPid(); final int callerUid = Binder.getCallingUid(); final long origId = Binder.clearCallingIdentity(); IBinder token = null; Loading @@ -7129,6 +7134,7 @@ public class WindowManagerService extends IWindowManager.Stub final IBinder winBinder = window.asBinder(); token = new Binder(); mDragState = new DragState(this, token, surface, flags, winBinder); mDragState.mPid = callerPid; mDragState.mUid = callerUid; token = mDragState.mToken = new Binder(); Loading Loading
services/core/java/com/android/server/wm/DragState.java +9 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.content.ClipDescription; import android.graphics.Point; import android.graphics.Rect; import android.graphics.Region; import android.os.Binder; import android.os.IBinder; import android.os.Message; import android.os.Process; Loading @@ -52,6 +51,7 @@ class DragState { SurfaceControl mSurfaceControl; int mFlags; IBinder mLocalWin; int mPid; int mUid; ClipData mData; ClipDescription mDataDescription; Loading Loading @@ -270,8 +270,15 @@ class DragState { Slog.d(WindowManagerService.TAG, "broadcasting DRAG_ENDED"); } for (WindowState ws : mNotifiedWindows) { float x = 0; float y = 0; if (!mDragResult && (ws.mSession.mPid == mPid)) { // Report unconsumed drop location back to the app that started the drag. x = mCurrentX; y = mCurrentY; } DragEvent evt = DragEvent.obtain(DragEvent.ACTION_DRAG_ENDED, 0, 0, null, null, null, null, mDragResult); x, y, null, null, null, null, mDragResult); try { ws.mClient.dispatchDragEvent(evt); } catch (RemoteException e) { Loading
services/core/java/com/android/server/wm/WindowManagerService.java +10 −4 Original line number Diff line number Diff line Loading @@ -701,7 +701,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_DRAG) Slog.d(TAG, "Button no longer pressed; dropping at " + newX + "," + newY); synchronized (mWindowMap) { endDrag = completeDrop(newX, newY); endDrag = completeDropLw(newX, newY); } } else { synchronized (mWindowMap) { Loading @@ -715,7 +715,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_DRAG) Slog.d(TAG, "Got UP on move channel; dropping at " + newX + "," + newY); synchronized (mWindowMap) { endDrag = completeDrop(newX, newY); endDrag = completeDropLw(newX, newY); } } break; Loading Loading @@ -745,11 +745,15 @@ public class WindowManagerService extends IWindowManager.Stub } } private boolean completeDrop(float x, float y) { private boolean completeDropLw(float x, float y) { WindowState dropTargetWin = mDragState.getDropTargetWinLw(x, y); mDragState.mCurrentX = x; mDragState.mCurrentY = y; DropPermissionHolder dropPermissionHolder = null; if ((mDragState.mFlags & View.DRAG_FLAG_GLOBAL) != 0 && if (dropTargetWin != null && (mDragState.mFlags & View.DRAG_FLAG_GLOBAL) != 0 && (mDragState.mFlags & DRAG_FLAGS_URI_ACCESS) != 0) { dropPermissionHolder = new DropPermissionHolder( mDragState.mData, Loading Loading @@ -7104,6 +7108,7 @@ public class WindowManagerService extends IWindowManager.Stub + " asbinder=" + window.asBinder()); } final int callerPid = Binder.getCallingPid(); final int callerUid = Binder.getCallingUid(); final long origId = Binder.clearCallingIdentity(); IBinder token = null; Loading @@ -7129,6 +7134,7 @@ public class WindowManagerService extends IWindowManager.Stub final IBinder winBinder = window.asBinder(); token = new Binder(); mDragState = new DragState(this, token, surface, flags, winBinder); mDragState.mPid = callerPid; mDragState.mUid = callerUid; token = mDragState.mToken = new Binder(); Loading