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

Commit 56612128 authored by Jackal Guo's avatar Jackal Guo Committed by Dieter Hsu
Browse files

Publicize constructors of accessibility related infomational classes

This is the first step of eliminating SynchronizedPool for a11y ojbects.
The patch doesn't stop recycling, but allows service developers to
choose whether or not to.

Since recycling a11y node info is stopped in the cache, but the nodes
are still holding pooled collection/item/range info objects. Here it
goes away with public constructors except those refreshed one.

Bug: 117999988
Test: m update-api; m checkapi; m ds-docs
Test: atest --test-mapping $ANDROID_BUILD_TOP/frameworks/base/core/java/android/view/accessibility:postsubmit

Change-Id: I12304662f216b5e443785939f231893abdfa07d5
parent 4f270006
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -52498,6 +52498,9 @@ package android.view {
package android.view.accessibility {
  public final class AccessibilityEvent extends android.view.accessibility.AccessibilityRecord implements android.os.Parcelable {
    ctor public AccessibilityEvent();
    ctor public AccessibilityEvent(int);
    ctor public AccessibilityEvent(@NonNull android.view.accessibility.AccessibilityEvent);
    method public void appendRecord(android.view.accessibility.AccessibilityRecord);
    method public int describeContents();
    method public static String eventTypeToString(int);
@@ -52608,6 +52611,10 @@ package android.view.accessibility {
  }
  public class AccessibilityNodeInfo implements android.os.Parcelable {
    ctor public AccessibilityNodeInfo();
    ctor public AccessibilityNodeInfo(@NonNull android.view.View);
    ctor public AccessibilityNodeInfo(@NonNull android.view.View, int);
    ctor public AccessibilityNodeInfo(@NonNull android.view.accessibility.AccessibilityNodeInfo);
    method public void addAction(android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction);
    method @Deprecated public void addAction(int);
    method public void addChild(android.view.View);
@@ -52841,6 +52848,8 @@ package android.view.accessibility {
  }
  public static final class AccessibilityNodeInfo.CollectionInfo {
    ctor public AccessibilityNodeInfo.CollectionInfo(int, int, boolean);
    ctor public AccessibilityNodeInfo.CollectionInfo(int, int, boolean, int);
    method public int getColumnCount();
    method public int getRowCount();
    method public int getSelectionMode();
@@ -52853,6 +52862,8 @@ package android.view.accessibility {
  }
  public static final class AccessibilityNodeInfo.CollectionItemInfo {
    ctor public AccessibilityNodeInfo.CollectionItemInfo(int, int, int, int, boolean);
    ctor public AccessibilityNodeInfo.CollectionItemInfo(int, int, int, int, boolean, boolean);
    method public int getColumnIndex();
    method public int getColumnSpan();
    method public int getRowIndex();
@@ -52864,6 +52875,7 @@ package android.view.accessibility {
  }
  public static final class AccessibilityNodeInfo.RangeInfo {
    ctor public AccessibilityNodeInfo.RangeInfo(int, float, float, float);
    method public float getCurrent();
    method public float getMax();
    method public float getMin();
@@ -52895,6 +52907,8 @@ package android.view.accessibility {
  }
  public class AccessibilityRecord {
    ctor public AccessibilityRecord();
    ctor public AccessibilityRecord(@NonNull android.view.accessibility.AccessibilityRecord);
    method public int getAddedCount();
    method public CharSequence getBeforeText();
    method public CharSequence getClassName();
@@ -52955,6 +52969,8 @@ package android.view.accessibility {
  }
  public final class AccessibilityWindowInfo implements android.os.Parcelable {
    ctor public AccessibilityWindowInfo();
    ctor public AccessibilityWindowInfo(@NonNull android.view.accessibility.AccessibilityWindowInfo);
    method public int describeContents();
    method public android.view.accessibility.AccessibilityNodeInfo getAnchor();
    method public void getBoundsInScreen(android.graphics.Rect);
+46 −14
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.view.accessibility;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.Parcel;
@@ -796,10 +797,32 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par

    private ArrayList<AccessibilityRecord> mRecords;

    /*
     * Hide constructor from clients.
    /**
     * Creates a new {@link AccessibilityEvent}.
     */
    public AccessibilityEvent() {
        if (DEBUG_ORIGIN) originStackTrace = Thread.currentThread().getStackTrace();
    }


    /**
     * Creates a new {@link AccessibilityEvent} with the given <code>eventType</code>.
     *
     * @param eventType The event type.
     */
    private AccessibilityEvent() {
    public AccessibilityEvent(int eventType) {
        mEventType = eventType;
        if (DEBUG_ORIGIN) originStackTrace = Thread.currentThread().getStackTrace();
    }

    /**
     * Copy constructor. Creates a new {@link AccessibilityEvent}, and this instance is initialized
     * from the given <code>event</code>.
     *
     * @param event The other event.
     */
    public AccessibilityEvent(@NonNull AccessibilityEvent event) {
        init(event);
    }

    /**
@@ -816,6 +839,15 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
        mWindowChangeTypes = event.mWindowChangeTypes;
        mEventTime = event.mEventTime;
        mPackageName = event.mPackageName;
        if (event.mRecords != null) {
            final int recordCount = event.mRecords.size();
            mRecords = new ArrayList<>(recordCount);
            for (int i = 0; i < recordCount; i++) {
                final AccessibilityRecord record = event.mRecords.get(i);
                final AccessibilityRecord recordClone = new AccessibilityRecord(record);
                mRecords.add(recordClone);
            }
        }
        if (DEBUG_ORIGIN) originStackTrace = event.originStackTrace;
    }

@@ -1109,6 +1141,9 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
     * Returns a cached instance if such is available or a new one is
     * instantiated with its type property set.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityEvent(int)} instead.
     *
     * @param eventType The event type.
     * @return An instance.
     */
@@ -1123,23 +1158,15 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
     * created. The returned instance is initialized from the given
     * <code>event</code>.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityEvent(AccessibilityEvent)} instead.
     *
     * @param event The other event.
     * @return An instance.
     */
    public static AccessibilityEvent obtain(AccessibilityEvent event) {
        AccessibilityEvent eventClone = AccessibilityEvent.obtain();
        eventClone.init(event);

        if (event.mRecords != null) {
            final int recordCount = event.mRecords.size();
            eventClone.mRecords = new ArrayList<AccessibilityRecord>(recordCount);
            for (int i = 0; i < recordCount; i++) {
                final AccessibilityRecord record = event.mRecords.get(i);
                final AccessibilityRecord recordClone = AccessibilityRecord.obtain(record);
                eventClone.mRecords.add(recordClone);
            }
        }

        return eventClone;
    }

@@ -1147,6 +1174,9 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
     * Returns a cached instance if such is available or a new one is
     * instantiated.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityEvent()} instead.
     *
     * @return An instance.
     */
    public static AccessibilityEvent obtain() {
@@ -1162,6 +1192,8 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
     *   <b>Note: You must not touch the object after calling this function.</b>
     * </p>
     *
     * <p>In most situations object pooling is not beneficial, and recycling is not necessary.
     *
     * @throws IllegalStateException If the event is already recycled.
     */
    @Override
+145 −16
Original line number Diff line number Diff line
@@ -775,15 +775,38 @@ public class AccessibilityNodeInfo implements Parcelable {
    private TouchDelegateInfo mTouchDelegateInfo;

    /**
     * Hide constructor from clients.
     * Creates a new {@link AccessibilityNodeInfo}.
     */
    private AccessibilityNodeInfo() {
        /* do nothing */
    public AccessibilityNodeInfo() {
    }

    /** @hide */
    AccessibilityNodeInfo(AccessibilityNodeInfo info) {
        init(info);
    /**
     * Creates a new {@link AccessibilityNodeInfo} with the given <code>source</code>.
     *
     * @param source The source view.
     */
    public AccessibilityNodeInfo(@NonNull View source) {
        setSource(source);
    }

    /**
     * Creates a new {@link AccessibilityNodeInfo} with the given <code>source</code>.
     *
     * @param root The root of the virtual subtree.
     * @param virtualDescendantId The id of the virtual descendant.
     */
    public AccessibilityNodeInfo(@NonNull View root, int virtualDescendantId) {
        setSource(root, virtualDescendantId);
    }

    /**
     * Copy constructor. Creates a new {@link AccessibilityNodeInfo}, and this new instance is
     * initialized from the given <code>info</code>.
     *
     * @param info The other info.
     */
    public AccessibilityNodeInfo(@NonNull AccessibilityNodeInfo info) {
        init(info, false /* usePoolingInfo */);
    }

    /**
@@ -911,7 +934,7 @@ public class AccessibilityNodeInfo implements Parcelable {
        // when it is obtained. Enforce sealing again before we init to fail when a node has been
        // recycled during a refresh to catch such errors earlier.
        enforceSealed();
        init(refreshedInfo);
        init(refreshedInfo, true /* usePoolingInfo */);
        refreshedInfo.recycle();
        return true;
    }
@@ -3299,6 +3322,9 @@ public class AccessibilityNodeInfo implements Parcelable {
     * Returns a cached instance if such is available otherwise a new one
     * and sets the source.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityNodeInfo(View)} instead.
     *
     * @param source The source view.
     * @return An instance.
     *
@@ -3314,6 +3340,9 @@ public class AccessibilityNodeInfo implements Parcelable {
     * Returns a cached instance if such is available otherwise a new one
     * and sets the source.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityNodeInfo(View, int)} instead.
     *
     * @param root The root of the virtual subtree.
     * @param virtualDescendantId The id of the virtual descendant.
     * @return An instance.
@@ -3329,6 +3358,9 @@ public class AccessibilityNodeInfo implements Parcelable {
    /**
     * Returns a cached instance if such is available otherwise a new one.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityNodeInfo()} instead.
     *
     * @return An instance.
     */
    public static AccessibilityNodeInfo obtain() {
@@ -3344,12 +3376,15 @@ public class AccessibilityNodeInfo implements Parcelable {
     * create. The returned instance is initialized from the given
     * <code>info</code>.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityNodeInfo(AccessibilityNodeInfo)} instead.
     *
     * @param info The other info.
     * @return An instance.
     */
    public static AccessibilityNodeInfo obtain(AccessibilityNodeInfo info) {
        AccessibilityNodeInfo infoClone = AccessibilityNodeInfo.obtain();
        infoClone.init(info);
        infoClone.init(info, true /* usePoolingInfo */);
        return infoClone;
    }

@@ -3358,6 +3393,8 @@ public class AccessibilityNodeInfo implements Parcelable {
     * <p>
     * <strong>Note:</strong> You must not touch the object after calling this function.
     *
     * <p>In most situations object pooling is not beneficial, and recycling is not necessary.
     *
     * @throws IllegalStateException If the info is already recycled.
     */
    public void recycle() {
@@ -3647,8 +3684,9 @@ public class AccessibilityNodeInfo implements Parcelable {
     * Initializes this instance from another one.
     *
     * @param other The other instance.
     * @param usePoolingInfos whether using pooled object internally or not
     */
    private void init(AccessibilityNodeInfo other) {
    private void init(AccessibilityNodeInfo other, boolean usePoolingInfos) {
        mSealed = other.mSealed;
        mSourceNodeId = other.mSourceNodeId;
        mParentNodeId = other.mParentNodeId;
@@ -3707,6 +3745,18 @@ public class AccessibilityNodeInfo implements Parcelable {

        mExtras = other.mExtras != null ? new Bundle(other.mExtras) : null;

        if (usePoolingInfos) {
            initPoolingInfos(other);
        } else {
            initCopyInfos(other);
        }

        final TouchDelegateInfo otherInfo = other.mTouchDelegateInfo;
        mTouchDelegateInfo = (otherInfo != null)
                ? new TouchDelegateInfo(otherInfo.mTargetMap, true) : null;
    }

    private void initPoolingInfos(AccessibilityNodeInfo other) {
        if (mRangeInfo != null) mRangeInfo.recycle();
        mRangeInfo = (other.mRangeInfo != null)
                ? RangeInfo.obtain(other.mRangeInfo) : null;
@@ -3716,10 +3766,20 @@ public class AccessibilityNodeInfo implements Parcelable {
        if (mCollectionItemInfo != null) mCollectionItemInfo.recycle();
        mCollectionItemInfo =  (other.mCollectionItemInfo != null)
                ? CollectionItemInfo.obtain(other.mCollectionItemInfo) : null;
    }

        final TouchDelegateInfo otherInfo = other.mTouchDelegateInfo;
        mTouchDelegateInfo = (otherInfo != null)
                ? new TouchDelegateInfo(otherInfo.mTargetMap, true) : null;
    private void initCopyInfos(AccessibilityNodeInfo other) {
        RangeInfo ri = other.mRangeInfo;
        mRangeInfo = (ri == null) ? null
                : new RangeInfo(ri.mType, ri.mMin, ri.mMax, ri.mCurrent);
        CollectionInfo ci = other.mCollectionInfo;
        mCollectionInfo = (ci == null) ? null
                : new CollectionInfo(ci.mRowCount, ci.mColumnCount,
                                     ci.mHierarchical, ci.mSelectionMode);
        CollectionItemInfo cii = other.mCollectionItemInfo;
        mCollectionItemInfo = (cii == null)  ? null
                : new CollectionItemInfo(cii.mRowIndex, cii.mRowSpan, cii.mColumnIndex,
                                         cii.mColumnSpan, cii.mHeading, cii.mSelected);
    }

    /**
@@ -3854,7 +3914,7 @@ public class AccessibilityNodeInfo implements Parcelable {
     * Clears the state of this instance.
     */
    private void clear() {
        init(DEFAULT);
        init(DEFAULT, true /* usePoolingInfo */);
    }

    private static boolean isDefaultStandardAction(AccessibilityAction action) {
@@ -4709,6 +4769,10 @@ public class AccessibilityNodeInfo implements Parcelable {
        /**
         * Obtains a pooled instance that is a clone of another one.
         *
         * <p>In most situations object pooling is not beneficial. Create a new instance using the
         * constructor {@link AccessibilityNodeInfo.RangeInfo#AccessibilityNodeInfo.RangeInfo(int,
         * float, float, float)} instead.
         *
         * @param other The instance to clone.
         *
         * @hide
@@ -4720,6 +4784,10 @@ public class AccessibilityNodeInfo implements Parcelable {
        /**
         * Obtains a pooled instance.
         *
         * <p>In most situations object pooling is not beneficial. Create a new instance using the
         * constructor {@link AccessibilityNodeInfo.RangeInfo#AccessibilityNodeInfo.RangeInfo(int,
         * float, float, float)} instead.
         *
         * @param type The type of the range.
         * @param min The minimum value. Use {@code Float.NEGATIVE_INFINITY} if the range has no
         *            minimum.
@@ -4750,7 +4818,7 @@ public class AccessibilityNodeInfo implements Parcelable {
         *            maximum.
         * @param current The current value.
         */
        private RangeInfo(int type, float min, float max, float current) {
        public RangeInfo(int type, float min, float max, float current) {
            mType = type;
            mMin = min;
            mMax = max;
@@ -4799,6 +4867,8 @@ public class AccessibilityNodeInfo implements Parcelable {

        /**
         * Recycles this instance.
         *
         * <p>In most situations object pooling is not beneficial, and recycling is not necessary.
         */
        void recycle() {
            clear();
@@ -4849,6 +4919,10 @@ public class AccessibilityNodeInfo implements Parcelable {
        /**
         * Obtains a pooled instance that is a clone of another one.
         *
         * <p>In most situations object pooling is not beneficial. Create a new instance using the
         * constructor {@link
         * AccessibilityNodeInfo.CollectionInfo#AccessibilityNodeInfo.CollectionInfo} instead.
         *
         * @param other The instance to clone.
         * @hide
         */
@@ -4860,6 +4934,11 @@ public class AccessibilityNodeInfo implements Parcelable {
        /**
         * Obtains a pooled instance.
         *
         * <p>In most situations object pooling is not beneficial. Create a new instance using the
         * constructor {@link
         * AccessibilityNodeInfo.CollectionInfo#AccessibilityNodeInfo.CollectionInfo(int, int,
         * boolean)} instead.
         *
         * @param rowCount The number of rows, or -1 if count is unknown.
         * @param columnCount The number of columns, or -1 if count is unknown.
         * @param hierarchical Whether the collection is hierarchical.
@@ -4872,6 +4951,11 @@ public class AccessibilityNodeInfo implements Parcelable {
        /**
         * Obtains a pooled instance.
         *
         * <p>In most situations object pooling is not beneficial. Create a new instance using the
         * constructor {@link
         * AccessibilityNodeInfo.CollectionInfo#AccessibilityNodeInfo.CollectionInfo(int, int,
         * boolean, int)} instead.
         *
         * @param rowCount The number of rows.
         * @param columnCount The number of columns.
         * @param hierarchical Whether the collection is hierarchical.
@@ -4896,6 +4980,17 @@ public class AccessibilityNodeInfo implements Parcelable {
            return info;
        }

        /**
         * Creates a new instance.
         *
         * @param rowCount The number of rows.
         * @param columnCount The number of columns.
         * @param hierarchical Whether the collection is hierarchical.
         */
        public CollectionInfo(int rowCount, int columnCount, boolean hierarchical) {
            this(rowCount, columnCount, hierarchical, SELECTION_MODE_NONE);
        }

        /**
         * Creates a new instance.
         *
@@ -4904,7 +4999,7 @@ public class AccessibilityNodeInfo implements Parcelable {
         * @param hierarchical Whether the collection is hierarchical.
         * @param selectionMode The collection's selection mode.
         */
        private CollectionInfo(int rowCount, int columnCount, boolean hierarchical,
        public CollectionInfo(int rowCount, int columnCount, boolean hierarchical,
                int selectionMode) {
            mRowCount = rowCount;
            mColumnCount = columnCount;
@@ -4955,6 +5050,8 @@ public class AccessibilityNodeInfo implements Parcelable {

        /**
         * Recycles this instance.
         *
         * <p>In most situations object pooling is not beneficial, and recycling is not necessary.
         */
        void recycle() {
            clear();
@@ -4991,6 +5088,11 @@ public class AccessibilityNodeInfo implements Parcelable {
        /**
         * Obtains a pooled instance that is a clone of another one.
         *
         * <p>In most situations object pooling is not beneficial. Create a new instance using the
         * constructor {@link
         * AccessibilityNodeInfo.CollectionItemInfo#AccessibilityNodeInfo.CollectionItemInfo}
         * instead.
         *
         * @param other The instance to clone.
         * @hide
         */
@@ -5002,6 +5104,11 @@ public class AccessibilityNodeInfo implements Parcelable {
        /**
         * Obtains a pooled instance.
         *
         * <p>In most situations object pooling is not beneficial. Create a new instance using the
         * constructor {@link
         * AccessibilityNodeInfo.CollectionItemInfo#AccessibilityNodeInfo.CollectionItemInfo(int,
         * int, int, int, boolean)} instead.
         *
         * @param rowIndex The row index at which the item is located.
         * @param rowSpan The number of rows the item spans.
         * @param columnIndex The column index at which the item is located.
@@ -5017,6 +5124,11 @@ public class AccessibilityNodeInfo implements Parcelable {
        /**
         * Obtains a pooled instance.
         *
         * <p>In most situations object pooling is not beneficial. Creates a new instance using the
         * constructor {@link
         * AccessibilityNodeInfo.CollectionItemInfo#AccessibilityNodeInfo.CollectionItemInfo(int,
         * int, int, int, boolean, boolean)} instead.
         *
         * @param rowIndex The row index at which the item is located.
         * @param rowSpan The number of rows the item spans.
         * @param columnIndex The column index at which the item is located.
@@ -5058,7 +5170,22 @@ public class AccessibilityNodeInfo implements Parcelable {
         * @param columnSpan The number of columns the item spans.
         * @param heading Whether the item is a heading.
         */
        private CollectionItemInfo(int rowIndex, int rowSpan, int columnIndex, int columnSpan,
        public CollectionItemInfo(int rowIndex, int rowSpan, int columnIndex, int columnSpan,
                boolean heading) {
            this(rowIndex, rowSpan, columnIndex, columnSpan, heading, false);
        }

        /**
         * Creates a new instance.
         *
         * @param rowIndex The row index at which the item is located.
         * @param rowSpan The number of rows the item spans.
         * @param columnIndex The column index at which the item is located.
         * @param columnSpan The number of columns the item spans.
         * @param heading Whether the item is a heading.
         * @param selected Whether the item is selected.
         */
        public CollectionItemInfo(int rowIndex, int rowSpan, int columnIndex, int columnSpan,
                boolean heading, boolean selected) {
            mRowIndex = rowIndex;
            mRowSpan = rowSpan;
@@ -5126,6 +5253,8 @@ public class AccessibilityNodeInfo implements Parcelable {

        /**
         * Recycles this instance.
         *
         * <p>In most situations object pooling is not beneficial, and recycling is not necessary.
         */
        void recycle() {
            clear();
+22 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.view.accessibility;

import static com.android.internal.util.CollectionUtils.isEmpty;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UnsupportedAppUsage;
import android.os.Parcelable;
@@ -113,10 +114,20 @@ public class AccessibilityRecord {

    int mConnectionId = UNDEFINED;

    /*
     * Hide constructor.
    /**
     * Creates a new {@link AccessibilityRecord}.
     */
    public AccessibilityRecord() {
    }

    /**
     * Copy constructor. Creates a new {@link AccessibilityRecord}, and this instance is initialized
     * with data from the given <code>record</code>.
     *
     * @param record The other record.
     */
    AccessibilityRecord() {
    public AccessibilityRecord(@NonNull AccessibilityRecord record) {
        init(record);
    }

    /**
@@ -790,6 +801,9 @@ public class AccessibilityRecord {
     * instantiated. The instance is initialized with data from the
     * given record.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityRecord(AccessibilityRecord)} instead.
     *
     * @return An instance.
     */
    public static AccessibilityRecord obtain(AccessibilityRecord record) {
@@ -802,6 +816,9 @@ public class AccessibilityRecord {
     * Returns a cached instance if such is available or a new one is
     * instantiated.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityRecord()} instead.
     *
     * @return An instance.
     */
    public static AccessibilityRecord obtain() {
@@ -823,6 +840,8 @@ public class AccessibilityRecord {
     * <p>
     * <strong>Note:</strong> You must not touch the object after calling this function.
     *
     * <p>In most situations object pooling is not beneficial, and recycling is not necessary.
     *
     * @throws IllegalStateException If the record is already recycled.
     */
    public void recycle() {
+19 −4
Original line number Diff line number Diff line
@@ -119,12 +119,19 @@ public final class AccessibilityWindowInfo implements Parcelable {

    private int mConnectionId = UNDEFINED_WINDOW_ID;

    private AccessibilityWindowInfo() {
        /* do nothing - hide constructor */
    /**
     * Creates a new {@link AccessibilityWindowInfo}.
     */
    public AccessibilityWindowInfo() {
    }

    /** @hide */
    AccessibilityWindowInfo(AccessibilityWindowInfo info) {
    /**
     * Copy constructor. Creates a new {@link AccessibilityWindowInfo}, and this new instance is
     * initialized from given <code>info</code>.
     *
     * @param info The other info.
     */
    public AccessibilityWindowInfo(@NonNull AccessibilityWindowInfo info) {
        init(info);
    }

@@ -469,6 +476,9 @@ public final class AccessibilityWindowInfo implements Parcelable {
     * Returns a cached instance if such is available or a new one is
     * created.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityWindowInfo()} instead.
     *
     * @return An instance.
     */
    public static AccessibilityWindowInfo obtain() {
@@ -487,6 +497,9 @@ public final class AccessibilityWindowInfo implements Parcelable {
     * created. The returned instance is initialized from the given
     * <code>info</code>.
     *
     * <p>In most situations object pooling is not beneficial. Create a new instance using the
     * constructor {@link #AccessibilityWindowInfo(AccessibilityWindowInfo)} instead.
     *
     * @param info The other info.
     * @return An instance.
     */
@@ -514,6 +527,8 @@ public final class AccessibilityWindowInfo implements Parcelable {
     * <strong>Note:</strong> You must not touch the object after calling this function.
     * </p>
     *
     * <p>In most situations object pooling is not beneficial, and recycling is not necessary.
     *
     * @throws IllegalStateException If the info is already recycled.
     */
    public void recycle() {