From 3032d73338383a5dc953e71585955975bec5a54c Mon Sep 17 00:00:00 2001 From: shawnlin Date: Fri, 5 Nov 2021 14:23:24 +0800 Subject: [PATCH] Align the system gesture swipe threshold when reporting insets he swipe threshold in SystemGesturesPointerEventListener is changed from (status bar size + threshold) to max(status bar size, cutout size + threshold). We should also align this change when reporting gesture insets to app. Bug: 205230536 Test: atest WindowInsetsBehaviorTests Change-Id: I3c51f5447e469c832693b27169894d636b1c250b --- services/core/java/com/android/server/wm/DisplayPolicy.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index 5719f46855835..6e80e786ecda7 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -1077,7 +1077,8 @@ public class DisplayPolicy { if (cutout != null) { final Rect top = cutout.getBoundingRectTop(); if (!top.isEmpty()) { - rect.bottom = rect.bottom + mDisplayCutoutTouchableRegionSize; + rect.bottom = Math.max(rect.bottom, + top.bottom + mDisplayCutoutTouchableRegionSize); } } };