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

Commit 11ba9b07 authored by mpodolian's avatar mpodolian
Browse files

IPC for app icons drag events over the Bubble Bar

Added an IPC call to inform the Bubble Bar in the launcher process
of drag events from the shell.

Bug: 388894910
Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Check that events from the shell process successfully
reach the launcher process.

Change-Id: I1e14dd7ddacda1fa8b9a045a5a92561afd7a8a76
parent eb3ba194
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -294,5 +294,9 @@ class BubbleControllerBubbleBarTest {
        override fun onBubbleStateChange(update: BubbleBarUpdate?) {}

        override fun animateBubbleBarLocation(location: BubbleBarLocation?) {}

        override fun onDragItemOverBubbleBarDragZone(location: BubbleBarLocation) {}

        override fun onItemDraggedOutsideBubbleBarDropZone() {}
    }
}
+11 −0
Original line number Diff line number Diff line
@@ -2613,6 +2613,17 @@ public class BubbleController implements ConfigurationChangeListener,
                    public void animateBubbleBarLocation(BubbleBarLocation location) {
                        mListener.call(l -> l.animateBubbleBarLocation(location));
                    }

                    @Override
                    public void onDragItemOverBubbleBarDragZone(
                            @NonNull BubbleBarLocation location) {
                        mListener.call(l -> l.onDragItemOverBubbleBarDragZone(location));
                    }

                    @Override
                    public void onItemDraggedOutsideBubbleBarDropZone() {
                        mListener.call(IBubblesListener::onItemDraggedOutsideBubbleBarDropZone);
                    }
                };

        IBubblesImpl(BubbleController controller) {
+13 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.window.ScreenCapture.ScreenshotHardwareBuffer;
import android.window.ScreenCapture.SynchronousScreenCaptureListener;

import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.wm.shell.shared.annotations.ExternalThread;
@@ -330,6 +331,18 @@ public interface Bubbles {
         * Does not result in a state change.
         */
        void animateBubbleBarLocation(BubbleBarLocation location);

        /**
         * Called when an application icon is being dragged over the Bubble Bar drop zone.
         * The location of the Bubble Bar is provided as an argument.
         */
        void onDragItemOverBubbleBarDragZone(@NonNull BubbleBarLocation location);

        /**
         * Called when an application icon is being dragged outside the Bubble Bar drop zone.
         * Always called after {@link #onDragItemOverBubbleBarDragZone(BubbleBarLocation)}
         */
        void onItemDraggedOutsideBubbleBarDropZone();
    }

    /** Listener to find out about stack expansion / collapse events. */
+12 −0
Original line number Diff line number Diff line
@@ -33,4 +33,16 @@ oneway interface IBubblesListener {
     * Does not result in a state change.
     */
    void animateBubbleBarLocation(in BubbleBarLocation location);

    /**
     * Called when an application icon is being dragged over the Bubble Bar drop zone.
     * The location of the Bubble Bar is provided as an argument.
     */
    void onDragItemOverBubbleBarDragZone(in BubbleBarLocation location);

    /**
     * Called when an application icon is being dragged outside the Bubble Bar drop zone.
     * Always called after {@link #onDragItemOverBubbleBarDragZone(BubbleBarLocation)}
     */
    void onItemDraggedOutsideBubbleBarDropZone();
}
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ import android.view.View;
import android.view.ViewTreeObserver;
import android.view.WindowManager;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.test.filters.SmallTest;

@@ -2890,6 +2891,12 @@ public class BubblesTest extends SysuiTestCase {
        @Override
        public void animateBubbleBarLocation(BubbleBarLocation location) {
        }

        @Override
        public void onDragItemOverBubbleBarDragZone(@NonNull BubbleBarLocation location) {}

        @Override
        public void onItemDraggedOutsideBubbleBarDropZone() {}
    }

    private static class FakeBubbleProperties implements BubbleProperties {