summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jacky Kao <jackykao@google.com> 2020-07-06 13:53:16 +0800
committer Jacky Kao <jackykao@google.com> 2020-07-07 16:53:27 +0800
commitedbfd229e83280ede42fcd35e9db0aab5f2a88a1 (patch)
treea3890495d0d2f003996fe369a00baf27a0504346
parentc5caed0cd013aad2ec891250222ae8f2a1abea5f (diff)
Fixing an embedded display as a top focused display
There's no window observer for an embedded display. All windows of an embedded display would be sent to the window observer of its parent display. So when the focused window is at an embedded display, the focused display should be its parent display, not the embedded display. Otherwise the active window and top focused window could not be set if the display of the received windows isn't the top focused display. Besides adding more information for debugging when dumping the accessibility info. Bug: 160388022 Test: a11y CTS & unit tests Test: manual testing for bubble expanded with talkback on Change-Id: I1de53e4132fc935e3f188271c8a716fefc28294a
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AccessibilityWindowManager.java7
-rw-r--r--services/core/java/com/android/server/wm/AccessibilityController.java7
2 files changed, 13 insertions, 1 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityWindowManager.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityWindowManager.java
index 468e93a8f683..669bb24e0e77 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityWindowManager.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityWindowManager.java
@@ -747,6 +747,13 @@ public class AccessibilityWindowManager {
* Dumps all {@link AccessibilityWindowInfo}s here.
*/
void dumpLocked(FileDescriptor fd, final PrintWriter pw, String[] args) {
+ pw.append("Global Info [ ");
+ pw.println("Top focused display Id = " + mTopFocusedDisplayId);
+ pw.println(" Active Window Id = " + mActiveWindowId);
+ pw.println(" Top Focused Window Id = " + mTopFocusedWindowId);
+ pw.println(" Accessibility Focused Window Id = " + mAccessibilityFocusedWindowId
+ + " ]");
+ pw.println();
if (mWindows != null) {
final int windowCount = mWindows.size();
for (int j = 0; j < windowCount; j++) {
diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java
index f5d68031b493..ecba3f9c27c4 100644
--- a/services/core/java/com/android/server/wm/AccessibilityController.java
+++ b/services/core/java/com/android/server/wm/AccessibilityController.java
@@ -1357,7 +1357,12 @@ final class AccessibilityController {
addedWindows.clear();
// Gets the top focused display Id and window token for supporting multi-display.
- topFocusedDisplayId = mService.mRoot.getTopFocusedDisplayContent().getDisplayId();
+ // If this top focused display is an embedded one, using its parent display as the
+ // top focused display.
+ final DisplayContent topFocusedDisplayContent =
+ mService.mRoot.getTopFocusedDisplayContent();
+ topFocusedDisplayId = isEmbeddedDisplay(topFocusedDisplayContent) ? mDisplayId
+ : topFocusedDisplayContent.getDisplayId();
topFocusedWindowToken = topFocusedWindowState.mClient.asBinder();
}
mCallback.onWindowsForAccessibilityChanged(forceSend, topFocusedDisplayId,