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

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

Merge "Allow EmbeddedWindowController to transfer entire gesture" into main

parents e18535d5 1908ec79
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -104,11 +104,16 @@ public abstract class InputManagerInternal {
     * @param fromChannelToken The channel token of a window that has an active touch gesture.
     * @param toChannelToken The channel token of the window that should receive the gesture in
     *   place of the first.
     * @param transferEntireGesture Whether the entire gesture (including subsequent POINTER_DOWN
     *                              events) should be transferred. This should always be set to
     *                              'false' unless you have the permission from the input team to
     *                              set it to true. This behaviour will be removed in future
     *                              versions.
     * @return True if the transfer was successful. False if the specified windows don't exist, or
     *   if the source window is not actively receiving a touch gesture at the time of the request.
     */
    public abstract boolean transferTouchGesture(@NonNull IBinder fromChannelToken,
            @NonNull IBinder toChannelToken);
            @NonNull IBinder toChannelToken, boolean transferEntireGesture);

    /**
     * Gets the current position of the mouse cursor.
+6 −5
Original line number Diff line number Diff line
@@ -1370,7 +1370,7 @@ public class InputManagerService extends IInputManager.Stub
    public boolean startDragAndDrop(@NonNull IBinder fromChannelToken,
            @NonNull IBinder dragAndDropChannelToken) {
        return mNative.transferTouchGesture(fromChannelToken, dragAndDropChannelToken,
                true /* isDragDrop */);
                true /* isDragDrop */, false /* transferEntireGesture */);
    }

    /**
@@ -1394,11 +1394,11 @@ public class InputManagerService extends IInputManager.Stub
     *   if the source window is not actively receiving a touch gesture at the time of the request.
     */
    public boolean transferTouchGesture(@NonNull IBinder fromChannelToken,
            @NonNull IBinder toChannelToken) {
            @NonNull IBinder toChannelToken, boolean transferEntireGesture) {
        Objects.requireNonNull(fromChannelToken);
        Objects.requireNonNull(toChannelToken);
        return mNative.transferTouchGesture(fromChannelToken, toChannelToken,
                false /* isDragDrop */);
                false /* isDragDrop */, transferEntireGesture);
    }

    @Override // Binder call
@@ -3703,8 +3703,9 @@ public class InputManagerService extends IInputManager.Stub

        @Override
        public boolean transferTouchGesture(@NonNull IBinder fromChannelToken,
                @NonNull IBinder toChannelToken) {
            return InputManagerService.this.transferTouchGesture(fromChannelToken, toChannelToken);
                @NonNull IBinder toChannelToken, boolean transferEntireGesture) {
            return InputManagerService.this.transferTouchGesture(
                    fromChannelToken, toChannelToken, transferEntireGesture);
        }

        @Override
+2 −2
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ interface NativeInputManagerService {
    void setMinTimeBetweenUserActivityPokes(long millis);

    boolean transferTouchGesture(IBinder fromChannelToken, IBinder toChannelToken,
            boolean isDragDrop);
            boolean isDragDrop, boolean transferEntireGesture);

    /**
     * Transfer the current touch gesture to the window identified by 'destChannelToken' positioned
@@ -420,7 +420,7 @@ interface NativeInputManagerService {

        @Override
        public native boolean transferTouchGesture(IBinder fromChannelToken, IBinder toChannelToken,
                boolean isDragDrop);
                boolean isDragDrop, boolean transferEntireGesture);

        @Override
        @Deprecated
+2 −1
Original line number Diff line number Diff line
@@ -5800,7 +5800,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    return false;
                }
            }
            return mInputManagerInternal.transferTouchGesture(sourceInputToken, curHostInputToken);
            return mInputManagerInternal.transferTouchGesture(
                    sourceInputToken, curHostInputToken, /* transferEntireGesture */ false);
        }

        @Override
+3 −2
Original line number Diff line number Diff line
@@ -209,7 +209,8 @@ class EmbeddedWindowController {
                    "Transfer request must originate from owner of transferFromToken");
        }
        final boolean didTransfer = mInputManagerService.transferTouchGesture(
                ew.getInputChannelToken(), transferToHostWindowState.mInputChannelToken);
                ew.getInputChannelToken(), transferToHostWindowState.mInputChannelToken,
                /* transferEntireGesture */ true);
        if (didTransfer) {
            ew.mGestureToEmbedded = false;
        }
@@ -228,7 +229,7 @@ class EmbeddedWindowController {
        }
        final boolean didTransfer = mInputManagerService.transferTouchGesture(
                hostWindowState.mInputChannelToken,
                ew.getInputChannelToken());
                ew.getInputChannelToken(), /* transferEntireGesture */ true);
        if (didTransfer) {
            ew.mGestureToEmbedded = true;
            mAtmService.mBackNavigationController.onEmbeddedWindowGestureTransferred(
Loading