From ac9ad70086ca80fe865c49ace2159f342bd00b9b Mon Sep 17 00:00:00 2001 From: Phil Weaver Date: Wed, 27 Jul 2016 18:03:10 -0700 Subject: [PATCH] Prevent a11y seeing behind tasks w/modal windows. Bug: 30279147 Change-Id: Iee714031894bec0d5b25e0d0feaf918536e5b124 --- .../server/wm/AccessibilityController.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index 8be5dfb3c7fda..d2d5c28788895 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -1071,14 +1071,15 @@ final class AccessibilityController { Region.Op.REVERSE_DIFFERENCE); } - // We figured out what is touchable for the entire screen - done. - if (unaccountedSpace.isEmpty()) { - break; - } - // If a window is modal it prevents other windows from being touched if ((flags & (WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL)) == 0) { + // Account for all space in the task, whether the windows in it are + // touchable or not. The modal window blocks all touches from the task's + // area. + unaccountedSpace.op(windowState.getDisplayFrameLw(), unaccountedSpace, + Region.Op.REVERSE_DIFFERENCE); + if (task != null) { // If the window is associated with a particular task, we can skip the // rest of the windows for that task. @@ -1090,6 +1091,10 @@ final class AccessibilityController { break; } } + // We figured out what is touchable for the entire screen - done. + if (unaccountedSpace.isEmpty()) { + break; + } } // Always report the focused window.