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/WindowManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/java/android/view/WindowManager.java') diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 1c5e87197750..c0a966602b0a 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -63,6 +63,7 @@ import android.os.Parcelable; import android.text.TextUtils; import android.util.Log; import android.util.proto.ProtoOutputStream; +import android.view.accessibility.AccessibilityNodeInfo; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -2344,7 +2345,7 @@ public interface WindowManager extends ViewManager { * * @hide */ - public int accessibilityIdOfAnchor = -1; + public long accessibilityIdOfAnchor = AccessibilityNodeInfo.UNDEFINED_NODE_ID; /** * The window title isn't kept in sync with what is displayed in the title bar, so we @@ -2538,7 +2539,7 @@ public interface WindowManager extends ViewManager { out.writeInt(hasManualSurfaceInsets ? 1 : 0); out.writeInt(preservePreviousSurfaceInsets ? 1 : 0); out.writeInt(needsMenuKey); - out.writeInt(accessibilityIdOfAnchor); + out.writeLong(accessibilityIdOfAnchor); TextUtils.writeToParcel(accessibilityTitle, out, parcelableFlags); out.writeInt(mColorMode); out.writeLong(hideTimeoutMilliseconds); @@ -2594,7 +2595,7 @@ public interface WindowManager extends ViewManager { hasManualSurfaceInsets = in.readInt() != 0; preservePreviousSurfaceInsets = in.readInt() != 0; needsMenuKey = in.readInt(); - accessibilityIdOfAnchor = in.readInt(); + accessibilityIdOfAnchor = in.readLong(); accessibilityTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in); mColorMode = in.readInt(); hideTimeoutMilliseconds = in.readLong(); -- cgit v1.2.3