diff options
| author | 2021-09-07 15:29:01 +0800 | |
|---|---|---|
| committer | 2021-09-07 16:19:06 +0800 | |
| commit | cce2d8a9ced78b8a0ce53fffb1d700ece081dca5 (patch) | |
| tree | a962d745919264be740863579e746159fde6148f | |
| parent | 506fa0bebd0e9ee013eaa5b15868a2ea4a379493 (diff) | |
Prevent windows of embedding activities excluded from a11y
Unable to switch focus to the left pane while a11y
tools enabled because only the top-most visible
window in the Task was interested in A11y.
Allowing the top-most visible window of each TaskFragment
to be focused in a11y.
Bug: 198739177
Test: change focus to left pane in talkback mode
Change-Id: Ie7d7d44018ae4ec7cd17b876f352d43c2f3a11a5
| -rw-r--r-- | services/core/java/com/android/server/wm/AccessibilityController.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index cea30ed3e299..e59c82cfb6d0 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -1701,7 +1701,7 @@ final class AccessibilityController { boolean focusedWindowAdded = false; final int visibleWindowCount = visibleWindows.size(); - HashSet<Integer> skipRemainingWindowsForTasks = new HashSet<>(); + ArrayList<TaskFragment> skipRemainingWindowsForTaskFragments = new ArrayList<>(); ArrayList<ShellRoot> shellRoots = getSortedShellRoots(dc.mShellRoots); @@ -1723,10 +1723,10 @@ final class AccessibilityController { computeWindowRegionInScreen(windowState, regionInScreen); if (windowMattersToAccessibility(windowState, regionInScreen, unaccountedSpace, - skipRemainingWindowsForTasks)) { + skipRemainingWindowsForTaskFragments)) { addPopulatedWindowInfo(windowState, regionInScreen, windows, addedWindows); updateUnaccountedSpace(windowState, regionInScreen, unaccountedSpace, - skipRemainingWindowsForTasks); + skipRemainingWindowsForTaskFragments); focusedWindowAdded |= windowState.isFocused(); } else if (isUntouchableNavigationBar(windowState, mTempRegion1)) { // If this widow is navigation bar without touchable region, accounting the @@ -1782,7 +1782,7 @@ final class AccessibilityController { private boolean windowMattersToAccessibility(WindowState windowState, Region regionInScreen, Region unaccountedSpace, - HashSet<Integer> skipRemainingWindowsForTasks) { + ArrayList<TaskFragment> skipRemainingWindowsForTaskFragments) { final RecentsAnimationController controller = mService.getRecentsAnimationController(); if (controller != null && controller.shouldIgnoreForAccessibility(windowState)) { return false; @@ -1793,8 +1793,9 @@ final class AccessibilityController { } // If the window is part of a task that we're finished with - ignore. - final Task task = windowState.getTask(); - if (task != null && skipRemainingWindowsForTasks.contains(task.mTaskId)) { + final TaskFragment taskFragment = windowState.getTaskFragment(); + if (taskFragment != null + && skipRemainingWindowsForTaskFragments.contains(taskFragment)) { return false; } @@ -1820,7 +1821,8 @@ final class AccessibilityController { } private void updateUnaccountedSpace(WindowState windowState, Region regionInScreen, - Region unaccountedSpace, HashSet<Integer> skipRemainingWindowsForTasks) { + Region unaccountedSpace, + ArrayList<TaskFragment> skipRemainingWindowsForTaskFragments) { if (windowState.mAttrs.type != WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY) { @@ -1850,11 +1852,11 @@ final class AccessibilityController { Region.Op.REVERSE_DIFFERENCE); } - final Task task = windowState.getTask(); - if (task != null) { + final TaskFragment taskFragment = windowState.getTaskFragment(); + if (taskFragment != null) { // If the window is associated with a particular task, we can skip the // rest of the windows for that task. - skipRemainingWindowsForTasks.add(task.mTaskId); + skipRemainingWindowsForTaskFragments.add(taskFragment); } else if (!windowState.hasTapExcludeRegion()) { // If the window is not associated with a particular task, then it is // globally modal. In this case we can skip all remaining windows when |