AccessibilityRecordCompat.java revision 645e5c8aa6b31961c5f73f3d30bb5261d5e04aeb
19648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov/*
29648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Copyright (C) 2011 The Android Open Source Project
39648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov *
49648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Licensed under the Apache License, Version 2.0 (the "License");
59648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * you may not use this file except in compliance with the License.
69648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * You may obtain a copy of the License at
79648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov *
89648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov *      http://www.apache.org/licenses/LICENSE-2.0
99648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov *
109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Unless required by applicable law or agreed to in writing, software
119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * distributed under the License is distributed on an "AS IS" BASIS,
129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * See the License for the specific language governing permissions and
149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * limitations under the License.
159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */
169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovpackage android.support.v4.view.accessibility;
189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.os.Build;
209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.os.Parcelable;
2114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikasimport android.support.annotation.NonNull;
22c69882cb9b130902c1554ef5d3e3b06d776cd796Alan Viveretteimport android.support.annotation.RequiresApi;
239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.View;
244184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslavimport android.view.accessibility.AccessibilityEvent;
2514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikasimport android.view.accessibility.AccessibilityRecord;
269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport java.util.List;
289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov/**
30645e5c8aa6b31961c5f73f3d30bb5261d5e04aebKirill Grouchnikov * Helper for accessing {@link AccessibilityRecord}.
319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */
329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovpublic class AccessibilityRecordCompat {
339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    static class AccessibilityRecordCompatBaseImpl {
3514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public int getMaxScrollX(AccessibilityRecord record) {
369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public int getMaxScrollY(AccessibilityRecord record) {
409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public void setMaxScrollX(AccessibilityRecord record, int maxScrollX) {
449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public void setMaxScrollY(AccessibilityRecord record, int maxScrollY) {
479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public void setSource(AccessibilityRecord record, View root, int virtualDescendantId) {
509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
53c69882cb9b130902c1554ef5d3e3b06d776cd796Alan Viverette    @RequiresApi(15)
5414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    static class AccessibilityRecordCompatApi15Impl extends AccessibilityRecordCompatBaseImpl {
55c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov        @Override
5614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public int getMaxScrollX(AccessibilityRecord record) {
5714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            return record.getMaxScrollX();
58c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov        }
59c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov
60c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov        @Override
6114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public int getMaxScrollY(AccessibilityRecord record) {
6214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            return record.getMaxScrollY();
63c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov        }
64c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov
65c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov        @Override
6614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public void setMaxScrollX(AccessibilityRecord record, int maxScrollX) {
6714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            record.setMaxScrollX(maxScrollX);
68c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov        }
69c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov
70c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov        @Override
7114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public void setMaxScrollY(AccessibilityRecord record, int maxScrollY) {
7214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            record.setMaxScrollY(maxScrollY);
73c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov        }
74c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    }
75c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov
76c69882cb9b130902c1554ef5d3e3b06d776cd796Alan Viverette    @RequiresApi(16)
7714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    static class AccessibilityRecordCompatApi16Impl extends AccessibilityRecordCompatApi15Impl {
783a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov        @Override
7914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        public void setSource(AccessibilityRecord record, View root, int virtualDescendantId) {
8014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            record.setSource(root, virtualDescendantId);
813a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov        }
823a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov    }
833a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov
849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    static {
85f3ed7c56e6c409d27c60f7d74c026906593c21d4Svetoslav Ganov        if (Build.VERSION.SDK_INT >= 16) { // JellyBean
8614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            IMPL = new AccessibilityRecordCompatApi16Impl();
873a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov        } else if (Build.VERSION.SDK_INT >= 15) {  // ICS MR1
8814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            IMPL = new AccessibilityRecordCompatApi15Impl();
899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        } else {
9014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            IMPL = new AccessibilityRecordCompatBaseImpl();
919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
9414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    private static final AccessibilityRecordCompatBaseImpl IMPL;
959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
9614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    private final AccessibilityRecord mRecord;
979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
984184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav    /**
994184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * @deprecated This is not type safe. If you want to modify an
1004184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * {@link AccessibilityEvent}'s properties defined in
1014184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * {@link android.view.accessibility.AccessibilityRecord} use
1028f590dabd4e7d3fa4abfc74c91640690b63fc45aSvetoslav     * {@link AccessibilityEventCompat#asRecord(AccessibilityEvent)}. This method will be removed
1034184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * in a subsequent release of the support library.
1049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
105d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette    @Deprecated
1069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public AccessibilityRecordCompat(Object record) {
10714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord = (AccessibilityRecord) record;
1089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
1099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
1119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The wrapped implementation.
1124184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     *
1134184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * @deprecated This method will be removed in a subsequent release of
1144184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * the support library.
1159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
116d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette    @Deprecated
1179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public Object getImpl() {
1189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return mRecord;
1199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
1209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
1229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Returns a cached instance if such is available or a new one is
1239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * instantiated. The instance is initialized with data from the
1249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * given record.
1259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
1269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return An instance.
12714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
12814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#obtain(AccessibilityRecord)} directly.
1299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
13014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
1319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public static AccessibilityRecordCompat obtain(AccessibilityRecordCompat record) {
13214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return new AccessibilityRecordCompat(AccessibilityRecord.obtain(record.mRecord));
1339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
1349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
1369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Returns a cached instance if such is available or a new one is
1379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * instantiated.
1389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
1399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return An instance.
14014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
14114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#obtain()} directly.
1429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
14314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
1449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public static AccessibilityRecordCompat obtain() {
14514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return new AccessibilityRecordCompat(AccessibilityRecord.obtain());
1469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
1479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
1499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the event source.
1509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
1519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param source The source.
1529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
1539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
15414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
15514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setSource(View)} directly.
1569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
15714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
1589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setSource(View source) {
15914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setSource(source);
1609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
1619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
1633a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * Sets the source to be a virtual descendant of the given <code>root</code>.
1643a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * If <code>virtualDescendantId</code> equals to {@link View#NO_ID} the root
1653a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * is set as the source.
1663a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * <p>
1673a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * A virtual descendant is an imaginary View that is reported as a part of the view
1683a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * hierarchy for accessibility purposes. This enables custom views that draw complex
1693a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * content to report them selves as a tree of virtual views, thus conveying their
1703a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * logical structure.
1713a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * </p>
1723a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     *
1733a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * @param root The root of the virtual subtree.
1743a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * @param virtualDescendantId The id of the virtual descendant.
17514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
17614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #setSource(AccessibilityRecord, View, int)} instead.
1773a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     */
17814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
1793a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov    public void setSource(View root, int virtualDescendantId) {
18014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        AccessibilityRecordCompat.setSource(mRecord, root, virtualDescendantId);
18114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
18214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
18314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
18414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Sets the source to be a virtual descendant of the given <code>root</code>.
18514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * If <code>virtualDescendantId</code> equals to {@link View#NO_ID} the root
18614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * is set as the source.
18714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * <p>
18814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * A virtual descendant is an imaginary View that is reported as a part of the view
18914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * hierarchy for accessibility purposes. This enables custom views that draw complex
19014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * content to report them selves as a tree of virtual views, thus conveying their
19114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * logical structure.
19214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * </p>
19314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
19414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
19514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param root The root of the virtual subtree.
19614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param virtualDescendantId The id of the virtual descendant.
19714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
19814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static void setSource(@NonNull AccessibilityRecord record, View root,
19914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            int virtualDescendantId) {
20014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        IMPL.setSource(record, root, virtualDescendantId);
2013a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov    }
2023a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov
2033a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov    /**
2049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the {@link android.view.accessibility.AccessibilityNodeInfo} of
2059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * the event source.
2069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <p>
2079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <strong>Note:</strong> It is a client responsibility to recycle the
2089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * received info by calling
2099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * {@link android.view.accessibility.AccessibilityNodeInfo#recycle()
2109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.
2119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *</p>
2129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The info of the source.
21414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
21514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getSource()} directly.
2169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
21714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public AccessibilityNodeInfoCompat getSource() {
21914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return AccessibilityNodeInfoCompat.wrapNonNullInstance(mRecord.getSource());
2209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the id of the window from which the event comes from.
2249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The window id.
22614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
22714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getWindowId()} directly.
2289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
22914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getWindowId() {
23114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getWindowId();
2329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is checked.
2369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the view is checked, false otherwise.
23814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
23914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isChecked()} directly.
2409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
24114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isChecked() {
24314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isChecked();
2449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is checked.
2489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isChecked True if the view is checked, false otherwise.
2509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
25214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
25314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setChecked(boolean)} directly.
2549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
25514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setChecked(boolean isChecked) {
25714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setChecked(isChecked);
2589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is enabled.
2629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the view is enabled, false otherwise.
26414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
26514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isEnabled()} directly.
2669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
26714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isEnabled() {
26914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isEnabled();
2709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is enabled.
2749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isEnabled True if the view is enabled, false otherwise.
2769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
27814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
27914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isEnabled()} directly.
2809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
28114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setEnabled(boolean isEnabled) {
28314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setEnabled(isEnabled);
2849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is a password field.
2889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the view is a password field, false otherwise.
29014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
29114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isPassword()} directly.
2929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
29314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isPassword() {
29514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isPassword();
2969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is a password field.
3009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isPassword True if the view is a password field, false otherwise.
3029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
30414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
30514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setPassword(boolean)} directly.
3069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
30714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setPassword(boolean isPassword) {
30914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setPassword(isPassword);
3109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is taking the entire screen.
3149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the source is full screen, false otherwise.
31614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
31714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isFullScreen()} directly.
3189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
31914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isFullScreen() {
32114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isFullScreen();
3229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is taking the entire screen.
3269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isFullScreen True if the source is full screen, false otherwise.
3289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
33014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
33114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setFullScreen(boolean)} directly.
3329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
33314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setFullScreen(boolean isFullScreen) {
33514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setFullScreen(isFullScreen);
3369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is scrollable.
3409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the source is scrollable, false otherwise.
34214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
34314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isScrollable()} directly.
3449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
34514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isScrollable() {
34714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isScrollable();
3489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is scrollable.
3529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param scrollable True if the source is scrollable, false otherwise.
3549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
35614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
35714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setScrollable(boolean)} directly.
3589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
35914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setScrollable(boolean scrollable) {
36114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setScrollable(scrollable);
3629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the number of items that can be visited.
3669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The number of items.
36814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
36914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getItemCount()} directly.
3709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
37114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getItemCount() {
37314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getItemCount();
3749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the number of items that can be visited.
3789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param itemCount The number of items.
3809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
38214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
38314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setItemCount(int)} directly.
3849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
38514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setItemCount(int itemCount) {
38714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setItemCount(itemCount);
3889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the index of the source in the list of items the can be visited.
3929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The current item index.
39414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
39514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getCurrentItemIndex()} directly.
3969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
39714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getCurrentItemIndex() {
39914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getCurrentItemIndex();
4009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the index of the source in the list of items that can be visited.
4049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param currentItemIndex The current item index.
4069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
40814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
40914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setCurrentItemIndex(int)} directly.
4109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
41114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setCurrentItemIndex(int currentItemIndex) {
41314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setCurrentItemIndex(currentItemIndex);
4149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the index of the first character of the changed sequence,
4189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * or the beginning of a text selection or the index of the first
4199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
4209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The index of the first character or selection
4229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *        start or the first visible item.
42314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
42414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getFromIndex()} directly.
4259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
42614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getFromIndex() {
42814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getFromIndex();
4299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the index of the first character of the changed sequence
4339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * or the beginning of a text selection or the index of the first
4349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
4359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param fromIndex The index of the first character or selection
4379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *        start or the first visible item.
4389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
44014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
44114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setFromIndex(int)} directly.
4429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
44314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setFromIndex(int fromIndex) {
44514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setFromIndex(fromIndex);
4469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the index of text selection end or the index of the last
4509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
4519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The index of selection end or last item index.
45314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
45414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getToIndex()} directly.
4559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
45614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getToIndex() {
45814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getToIndex();
4599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the index of text selection end or the index of the last
4639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
4649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param toIndex The index of selection end or last item index.
46614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
46714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setToIndex(int)} directly.
4689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
46914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setToIndex(int toIndex) {
47114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setToIndex(toIndex);
4729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the scroll offset of the source left edge in pixels.
4769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The scroll.
47814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
47914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getScrollX()} directly.
4809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
48114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getScrollX() {
48314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getScrollX();
4849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the scroll offset of the source left edge in pixels.
4889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param scrollX The scroll.
49014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
49114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setScrollX(int)} directly.
4929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
49314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setScrollX(int scrollX) {
49514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setScrollX(scrollX);
4969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the scroll offset of the source top edge in pixels.
5009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The scroll.
50214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
50314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getScrollY()} directly.
5049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
50514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
5069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getScrollY() {
50714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getScrollY();
5089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the scroll offset of the source top edge in pixels.
5129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param scrollY The scroll.
51414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
51514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setScrollY(int)} directly.
5169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
51714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
5189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setScrollY(int scrollY) {
51914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setScrollY(scrollY);
5209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
522c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    /**
523c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * Gets the max scroll offset of the source left edge in pixels.
524c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     *
525c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * @return The max scroll.
52614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
52714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #getMaxScrollX(AccessibilityRecord)} instead.
528c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     */
52914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
530c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    public int getMaxScrollX() {
53114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return AccessibilityRecordCompat.getMaxScrollX(mRecord);
532c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    }
53314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
53414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
53514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Gets the max scroll offset of the source left edge in pixels.
53614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
53714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
53814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @return The max scroll.
53914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
54014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static int getMaxScrollX(AccessibilityRecord record) {
54114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return IMPL.getMaxScrollX(record);
54214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
54314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
544c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    /**
545c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * Sets the max scroll offset of the source left edge in pixels.
546c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     *
547c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * @param maxScrollX The max scroll.
54814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
54914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #setMaxScrollX(AccessibilityRecord, int)} instead.
550c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     */
55114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
552c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    public void setMaxScrollX(int maxScrollX) {
55314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        AccessibilityRecordCompat.setMaxScrollX(mRecord, maxScrollX);
55414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
55514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
55614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
55714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Sets the max scroll offset of the source left edge in pixels.
55814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
55914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
56014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param maxScrollX The max scroll.
56114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
56214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static void setMaxScrollX(AccessibilityRecord record, int maxScrollX) {
56314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        IMPL.setMaxScrollX(record, maxScrollX);
564c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    }
565c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov
566c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    /**
567c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * Gets the max scroll offset of the source top edge in pixels.
568c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     *
569c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * @return The max scroll.
57014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
57114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #getMaxScrollY(AccessibilityRecord)} instead.
572c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     */
57314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
574c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    public int getMaxScrollY() {
57514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return AccessibilityRecordCompat.getMaxScrollY(mRecord);
57614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
57714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
57814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
57914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Gets the max scroll offset of the source top edge in pixels.
58014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
58114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
58214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @return The max scroll.
58314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
58414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static int getMaxScrollY(AccessibilityRecord record) {
58514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return IMPL.getMaxScrollY(record);
586c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    }
587c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov
588c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    /**
589c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * Sets the max scroll offset of the source top edge in pixels.
590c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     *
591c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * @param maxScrollY The max scroll.
59214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
59314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #setMaxScrollY(AccessibilityRecord, int)} instead.
594c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     */
59514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
596c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    public void setMaxScrollY(int maxScrollY) {
59714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        AccessibilityRecordCompat.setMaxScrollY(mRecord, maxScrollY);
59814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
59914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
60014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
60114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Sets the max scroll offset of the source top edge in pixels.
60214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
60314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
60414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param maxScrollY The max scroll.
60514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
60614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static void setMaxScrollY(AccessibilityRecord record, int maxScrollY) {
60714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        IMPL.setMaxScrollY(record, maxScrollY);
608c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    }
6099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the number of added characters.
6129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The number of added characters.
61414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
61514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getAddedCount()} directly.
6169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
61714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getAddedCount() {
61914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getAddedCount();
6209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the number of added characters.
6249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param addedCount The number of added characters.
6269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
62814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
62914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setAddedCount(int)} directly.
6309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
63114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setAddedCount(int addedCount) {
63314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setAddedCount(addedCount);
6349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the number of removed characters.
6389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The number of removed characters.
64014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
64114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getRemovedCount()} directly.
6429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
64314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getRemovedCount() {
64514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getRemovedCount();
6469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the number of removed characters.
6509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param removedCount The number of removed characters.
6529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
65414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
65514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setRemovedCount(int)} directly.
6569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
65714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setRemovedCount(int removedCount) {
65914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setRemovedCount(removedCount);
6609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the class name of the source.
6649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The class name.
66614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
66714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getClassName()} directly.
6689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
66914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public CharSequence getClassName() {
67114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getClassName();
6729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the class name of the source.
6769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param className The lass name.
6789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
68014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
68114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setClassName(CharSequence)} directly.
6829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
68314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setClassName(CharSequence className) {
68514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setClassName(className);
6869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the text of the event. The index in the list represents the priority
6909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * of the text. Specifically, the lower the index the higher the priority.
6919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The text.
69314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
69414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getText()} directly.
6959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
69614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public List<CharSequence> getText() {
69814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getText();
6999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the text before a change.
7039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The text before the change.
70514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
70614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getBeforeText()} directly.
7079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
70814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public CharSequence getBeforeText() {
71014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getBeforeText();
7119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the text before a change.
7159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param beforeText The text before the change.
7179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
71914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
72014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setBeforeText(CharSequence)} directly.
7219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
72214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setBeforeText(CharSequence beforeText) {
72414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setBeforeText(beforeText);
7259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the description of the source.
7299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The description.
73114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
73214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getContentDescription()} directly.
7339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
73414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public CharSequence getContentDescription() {
73614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getContentDescription();
7379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the description of the source.
7419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param contentDescription The description.
7439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
74514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
74614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setContentDescription(CharSequence)} directly.
7479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
74814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setContentDescription(CharSequence contentDescription) {
75014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setContentDescription(contentDescription);
7519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the {@link Parcelable} data.
7559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The parcelable data.
75714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
75814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getParcelableData()} directly.
7599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
76014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public Parcelable getParcelableData() {
76214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getParcelableData();
7639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the {@link Parcelable} data of the event.
7679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param parcelableData The parcelable data.
7699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
77114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
77214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setParcelableData(Parcelable)} directly.
7739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
77414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setParcelableData(Parcelable parcelableData) {
77614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setParcelableData(parcelableData);
7779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Return an instance back to be reused.
7819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <p>
7829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <strong>Note:</strong> You must not touch the object after calling this
7839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * function.
7849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * </p>
7859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If the record is already recycled.
78714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
78814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#recycle()} directly.
7899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
79014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void recycle() {
79214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.recycle();
7939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
79514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
79614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#hashCode()} directly.
79714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
79814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    @Override
8009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int hashCode() {
8019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return (mRecord == null) ? 0 : mRecord.hashCode();
8029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
80414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
80514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord} directly.
80614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
80714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
8089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    @Override
8099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean equals(Object obj) {
8109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (this == obj) {
8119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return true;
8129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
8139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (obj == null) {
8149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
8159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
8169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (getClass() != obj.getClass()) {
8179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
8189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
8199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        AccessibilityRecordCompat other = (AccessibilityRecordCompat) obj;
8209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (mRecord == null) {
8219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            if (other.mRecord != null) {
8229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov                return false;
8239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            }
8249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        } else if (!mRecord.equals(other.mRecord)) {
8259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
8269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
8279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return true;
8289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov}
830