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

Commit 1cfad3b6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Ultrasound: Fix touchable region for windows on off-screen display"

parents df6c2d2d baa0d179
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.wm;
import com.android.server.input.InputManagerService;
import com.android.server.input.InputApplicationHandle;
import com.android.server.input.InputWindowHandle;
import com.android.server.display.DigitalPenOffScreenDisplayAdapter;

import android.app.ActivityManagerNative;
import android.graphics.Rect;
@@ -177,7 +178,21 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
        if (modal && child.mAppToken != null) {
            // Limit the outer touch to the activity stack region.
            flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;

            DisplayContent offScreenDisplayContent =
                mService.getDigitalPenOffScreenDisplayContentLocked();

            if ((!DigitalPenOffScreenDisplayAdapter.isDigitalPenDisabled())
                && (null != offScreenDisplayContent)
                && (child.getDisplayId() == offScreenDisplayContent.getDisplayId())) {
                // If the window is located on the digital pen extended off-screen
                // display, make the touchable region the entire frame. Using
                // getStackBounds() will yield the bounds of the activity which
                // is on the main display - not what we want.
                mTmpRect = child.getFrameLw();
            } else {
                child.getStackBounds(mTmpRect);
            }
            inputWindowHandle.touchableRegion.set(mTmpRect);
        } else {
            // Not modal or full screen modal
+1 −1
Original line number Diff line number Diff line
@@ -7088,7 +7088,7 @@ public class WindowManagerService extends IWindowManager.Stub
        return sw;
    }

    private DisplayContent getDigitalPenOffScreenDisplayContentLocked() {
    public DisplayContent getDigitalPenOffScreenDisplayContentLocked() {
        Display[] displays = mDisplayManager.getDisplays();
        int displayId = -1;
        for (Display display : displays) {