Loading services/core/java/com/android/server/input/InputManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1259,9 +1259,9 @@ public class InputManagerService extends IInputManager.Stub * @param dragAndDropChannel The input channel associated with the system drag window. * @return true if drag and drop was successfully started, false otherwise. */ public boolean startDragAndDrop(@NonNull InputChannel fromChannel, public boolean startDragAndDrop(@NonNull IBinder fromChannelToken, @NonNull InputChannel dragAndDropChannel) { return mNative.transferTouchGesture(fromChannel.getToken(), dragAndDropChannel.getToken(), return mNative.transferTouchGesture(fromChannelToken, dragAndDropChannel.getToken(), true /* isDragDrop */); } Loading services/core/java/com/android/server/wm/WindowManagerInternal.java +1 −1 Original line number Diff line number Diff line Loading @@ -380,7 +380,7 @@ public abstract class WindowManagerInternal { InputChannel source) { return state.register(display) .thenApply(unused -> service.startDragAndDrop(source, state.getInputChannel())); service.startDragAndDrop(source.getToken(), state.getInputChannel())); } /** Loading services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java +4 −5 Original line number Diff line number Diff line Loading @@ -152,8 +152,8 @@ public class DragDropControllerTests extends WindowTestsBase { // Use a new TestIWindow so we don't collect events for other windows final WindowState window = createWindow( null, TYPE_BASE_APPLICATION, activity, name, ownerId, false, new TestIWindow()); window.mInputChannel = new InputChannel(); window.mInputChannelToken = window.mInputChannel.getToken(); InputChannel channel = new InputChannel(); window.openInputChannel(channel); window.mHasSurface = true; mWm.mWindowMap.put(window.mClient.asBinder(), window); mWm.mInputToWindowMap.put(window.mInputChannelToken, window); Loading @@ -178,7 +178,7 @@ public class DragDropControllerTests extends WindowTestsBase { TEST_PID, TEST_UID); mWindow = createDropTargetWindow("Drag test window", 0); doReturn(mWindow).when(mDisplayContent).getTouchableWinAtPointLocked(0, 0); when(mWm.mInputManager.startDragAndDrop(any(InputChannel.class), when(mWm.mInputManager.startDragAndDrop(any(IBinder.class), any(InputChannel.class))).thenReturn(true); mWm.mWindowMap.put(mWindow.mClient.asBinder(), mWindow); Loading Loading @@ -707,8 +707,7 @@ public class DragDropControllerTests extends WindowTestsBase { .setFormat(PixelFormat.TRANSLUCENT) .build(); assertTrue(mWm.mInputManager.startDragAndDrop(new InputChannel(), new InputChannel())); assertTrue(mWm.mInputManager.startDragAndDrop(new Binder(), new InputChannel())); mToken = mTarget.performDrag(TEST_PID, 0, mWindow.mClient, flag, surface, 0, 0, 0, 0, 0, 0, 0, data); assertNotNull(mToken); Loading Loading
services/core/java/com/android/server/input/InputManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1259,9 +1259,9 @@ public class InputManagerService extends IInputManager.Stub * @param dragAndDropChannel The input channel associated with the system drag window. * @return true if drag and drop was successfully started, false otherwise. */ public boolean startDragAndDrop(@NonNull InputChannel fromChannel, public boolean startDragAndDrop(@NonNull IBinder fromChannelToken, @NonNull InputChannel dragAndDropChannel) { return mNative.transferTouchGesture(fromChannel.getToken(), dragAndDropChannel.getToken(), return mNative.transferTouchGesture(fromChannelToken, dragAndDropChannel.getToken(), true /* isDragDrop */); } Loading
services/core/java/com/android/server/wm/WindowManagerInternal.java +1 −1 Original line number Diff line number Diff line Loading @@ -380,7 +380,7 @@ public abstract class WindowManagerInternal { InputChannel source) { return state.register(display) .thenApply(unused -> service.startDragAndDrop(source, state.getInputChannel())); service.startDragAndDrop(source.getToken(), state.getInputChannel())); } /** Loading
services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java +4 −5 Original line number Diff line number Diff line Loading @@ -152,8 +152,8 @@ public class DragDropControllerTests extends WindowTestsBase { // Use a new TestIWindow so we don't collect events for other windows final WindowState window = createWindow( null, TYPE_BASE_APPLICATION, activity, name, ownerId, false, new TestIWindow()); window.mInputChannel = new InputChannel(); window.mInputChannelToken = window.mInputChannel.getToken(); InputChannel channel = new InputChannel(); window.openInputChannel(channel); window.mHasSurface = true; mWm.mWindowMap.put(window.mClient.asBinder(), window); mWm.mInputToWindowMap.put(window.mInputChannelToken, window); Loading @@ -178,7 +178,7 @@ public class DragDropControllerTests extends WindowTestsBase { TEST_PID, TEST_UID); mWindow = createDropTargetWindow("Drag test window", 0); doReturn(mWindow).when(mDisplayContent).getTouchableWinAtPointLocked(0, 0); when(mWm.mInputManager.startDragAndDrop(any(InputChannel.class), when(mWm.mInputManager.startDragAndDrop(any(IBinder.class), any(InputChannel.class))).thenReturn(true); mWm.mWindowMap.put(mWindow.mClient.asBinder(), mWindow); Loading Loading @@ -707,8 +707,7 @@ public class DragDropControllerTests extends WindowTestsBase { .setFormat(PixelFormat.TRANSLUCENT) .build(); assertTrue(mWm.mInputManager.startDragAndDrop(new InputChannel(), new InputChannel())); assertTrue(mWm.mInputManager.startDragAndDrop(new Binder(), new InputChannel())); mToken = mTarget.performDrag(TEST_PID, 0, mWindow.mClient, flag, surface, 0, 0, 0, 0, 0, 0, 0, data); assertNotNull(mToken); Loading