From b2779534c899897efbf3e9f61e337fe5167cbb88 Mon Sep 17 00:00:00 2001 From: Phil Weaver Date: Mon, 18 Dec 2017 17:09:32 -0800 Subject: [PATCH] Always show window divider to accessibility Accessibility typically can only see windows that the user can interact with. This CL carves out the split-screen divider as an exception. The reason is that services can use the presence of the split-screen divider to know if the device is in split-screen mode. But the divider becomes non-touchable if an IME appears in split-screen mode. Services like TalkBack need some way to tell for sure that they are in split-screen mode. Absent a new API for them to query, simply making sure they can see the divider seems like the simplest way to provide this. Bug: 28768841 Test: A11y service CTS Change-Id: I92b89c842689e4c4c69a732490150ca032de46cc --- .../com/android/server/wm/AccessibilityController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index 2bda80d99328c..163b1600e0bd9 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -16,6 +16,7 @@ package com.android.server.wm; +import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static android.view.WindowManager.LayoutParams.TYPE_MAGNIFICATION_OVERLAY; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY; @@ -1068,8 +1069,11 @@ final class AccessibilityController { continue; } - // If the window is not touchable - ignore. - if ((flags & WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE) != 0) { + // Ignore non-touchable windows, except the split-screen divider, which is + // occasionally non-touchable but still useful for identifying split-screen + // mode. + if (((flags & WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE) != 0) + && (windowState.mAttrs.type != TYPE_DOCK_DIVIDER)) { continue; }