From bff5c972ac33121b606c8c2235d7be1d13acdb02 Mon Sep 17 00:00:00 2001 From: Nergi Rahardi Date: Tue, 23 Aug 2022 15:39:08 +0900 Subject: [PATCH] Replace region intersection change from quickReject to use Region#op quickReject only checks outer bounds and not the invididual region boundaries, this might give false negative (as the method doc suggests). This caused a bug where window is still added to a11y window list although it has been fully covered by a dialog (still intersects with unaccountedSpace). Bug: 240885392 Test: atest android.autofillservice.cts.servicebehavior.SettingsIntentTest Change-Id: I7fc226e2288c2433e427d1e8ef173a3a21a20edc --- .../java/com/android/server/wm/AccessibilityController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index c04b195587704..4153ea5cb936c 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -1655,7 +1655,8 @@ final class AccessibilityController { } // If the window is completely covered by other windows - ignore. - if (unaccountedSpace.quickReject(regionInScreen)) { + Region intersectionWindow = mTempRegion1; + if (!intersectionWindow.op(unaccountedSpace, regionInScreen, Region.Op.INTERSECT)) { return false; }