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

Commit 12f4203c authored by Maryam Dehaini's avatar Maryam Dehaini Committed by Android (Google) Code Review
Browse files

Merge "Release the visual indicator before a new drag event if needed" into main

parents ce15e0d8 1ce5e29f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -214,6 +214,13 @@ public class DesktopModeVisualIndicator {
        return result;
    }

    /**
     * Returns the [DragStartState] of the visual indicator.
     */
    DragStartState getDragStartState() {
        return mDragStartState;
    }

    @VisibleForTesting
    Region calculateFullscreenRegion(DisplayLayout layout, int captionHeight) {
        final Region region = new Region();
+7 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.os.Handler
import android.os.IBinder
import android.os.SystemProperties
import android.os.UserHandle
import android.util.Slog
import android.view.Display.DEFAULT_DISPLAY
import android.view.DragEvent
import android.view.MotionEvent
@@ -2743,6 +2744,12 @@ class DesktopTasksController(
        taskTop: Float,
        dragStartState: DragStartState,
    ): DesktopModeVisualIndicator.IndicatorType {
        // If the visual indicator has the wrong start state, it was never cleared from a previous
        // drag event and needs to be cleared
        if (visualIndicator != null && visualIndicator?.dragStartState != dragStartState) {
            Slog.e(TAG, "Visual indicator from previous motion event was never released")
            releaseVisualIndicator()
        }
        // If the visual indicator does not exist, create it.
        val indicator =
            visualIndicator