From 8583ae8a6af11bedbb00a4eb9efd2565da2fecbb Mon Sep 17 00:00:00 2001 From: Phil Weaver Date: Tue, 13 Feb 2018 11:01:24 -0800 Subject: Add a11y titles for a few sysui windows Adding for status bar, nav bar, and global actions dialog. Also removing some extra code from global actions dialog that populated window state changes. Apps in general don't need this extra information, so we don't need to maintain it in SysUi either. In verifying the fix, I noticed that all windows were considered anchored because of a mismatch between long and int. Fixing that too. Bug: 73131182 Test: With the testback a11y service, verified that these titles do indeed appear in the window information provided to accessibility services. Also noted that windows are no longer reporting themselves as anchored. Change-Id: Ie09fbb88250b3c9663d6c28001e0ce9f70c67954 --- core/java/android/view/WindowInfo.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/java/android/view/WindowInfo.java') diff --git a/core/java/android/view/WindowInfo.java b/core/java/android/view/WindowInfo.java index bb9e391ddcb4..7bae28a4e817 100644 --- a/core/java/android/view/WindowInfo.java +++ b/core/java/android/view/WindowInfo.java @@ -21,6 +21,7 @@ import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; import android.util.Pools; +import android.view.accessibility.AccessibilityNodeInfo; import java.util.ArrayList; import java.util.List; @@ -46,7 +47,7 @@ public class WindowInfo implements Parcelable { public final Rect boundsInScreen = new Rect(); public List childTokens; public CharSequence title; - public int accessibilityIdOfAnchor = View.NO_ID; + public long accessibilityIdOfAnchor = AccessibilityNodeInfo.UNDEFINED_NODE_ID; public boolean inPictureInPicture; private WindowInfo() { @@ -105,7 +106,7 @@ public class WindowInfo implements Parcelable { parcel.writeInt(focused ? 1 : 0); boundsInScreen.writeToParcel(parcel, flags); parcel.writeCharSequence(title); - parcel.writeInt(accessibilityIdOfAnchor); + parcel.writeLong(accessibilityIdOfAnchor); parcel.writeInt(inPictureInPicture ? 1 : 0); if (childTokens != null && !childTokens.isEmpty()) { @@ -142,7 +143,7 @@ public class WindowInfo implements Parcelable { focused = (parcel.readInt() == 1); boundsInScreen.readFromParcel(parcel); title = parcel.readCharSequence(); - accessibilityIdOfAnchor = parcel.readInt(); + accessibilityIdOfAnchor = parcel.readLong(); inPictureInPicture = (parcel.readInt() == 1); final boolean hasChildren = (parcel.readInt() == 1); -- cgit v1.2.3