Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 776f2845 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use receiving window's input channel token for transferring drag gesture" into main

parents ef63dc49 f01869f8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1260,8 +1260,8 @@ public class InputManagerService extends IInputManager.Stub
     * @return true if drag and drop was successfully started, false otherwise.
     */
    public boolean startDragAndDrop(@NonNull IBinder fromChannelToken,
            @NonNull InputChannel dragAndDropChannel) {
        return mNative.transferTouchGesture(fromChannelToken, dragAndDropChannel.getToken(),
            @NonNull IBinder dragAndDropChannelToken) {
        return mNative.transferTouchGesture(fromChannelToken, dragAndDropChannelToken,
                true /* isDragDrop */);
    }

+0 −4
Original line number Diff line number Diff line
@@ -456,10 +456,6 @@ class DragState {
        }
    }

    InputChannel getInputChannel() {
        return mInputInterceptor == null ? null : mInputInterceptor.mClientChannel;
    }

    InputWindowHandle getInputWindowHandle() {
        return mInputInterceptor == null ? null : mInputInterceptor.mDragWindowHandle;
    }
+1 −1
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ public abstract class WindowManagerInternal {
                InputChannel source) {
            return state.register(display)
                .thenApply(unused ->
                    service.startDragAndDrop(source.getToken(), state.getInputChannel()));
                    service.startDragAndDrop(source.getToken(), state.getInputToken()));
        }

        /**
+2 −2
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ public class DragDropControllerTests extends WindowTestsBase {
        mWindow = createDropTargetWindow("Drag test window", 0);
        doReturn(mWindow).when(mDisplayContent).getTouchableWinAtPointLocked(0, 0);
        when(mWm.mInputManager.startDragAndDrop(any(IBinder.class),
                any(InputChannel.class))).thenReturn(true);
                any(IBinder.class))).thenReturn(true);

        mWm.mWindowMap.put(mWindow.mClient.asBinder(), mWindow);
    }
@@ -707,7 +707,7 @@ public class DragDropControllerTests extends WindowTestsBase {
                    .setFormat(PixelFormat.TRANSLUCENT)
                    .build();

            assertTrue(mWm.mInputManager.startDragAndDrop(new Binder(), new InputChannel()));
            assertTrue(mWm.mInputManager.startDragAndDrop(new Binder(), new Binder()));
            mToken = mTarget.performDrag(TEST_PID, 0, mWindow.mClient,
                    flag, surface, 0, 0, 0, 0, 0, 0, 0, data);
            assertNotNull(mToken);