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

Commit 9e2eb49a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix the window can't receive input still recevied events"

parents 15f7bb3c 678024f0
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -46,7 +46,6 @@ import android.view.InputChannel;
import android.view.InputEventReceiver;
import android.view.InputEventReceiver;
import android.view.InputWindowHandle;
import android.view.InputWindowHandle;
import android.view.SurfaceControl;
import android.view.SurfaceControl;
import android.view.animation.Animation;


import com.android.server.AnimationThread;
import com.android.server.AnimationThread;
import com.android.server.policy.WindowManagerPolicy;
import com.android.server.policy.WindowManagerPolicy;
@@ -70,8 +69,7 @@ final class InputMonitor {


    private boolean mDisableWallpaperTouchEvents;
    private boolean mDisableWallpaperTouchEvents;
    private final Rect mTmpRect = new Rect();
    private final Rect mTmpRect = new Rect();
    private final UpdateInputForAllWindowsConsumer mUpdateInputForAllWindowsConsumer =
    private final UpdateInputForAllWindowsConsumer mUpdateInputForAllWindowsConsumer;
            new UpdateInputForAllWindowsConsumer();


    private final int mDisplayId;
    private final int mDisplayId;
    private final DisplayContent mDisplayContent;
    private final DisplayContent mDisplayContent;
@@ -165,6 +163,7 @@ final class InputMonitor {
        mDisplayId = displayId;
        mDisplayId = displayId;
        mInputTransaction = mDisplayContent.getPendingTransaction();
        mInputTransaction = mDisplayContent.getPendingTransaction();
        mHandler = AnimationThread.getHandler();
        mHandler = AnimationThread.getHandler();
        mUpdateInputForAllWindowsConsumer = new UpdateInputForAllWindowsConsumer();
    }
    }


    void onDisplayRemoved() {
    void onDisplayRemoved() {
@@ -407,6 +406,9 @@ final class InputMonitor {
        boolean inDrag;
        boolean inDrag;
        WallpaperController wallpaperController;
        WallpaperController wallpaperController;


        // An invalid window handle that tells SurfaceFlinger not update the input info.
        final InputWindowHandle mInvalidInputWindow = new InputWindowHandle(null, null, mDisplayId);

        private void updateInputWindows(boolean inDrag) {
        private void updateInputWindows(boolean inDrag) {
            Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "updateInputWindows");
            Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "updateInputWindows");


@@ -445,6 +447,10 @@ final class InputMonitor {
            final InputWindowHandle inputWindowHandle = w.mInputWindowHandle;
            final InputWindowHandle inputWindowHandle = w.mInputWindowHandle;
            if (inputChannel == null || inputWindowHandle == null || w.mRemoved
            if (inputChannel == null || inputWindowHandle == null || w.mRemoved
                    || w.cantReceiveTouchInput()) {
                    || w.cantReceiveTouchInput()) {
                if (w.mWinAnimator.hasSurface()) {
                    mInputTransaction.setInputWindowInfo(
                            w.mWinAnimator.mSurfaceController.mSurfaceControl, mInvalidInputWindow);
                }
                // Skip this window because it cannot possibly receive input.
                // Skip this window because it cannot possibly receive input.
                return;
                return;
            }
            }