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

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

Merge "Invoke |onDragPositioningEnd| even if not dragging" into main

parents 71c762e0 d412241d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -166,6 +166,8 @@ public enum DesktopExperienceFlags {
            Flags.FLAG_ENABLE_DYNAMIC_RADIUS_COMPUTATION_BUGFIX),
    ENABLE_EMPTY_DESK_ON_MINIMIZE(Flags::enableEmptyDeskOnMinimize, true,
            Flags.FLAG_ENABLE_EMPTY_DESK_ON_MINIMIZE),
    ENABLE_FIX_LEAKING_VISUAL_INDICATOR(Flags::fixLeakingVisualIndicator, false,
            Flags.FLAG_FIX_LEAKING_VISUAL_INDICATOR),
    ENABLE_FREEFORM_BOX_SHADOWS(Flags::enableFreeformBoxShadows, false,
            Flags.FLAG_ENABLE_FREEFORM_BOX_SHADOWS),
    ENABLE_FREEFORM_DISPLAY_LAUNCH_PARAMS(Flags::enableFreeformDisplayLaunchParams, true,
+10 −0
Original line number Diff line number Diff line
@@ -1537,6 +1537,16 @@ flag {
  }
}

flag {
    name: "fix_leaking_visual_indicator"
    namespace: "lse_desktop_experience"
    description: "Fixes a visual indicator leak that blocked input to non-top apps"
    bug: "418225224"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "force_close_top_transparent_fullscreen_task"
    namespace: "lse_desktop_experience"
+24 −7
Original line number Diff line number Diff line
@@ -1642,18 +1642,29 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                case MotionEvent.ACTION_UP:
                case MotionEvent.ACTION_CANCEL: {
                    final boolean wasDragging = mIsDragging;
                    if (!wasDragging) {
                    if (!DesktopExperienceFlags.ENABLE_FIX_LEAKING_VISUAL_INDICATOR.isTrue()
                            && !wasDragging) {
                        debugLogD("handleFreeformMotionEvent(%s) action=%s "
                                        + "was not dragging, ignore",
                                viewName, MotionEvent.actionToString(e.getAction()));
                        return false;
                    }
                    if (wasDragging) {
                        mDesktopModeUiEventLogger.log(taskInfo,
                                DesktopUiEventEnum.DESKTOP_WINDOW_MOVE_BY_HEADER_DRAG);
                    }
                    if (e.findPointerIndex(mDragPointerId) == -1) {
                        mDragPointerId = e.getPointerId(0);
                    }
                    final int dragPointerIdx = e.findPointerIndex(mDragPointerId);
                    if (DesktopExperienceFlags.ENABLE_FIX_LEAKING_VISUAL_INDICATOR.isTrue()
                            && !dragAllowed) {
                        debugLogD("handleFreeformMotionEvent(%s) action=%s "
                                        + "drag is not allowed, ignore",
                                viewName, MotionEvent.actionToString(e.getAction()));
                        return false;
                    }

                    final Rect newTaskBounds = mDragPositioningCallback.onDragPositioningEnd(
                            e.getDisplayId(),
                            e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx));
@@ -1670,9 +1681,9 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                        if (!mShellDesktopState
                                .isEligibleWindowDropTarget(e.getDisplayId())) {
                            newTaskBounds.set(mOnDragStartInitialBounds);
                            debugLogD("handleFreeformMotionEvent(%s) action=%s "
                                            + "pointer in non-desktop display(%d), "
                                            + "reverted to initial bounds=%s",
                            debugLogD(
                                    "handleFreeformMotionEvent(%s) action=%s pointer in non-desktop"
                                            + " display(%d), reverted to initial bounds=%s",
                                    viewName, MotionEvent.actionToString(e.getAction()),
                                    e.getDisplayId(), newTaskBounds);
                        }
@@ -1702,7 +1713,13 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                                    mTransactionFactory.get());
                        }
                    }

                    if (DesktopExperienceFlags.ENABLE_FIX_LEAKING_VISUAL_INDICATOR.isTrue()
                            && !wasDragging) {
                        debugLogD("handleFreeformMotionEvent(%s) action=%s "
                                        + "was not dragging, ignore",
                                viewName, MotionEvent.actionToString(e.getAction()));
                        return false;
                    }
                    if (touchingButton) {
                        // We need the input event to not be consumed here to end the ripple
                        // effect on the touched button. We will reset drag state in the ensuing