Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4a19326 authored by Phil Weaver's avatar Phil Weaver Committed by Android (Google) Code Review
Browse files

Merge "Add accessibility window title and anchor." into nyc-dev

parents 5af30840 396d5491
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -44260,6 +44260,7 @@ package android.view.accessibility {
  public final class AccessibilityWindowInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.view.accessibility.AccessibilityNodeInfo getAnchor();
    method public void getBoundsInScreen(android.graphics.Rect);
    method public android.view.accessibility.AccessibilityWindowInfo getChild(int);
    method public int getChildCount();
@@ -44267,6 +44268,7 @@ package android.view.accessibility {
    method public int getLayer();
    method public android.view.accessibility.AccessibilityWindowInfo getParent();
    method public android.view.accessibility.AccessibilityNodeInfo getRoot();
    method public java.lang.CharSequence getTitle();
    method public int getType();
    method public boolean isAccessibilityFocused();
    method public boolean isActive();
+2 −0
Original line number Diff line number Diff line
@@ -47003,6 +47003,7 @@ package android.view.accessibility {
  public final class AccessibilityWindowInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.view.accessibility.AccessibilityNodeInfo getAnchor();
    method public void getBoundsInScreen(android.graphics.Rect);
    method public android.view.accessibility.AccessibilityWindowInfo getChild(int);
    method public int getChildCount();
@@ -47010,6 +47011,7 @@ package android.view.accessibility {
    method public int getLayer();
    method public android.view.accessibility.AccessibilityWindowInfo getParent();
    method public android.view.accessibility.AccessibilityNodeInfo getRoot();
    method public java.lang.CharSequence getTitle();
    method public int getType();
    method public boolean isAccessibilityFocused();
    method public boolean isActive();
+2 −0
Original line number Diff line number Diff line
@@ -44334,6 +44334,7 @@ package android.view.accessibility {
  public final class AccessibilityWindowInfo implements android.os.Parcelable {
    method public int describeContents();
    method public android.view.accessibility.AccessibilityNodeInfo getAnchor();
    method public void getBoundsInScreen(android.graphics.Rect);
    method public android.view.accessibility.AccessibilityWindowInfo getChild(int);
    method public int getChildCount();
@@ -44341,6 +44342,7 @@ package android.view.accessibility {
    method public int getLayer();
    method public android.view.accessibility.AccessibilityWindowInfo getParent();
    method public android.view.accessibility.AccessibilityNodeInfo getRoot();
    method public java.lang.CharSequence getTitle();
    method public int getType();
    method public boolean isAccessibilityFocused();
    method public boolean isActive();
+11 −1
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@ public class WindowInfo implements Parcelable {
    public boolean focused;
    public final Rect boundsInScreen = new Rect();
    public List<IBinder> childTokens;
    public CharSequence title;
    public int accessibilityIdOfAnchor = View.NO_ID;

    private WindowInfo() {
        /* do nothing - hide constructor */
@@ -65,6 +67,8 @@ public class WindowInfo implements Parcelable {
        window.parentToken = other.parentToken;
        window.focused = other.focused;
        window.boundsInScreen.set(other.boundsInScreen);
        window.title = other.title;
        window.accessibilityIdOfAnchor = other.accessibilityIdOfAnchor;

        if (other.childTokens != null && !other.childTokens.isEmpty()) {
            if (window.childTokens == null) {
@@ -95,6 +99,8 @@ public class WindowInfo implements Parcelable {
        parcel.writeStrongBinder(parentToken);
        parcel.writeInt(focused ? 1 : 0);
        boundsInScreen.writeToParcel(parcel, flags);
        parcel.writeCharSequence(title);
        parcel.writeInt(accessibilityIdOfAnchor);

        if (childTokens != null && !childTokens.isEmpty()) {
            parcel.writeInt(1);
@@ -108,13 +114,15 @@ public class WindowInfo implements Parcelable {
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("WindowInfo[");
        builder.append("type=").append(type);
        builder.append("title=").append(title);
        builder.append(", type=").append(type);
        builder.append(", layer=").append(layer);
        builder.append(", token=").append(token);
        builder.append(", bounds=").append(boundsInScreen);
        builder.append(", parent=").append(parentToken);
        builder.append(", focused=").append(focused);
        builder.append(", children=").append(childTokens);
        builder.append(", accessibility anchor=").append(accessibilityIdOfAnchor);
        builder.append(']');
        return builder.toString();
    }
@@ -126,6 +134,8 @@ public class WindowInfo implements Parcelable {
        parentToken = parcel.readStrongBinder();
        focused = (parcel.readInt() == 1);
        boundsInScreen.readFromParcel(parcel);
        title = parcel.readCharSequence();
        accessibilityIdOfAnchor = parcel.readInt();

        final boolean hasChildren = (parcel.readInt() == 1);
        if (hasChildren) {
+17 −0
Original line number Diff line number Diff line
@@ -1693,6 +1693,14 @@ public interface WindowManager extends ViewManager {
         */
        public long userActivityTimeout = -1;

        /**
         * For windows with an anchor (e.g. PopupWindow), keeps track of the View that anchors the
         * window.
         *
         * @hide
         */
        public int accessibilityIdOfAnchor = -1;

        public LayoutParams() {
            super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
            type = TYPE_APPLICATION;
@@ -1799,6 +1807,7 @@ public interface WindowManager extends ViewManager {
            out.writeInt(surfaceInsets.bottom);
            out.writeInt(hasManualSurfaceInsets ? 1 : 0);
            out.writeInt(needsMenuKey);
            out.writeInt(accessibilityIdOfAnchor);
        }

        public static final Parcelable.Creator<LayoutParams> CREATOR
@@ -1849,6 +1858,7 @@ public interface WindowManager extends ViewManager {
            surfaceInsets.bottom = in.readInt();
            hasManualSurfaceInsets = in.readInt() != 0;
            needsMenuKey = in.readInt();
            accessibilityIdOfAnchor = in.readInt();
        }

        @SuppressWarnings({"PointlessBitwiseExpression"})
@@ -1888,6 +1898,8 @@ public interface WindowManager extends ViewManager {
        /** {@hide} */
        public static final int PREFERRED_DISPLAY_MODE_ID = 1 << 23;
        /** {@hide} */
        public static final int ACCESSIBILITY_ANCHOR_CHANGED = 1 << 24;
        /** {@hide} */
        public static final int EVERYTHING_CHANGED = 0xffffffff;

        // internal buffer to backup/restore parameters under compatibility mode.
@@ -2048,6 +2060,11 @@ public interface WindowManager extends ViewManager {
                changes |= NEEDS_MENU_KEY_CHANGED;
            }

            if (accessibilityIdOfAnchor != o.accessibilityIdOfAnchor) {
                accessibilityIdOfAnchor = o.accessibilityIdOfAnchor;
                changes |= ACCESSIBILITY_ANCHOR_CHANGED;
            }

            return changes;
        }

Loading