Merge "Don't let non-touchable windows retain a11y focus" into pi-dev
am: 8bbc30955a
Change-Id: Ia611497edd3721ea3ff88cf93087c45894b18656
This commit is contained in:
@@ -3129,6 +3129,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
|
|||||||
boolean activeWindowGone = true;
|
boolean activeWindowGone = true;
|
||||||
|
|
||||||
final int windowCount = windows.size();
|
final int windowCount = windows.size();
|
||||||
|
|
||||||
|
// We'll clear accessibility focus if the window with focus is no longer visible to
|
||||||
|
// accessibility services
|
||||||
|
boolean shouldClearAccessibilityFocus =
|
||||||
|
mAccessibilityFocusedWindowId != INVALID_WINDOW_ID;
|
||||||
if (windowCount > 0) {
|
if (windowCount > 0) {
|
||||||
for (int i = 0; i < windowCount; i++) {
|
for (int i = 0; i < windowCount; i++) {
|
||||||
WindowInfo windowInfo = windows.get(i);
|
WindowInfo windowInfo = windows.get(i);
|
||||||
@@ -3166,6 +3171,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
|
|||||||
}
|
}
|
||||||
if (window.getId() == mAccessibilityFocusedWindowId) {
|
if (window.getId() == mAccessibilityFocusedWindowId) {
|
||||||
window.setAccessibilityFocused(true);
|
window.setAccessibilityFocused(true);
|
||||||
|
shouldClearAccessibilityFocus = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3176,6 +3182,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
|
|||||||
for (int i = oldWindowCount - 1; i >= 0; i--) {
|
for (int i = oldWindowCount - 1; i >= 0; i--) {
|
||||||
oldWindowList.remove(i).recycle();
|
oldWindowList.remove(i).recycle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldClearAccessibilityFocus) {
|
||||||
|
clearAccessibilityFocus(mAccessibilityFocusedWindowId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendEventsForChangedWindowsLocked(List<AccessibilityWindowInfo> oldWindows,
|
private void sendEventsForChangedWindowsLocked(List<AccessibilityWindowInfo> oldWindows,
|
||||||
|
|||||||
Reference in New Issue
Block a user