Loading core/java/android/view/IWindowSession.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -187,8 +187,10 @@ interface IWindowSession { /** * Cancel the current drag operation. * skipAnimation is 'true' when it should skip the drag cancel animation which brings the drag * shadow image back to the drag start position. */ void cancelDragAndDrop(IBinder dragToken); void cancelDragAndDrop(IBinder dragToken, boolean skipAnimation); /** * Tell the OS that we've just dragged into a View that is willing to accept the drop Loading core/java/android/view/View.java +1 −1 Original line number Diff line number Diff line Loading @@ -25456,7 +25456,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } if (mAttachInfo.mDragToken != null) { try { mAttachInfo.mSession.cancelDragAndDrop(mAttachInfo.mDragToken); mAttachInfo.mSession.cancelDragAndDrop(mAttachInfo.mDragToken, false); } catch (Exception e) { Log.e(VIEW_LOG_TAG, "Unable to cancel drag", e); } services/core/java/com/android/server/wm/DragDropController.java +2 −2 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ class DragDropController { } } void cancelDragAndDrop(IBinder dragToken) { void cancelDragAndDrop(IBinder dragToken, boolean skipAnimation) { if (DEBUG_DRAG) { Slog.d(TAG_WM, "cancelDragAndDrop"); } Loading @@ -257,7 +257,7 @@ class DragDropController { } mDragState.mDragResult = false; mDragState.cancelDragLocked(); mDragState.cancelDragLocked(skipAnimation); } } finally { mCallback.get().postCancelDragAndDrop(); Loading services/core/java/com/android/server/wm/DragState.java +4 −3 Original line number Diff line number Diff line Loading @@ -475,15 +475,16 @@ class DragState { closeLocked(); } void cancelDragLocked() { void cancelDragLocked(boolean skipAnimation) { if (mAnimator != null) { return; } if (!mDragInProgress) { // This can happen if an app invokes Session#cancelDragAndDrop before if (!mDragInProgress || skipAnimation) { // mDragInProgress is false if an app invokes Session#cancelDragAndDrop before // Session#performDrag. Reset the drag state without playing the cancel animation // because H.DRAG_START_TIMEOUT may be sent to WindowManagerService, which will cause // DragState#reset() while playing the cancel animation. // skipAnimation is true when a caller requests to skip the drag cancel animation. closeLocked(); return; } Loading services/core/java/com/android/server/wm/Session.java +2 −2 Original line number Diff line number Diff line Loading @@ -283,10 +283,10 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { } @Override public void cancelDragAndDrop(IBinder dragToken) { public void cancelDragAndDrop(IBinder dragToken, boolean skipAnimation) { final long ident = Binder.clearCallingIdentity(); try { mDragDropController.cancelDragAndDrop(dragToken); mDragDropController.cancelDragAndDrop(dragToken, skipAnimation); } finally { Binder.restoreCallingIdentity(ident); } Loading Loading
core/java/android/view/IWindowSession.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -187,8 +187,10 @@ interface IWindowSession { /** * Cancel the current drag operation. * skipAnimation is 'true' when it should skip the drag cancel animation which brings the drag * shadow image back to the drag start position. */ void cancelDragAndDrop(IBinder dragToken); void cancelDragAndDrop(IBinder dragToken, boolean skipAnimation); /** * Tell the OS that we've just dragged into a View that is willing to accept the drop Loading
core/java/android/view/View.java +1 −1 Original line number Diff line number Diff line Loading @@ -25456,7 +25456,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } if (mAttachInfo.mDragToken != null) { try { mAttachInfo.mSession.cancelDragAndDrop(mAttachInfo.mDragToken); mAttachInfo.mSession.cancelDragAndDrop(mAttachInfo.mDragToken, false); } catch (Exception e) { Log.e(VIEW_LOG_TAG, "Unable to cancel drag", e); }
services/core/java/com/android/server/wm/DragDropController.java +2 −2 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ class DragDropController { } } void cancelDragAndDrop(IBinder dragToken) { void cancelDragAndDrop(IBinder dragToken, boolean skipAnimation) { if (DEBUG_DRAG) { Slog.d(TAG_WM, "cancelDragAndDrop"); } Loading @@ -257,7 +257,7 @@ class DragDropController { } mDragState.mDragResult = false; mDragState.cancelDragLocked(); mDragState.cancelDragLocked(skipAnimation); } } finally { mCallback.get().postCancelDragAndDrop(); Loading
services/core/java/com/android/server/wm/DragState.java +4 −3 Original line number Diff line number Diff line Loading @@ -475,15 +475,16 @@ class DragState { closeLocked(); } void cancelDragLocked() { void cancelDragLocked(boolean skipAnimation) { if (mAnimator != null) { return; } if (!mDragInProgress) { // This can happen if an app invokes Session#cancelDragAndDrop before if (!mDragInProgress || skipAnimation) { // mDragInProgress is false if an app invokes Session#cancelDragAndDrop before // Session#performDrag. Reset the drag state without playing the cancel animation // because H.DRAG_START_TIMEOUT may be sent to WindowManagerService, which will cause // DragState#reset() while playing the cancel animation. // skipAnimation is true when a caller requests to skip the drag cancel animation. closeLocked(); return; } Loading
services/core/java/com/android/server/wm/Session.java +2 −2 Original line number Diff line number Diff line Loading @@ -283,10 +283,10 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { } @Override public void cancelDragAndDrop(IBinder dragToken) { public void cancelDragAndDrop(IBinder dragToken, boolean skipAnimation) { final long ident = Binder.clearCallingIdentity(); try { mDragDropController.cancelDragAndDrop(dragToken); mDragDropController.cancelDragAndDrop(dragToken, skipAnimation); } finally { Binder.restoreCallingIdentity(ident); } Loading