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

Commit 92a31981 authored by Garfield Tan's avatar Garfield Tan
Browse files

Notify all displays when drag and drop starts.

Bug: 163087888
Test: Drag and drop works on phones.
Change-Id: I275e75c3c9af01908a4670b1956e418d1936c783
Merged-In: I275e75c3c9af01908a4670b1956e418d1936c783
parent ba15ed65
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.server.wm;

import static android.Manifest.permission.MANAGE_ACTIVITY_STACKS;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.IInputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_INTERCEPT_GLOBAL_DRAG_AND_DROP;

@@ -118,6 +116,10 @@ class DragState {
     * without having a WM lock.
     */
    volatile boolean mAnimationCompleted = false;
    /**
     * The display on which the drag is happening. If it goes into a different display this will
     * be updated.
     */
    DisplayContent mDisplayContent;

    @Nullable private ValueAnimator mAnimator;
@@ -308,7 +310,9 @@ class DragState {

            // Pause rotations before a drag.
            ProtoLog.d(WM_DEBUG_ORIENTATION, "Pausing rotation during drag");
            mDisplayContent.getDisplayRotation().pause();
            mService.mRoot.forAllDisplays(dc -> {
                dc.getDisplayRotation().pause();
            });
        }

        void tearDown() {
@@ -323,7 +327,9 @@ class DragState {

            // Resume rotations after a drag.
            ProtoLog.d(WM_DEBUG_ORIENTATION, "Resuming rotation after drag");
            mDisplayContent.getDisplayRotation().resume();
            mService.mRoot.forAllDisplays(dc -> {
                dc.getDisplayRotation().resume();
            });
        }
    }

@@ -371,7 +377,7 @@ class DragState {
            Slog.d(TAG_WM, "broadcasting DRAG_STARTED at (" + touchX + ", " + touchY + ")");
        }

        mDisplayContent.forAllWindows(w -> {
        mService.mRoot.forAllWindows(w -> {
            sendDragStartedLocked(w, touchX, touchY, mDataDescription, mData);
        }, false /* traverseTopToBottom */);
    }