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

Commit 5c59e049 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo
Browse files

Expose drag recipient change to IDragDropCallback

During drag & drop, dragRecipientEntered / dragRecipientExited notifies
the framework that it has entered / exited a View which can handle drop
events. Currently, they are not used, but OEMs e.g. ARC may want to
implement additional logic based on dragRecipientEntered/Exited notified
by apps.

Test: m
Bug: 194638945
Change-Id: Iace73c454aff3029bd181506740fa4ff9431f355
parent c689abb7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -291,12 +291,14 @@ class DragDropController {
        if (DEBUG_DRAG) {
            Slog.d(TAG_WM, "Drag into new candidate view @ " + window.asBinder());
        }
        mCallback.get().dragRecipientEntered(window);
    }

    void dragRecipientExited(IWindow window) {
        if (DEBUG_DRAG) {
            Slog.d(TAG_WM, "Drag from old candidate view @ " + window.asBinder());
        }
        mCallback.get().dragRecipientExited(window);
    }

    /**
+10 −0
Original line number Diff line number Diff line
@@ -288,6 +288,16 @@ public abstract class WindowManagerInternal {
         * Called when drag operation was cancelled.
         */
        default void postCancelDragAndDrop() {}

        /**
         * Called when it has entered a View that is willing to accept the drop.
         */
        default void dragRecipientEntered(IWindow window) {}

        /**
         * Called when it has exited a View that is willing to accept the drop.
         */
        default void dragRecipientExited(IWindow window) {}
    }

    /**