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

Commit b4b359a9 authored by Merissa Mitchell's avatar Merissa Mitchell Committed by Vishnu Nair
Browse files

Add condition to useSurfaceBoundsAsTouchRegion.

This CL adds a condition so that useSurfaceBoundsAsTouchRegion is only
set to true when a client did not provide a touchable region already.
Otherwise, the touchable region provided by the client will be replaced
by the surface bounds.

Test: atest SetTouchableRegionTest SurfaceFlinger_test on freeform
windowing emulator and aosp_cf_x86_64_phone target
Bug: 272786078

Change-Id: I2b296bc3f3d632b6ddbf2438b2aae681436ea281
parent b7c94668
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.wm;

import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
import static android.view.WindowManager.INPUT_CONSUMER_PIP;
import static android.view.WindowManager.INPUT_CONSUMER_RECENTS_ANIMATION;
import static android.view.WindowManager.INPUT_CONSUMER_WALLPAPER;
@@ -296,8 +297,11 @@ final class InputMonitor {
                // be applied using the SurfaceControl hierarchy from the Organizer. This means
                // we need to make sure that these changes in crop are reflected in the input
                // windows, and so ensure this flag is set so that the input crop always reflects
                // the surface hierarchy.
                // the surface hierarchy. However, we only want to set this when the client did
                // not already provide a touchable region, so that we don't ignore the one provided.
                if (w.mTouchableInsets != TOUCHABLE_INSETS_REGION) {
                    useSurfaceBoundsAsTouchRegion = true;
                }

                if (w.mAttrs.isModal()) {
                    TaskFragment parent = w.getTaskFragment();