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
This commit is contained in:
Nergi Rahardi
2022-08-23 15:39:08 +09:00
parent ff0cd826a2
commit bff5c972ac

View File

@@ -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;
}