AccessibilityRecordCompat.java revision ac5fe7c617c66850fff75a9fce9979c6e5674b0f
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
17ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikaspackage androidx.core.view.accessibility;
189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.os.Build;
209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.os.Parcelable;
21ac5fe7c617c66850fff75a9fce9979c6e5674b0fAurimas Liutikasimport androidx.annotation.NonNull;
229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.View;
234184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslavimport android.view.accessibility.AccessibilityEvent;
2414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikasimport android.view.accessibility.AccessibilityRecord;
259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport java.util.List;
279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov/**
29645e5c8aa6b31961c5f73f3d30bb5261d5e04aebKirill Grouchnikov * Helper for accessing {@link AccessibilityRecord}.
309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */
319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovpublic class AccessibilityRecordCompat {
3214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    private final AccessibilityRecord mRecord;
339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
344184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav    /**
354184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * @deprecated This is not type safe. If you want to modify an
364184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * {@link AccessibilityEvent}'s properties defined in
374184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * {@link android.view.accessibility.AccessibilityRecord} use
388f590dabd4e7d3fa4abfc74c91640690b63fc45aSvetoslav     * {@link AccessibilityEventCompat#asRecord(AccessibilityEvent)}. This method will be removed
394184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * in a subsequent release of the support library.
409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
41d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette    @Deprecated
429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public AccessibilityRecordCompat(Object record) {
4314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord = (AccessibilityRecord) record;
449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The wrapped implementation.
484184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     *
494184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * @deprecated This method will be removed in a subsequent release of
504184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav     * the support library.
519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
52d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette    @Deprecated
539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public Object getImpl() {
549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return mRecord;
559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Returns a cached instance if such is available or a new one is
599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * instantiated. The instance is initialized with data from the
609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * given record.
619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return An instance.
6314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
6414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#obtain(AccessibilityRecord)} directly.
659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public static AccessibilityRecordCompat obtain(AccessibilityRecordCompat record) {
6814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return new AccessibilityRecordCompat(AccessibilityRecord.obtain(record.mRecord));
699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Returns a cached instance if such is available or a new one is
739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * instantiated.
749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return An instance.
7614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
7714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#obtain()} directly.
789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
7914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public static AccessibilityRecordCompat obtain() {
8114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return new AccessibilityRecordCompat(AccessibilityRecord.obtain());
829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the event source.
869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param source The source.
889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
9014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
9114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setSource(View)} directly.
929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
9314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setSource(View source) {
9514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setSource(source);
969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
993a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * Sets the source to be a virtual descendant of the given <code>root</code>.
1003a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * If <code>virtualDescendantId</code> equals to {@link View#NO_ID} the root
1013a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * is set as the source.
1023a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * <p>
1033a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * A virtual descendant is an imaginary View that is reported as a part of the view
1043a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * hierarchy for accessibility purposes. This enables custom views that draw complex
1053a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * content to report them selves as a tree of virtual views, thus conveying their
1063a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * logical structure.
1073a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * </p>
1083a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     *
1093a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * @param root The root of the virtual subtree.
1103a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     * @param virtualDescendantId The id of the virtual descendant.
11114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
11214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #setSource(AccessibilityRecord, View, int)} instead.
1133a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov     */
11414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
1153a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov    public void setSource(View root, int virtualDescendantId) {
11614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        AccessibilityRecordCompat.setSource(mRecord, root, virtualDescendantId);
11714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
11814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
11914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
12014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Sets the source to be a virtual descendant of the given <code>root</code>.
12114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * If <code>virtualDescendantId</code> equals to {@link View#NO_ID} the root
12214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * is set as the source.
12314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * <p>
12414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * A virtual descendant is an imaginary View that is reported as a part of the view
12514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * hierarchy for accessibility purposes. This enables custom views that draw complex
12614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * content to report them selves as a tree of virtual views, thus conveying their
12714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * logical structure.
12814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * </p>
12914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
13014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
13114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param root The root of the virtual subtree.
13214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param virtualDescendantId The id of the virtual descendant.
13314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
13414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static void setSource(@NonNull AccessibilityRecord record, View root,
13514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas            int virtualDescendantId) {
136e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        if (Build.VERSION.SDK_INT >= 16) {
137e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas            record.setSource(root, virtualDescendantId);
138e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        }
1393a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov    }
1403a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov
1413a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov    /**
1429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the {@link android.view.accessibility.AccessibilityNodeInfo} of
1439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * the event source.
1449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <p>
1459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <strong>Note:</strong> It is a client responsibility to recycle the
1469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * received info by calling
1479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * {@link android.view.accessibility.AccessibilityNodeInfo#recycle()
1489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.
1499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *</p>
1509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
1519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The info of the source.
15214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
15314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getSource()} directly.
1549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
15514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
1569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public AccessibilityNodeInfoCompat getSource() {
15714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return AccessibilityNodeInfoCompat.wrapNonNullInstance(mRecord.getSource());
1589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
1599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
1619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the id of the window from which the event comes from.
1629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
1639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The window id.
16414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
16514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getWindowId()} directly.
1669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
16714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
1689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getWindowId() {
16914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getWindowId();
1709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
1719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
1739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is checked.
1749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
1759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the view is checked, false otherwise.
17614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
17714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isChecked()} directly.
1789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
17914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
1809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isChecked() {
18114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isChecked();
1829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
1839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
1859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is checked.
1869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
1879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isChecked True if the view is checked, false otherwise.
1889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
1899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
19014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
19114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setChecked(boolean)} directly.
1929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
19314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
1949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setChecked(boolean isChecked) {
19514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setChecked(isChecked);
1969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
1979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
1999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is enabled.
2009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the view is enabled, false otherwise.
20214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
20314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isEnabled()} directly.
2049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
20514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isEnabled() {
20714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isEnabled();
2089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is enabled.
2129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isEnabled True if the view is enabled, false otherwise.
2149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
21614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
21714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isEnabled()} directly.
2189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
21914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setEnabled(boolean isEnabled) {
22114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setEnabled(isEnabled);
2229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is a password field.
2269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the view is a password field, false otherwise.
22814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
22914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isPassword()} directly.
2309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
23114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isPassword() {
23314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isPassword();
2349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is a password field.
2389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isPassword True if the view is a password field, false otherwise.
2409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
24214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
24314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setPassword(boolean)} directly.
2449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
24514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setPassword(boolean isPassword) {
24714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setPassword(isPassword);
2489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is taking the entire screen.
2529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the source is full screen, false otherwise.
25414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
25514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isFullScreen()} directly.
2569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
25714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isFullScreen() {
25914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isFullScreen();
2609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is taking the entire screen.
2649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isFullScreen True if the source is full screen, false otherwise.
2669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
26814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
26914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setFullScreen(boolean)} directly.
2709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
27114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setFullScreen(boolean isFullScreen) {
27314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setFullScreen(isFullScreen);
2749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is scrollable.
2789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the source is scrollable, false otherwise.
28014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
28114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#isScrollable()} directly.
2829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
28314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isScrollable() {
28514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.isScrollable();
2869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
2899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is scrollable.
2909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param scrollable True if the source is scrollable, false otherwise.
2929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
2939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
29414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
29514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setScrollable(boolean)} directly.
2969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
29714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
2989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setScrollable(boolean scrollable) {
29914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setScrollable(scrollable);
3009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the number of items that can be visited.
3049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The number of items.
30614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
30714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getItemCount()} directly.
3089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
30914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getItemCount() {
31114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getItemCount();
3129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the number of items that can be visited.
3169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param itemCount The number of items.
3189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
32014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
32114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setItemCount(int)} directly.
3229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
32314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setItemCount(int itemCount) {
32514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setItemCount(itemCount);
3269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the index of the source in the list of items the can be visited.
3309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The current item index.
33214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
33314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getCurrentItemIndex()} directly.
3349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
33514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getCurrentItemIndex() {
33714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getCurrentItemIndex();
3389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the index of the source in the list of items that can be visited.
3429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param currentItemIndex The current item index.
3449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
34614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
34714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setCurrentItemIndex(int)} directly.
3489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
34914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setCurrentItemIndex(int currentItemIndex) {
35114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setCurrentItemIndex(currentItemIndex);
3529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the index of the first character of the changed sequence,
3569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * or the beginning of a text selection or the index of the first
3579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
3589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The index of the first character or selection
3609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *        start or the first visible item.
36114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
36214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getFromIndex()} directly.
3639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
36414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getFromIndex() {
36614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getFromIndex();
3679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the index of the first character of the changed sequence
3719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * or the beginning of a text selection or the index of the first
3729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
3739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param fromIndex The index of the first character or selection
3759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *        start or the first visible item.
3769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
37814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
37914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setFromIndex(int)} directly.
3809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
38114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setFromIndex(int fromIndex) {
38314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setFromIndex(fromIndex);
3849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
3879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the index of text selection end or the index of the last
3889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
3899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
3909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The index of selection end or last item index.
39114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
39214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getToIndex()} directly.
3939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
39414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
3959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getToIndex() {
39614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getToIndex();
3979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
3989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the index of text selection end or the index of the last
4019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
4029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param toIndex The index of selection end or last item index.
40414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
40514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setToIndex(int)} directly.
4069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
40714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setToIndex(int toIndex) {
40914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setToIndex(toIndex);
4109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the scroll offset of the source left edge in pixels.
4149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The scroll.
41614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
41714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getScrollX()} directly.
4189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
41914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getScrollX() {
42114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getScrollX();
4229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the scroll offset of the source left edge in pixels.
4269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param scrollX The scroll.
42814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
42914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setScrollX(int)} directly.
4309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
43114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setScrollX(int scrollX) {
43314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setScrollX(scrollX);
4349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the scroll offset of the source top edge in pixels.
4389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The scroll.
44014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
44114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getScrollY()} directly.
4429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
44314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getScrollY() {
44514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getScrollY();
4469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the scroll offset of the source top edge in pixels.
4509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param scrollY The scroll.
45214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
45314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setScrollY(int)} directly.
4549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
45514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
4569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setScrollY(int scrollY) {
45714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setScrollY(scrollY);
4589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
460c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    /**
461c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * Gets the max scroll offset of the source left edge in pixels.
462c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     *
463c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * @return The max scroll.
46414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
46514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #getMaxScrollX(AccessibilityRecord)} instead.
466c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     */
46714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
468c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    public int getMaxScrollX() {
46914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return AccessibilityRecordCompat.getMaxScrollX(mRecord);
470c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    }
47114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
47214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
47314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Gets the max scroll offset of the source left edge in pixels.
47414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
47514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
47614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @return The max scroll.
47714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
47814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static int getMaxScrollX(AccessibilityRecord record) {
479e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        if (Build.VERSION.SDK_INT >= 15) {
480e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas            return record.getMaxScrollX();
481e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        } else {
482e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas            return 0;
483e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        }
48414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
48514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
486c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    /**
487c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * Sets the max scroll offset of the source left edge in pixels.
488c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     *
489c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * @param maxScrollX The max scroll.
49014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
49114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #setMaxScrollX(AccessibilityRecord, int)} instead.
492c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     */
49314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
494c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    public void setMaxScrollX(int maxScrollX) {
49514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        AccessibilityRecordCompat.setMaxScrollX(mRecord, maxScrollX);
49614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
49714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
49814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
49914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Sets the max scroll offset of the source left edge in pixels.
50014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
50114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
50214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param maxScrollX The max scroll.
50314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
50414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static void setMaxScrollX(AccessibilityRecord record, int maxScrollX) {
505e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        if (Build.VERSION.SDK_INT >= 15) {
506e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas            record.setMaxScrollX(maxScrollX);
507e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        }
508c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    }
509c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov
510c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    /**
511c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * Gets the max scroll offset of the source top edge in pixels.
512c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     *
513c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * @return The max scroll.
51414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
51514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #getMaxScrollY(AccessibilityRecord)} instead.
516c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     */
51714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
518c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    public int getMaxScrollY() {
51914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return AccessibilityRecordCompat.getMaxScrollY(mRecord);
52014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
52114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
52214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
52314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Gets the max scroll offset of the source top edge in pixels.
52414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
52514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
52614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @return The max scroll.
52714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
52814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static int getMaxScrollY(AccessibilityRecord record) {
529e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        if (Build.VERSION.SDK_INT >= 15) {
530e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas            return record.getMaxScrollY();
531e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        } else {
532e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas            return 0;
533e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        }
534c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    }
535c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov
536c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    /**
537c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * Sets the max scroll offset of the source top edge in pixels.
538c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     *
539c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     * @param maxScrollY The max scroll.
54014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
54114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link #setMaxScrollY(AccessibilityRecord, int)} instead.
542c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov     */
54314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
544c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    public void setMaxScrollY(int maxScrollY) {
54514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        AccessibilityRecordCompat.setMaxScrollY(mRecord, maxScrollY);
54614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    }
54714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas
54814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
54914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * Sets the max scroll offset of the source top edge in pixels.
55014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
55114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param record The {@link AccessibilityRecord} instance to use.
55214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @param maxScrollY The max scroll.
55314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
55414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    public static void setMaxScrollY(AccessibilityRecord record, int maxScrollY) {
555e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        if (Build.VERSION.SDK_INT >= 15) {
556e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas            record.setMaxScrollY(maxScrollY);
557e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas        }
558c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov    }
5599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the number of added characters.
5629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The number of added characters.
56414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
56514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getAddedCount()} directly.
5669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
56714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
5689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getAddedCount() {
56914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getAddedCount();
5709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the number of added characters.
5749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param addedCount The number of added characters.
5769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
57814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
57914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setAddedCount(int)} directly.
5809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
58114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
5829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setAddedCount(int addedCount) {
58314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setAddedCount(addedCount);
5849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the number of removed characters.
5889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The number of removed characters.
59014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
59114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getRemovedCount()} directly.
5929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
59314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
5949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getRemovedCount() {
59514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getRemovedCount();
5969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the number of removed characters.
6009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param removedCount The number of removed characters.
6029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
60414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
60514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setRemovedCount(int)} directly.
6069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
60714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setRemovedCount(int removedCount) {
60914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setRemovedCount(removedCount);
6109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the class name of the source.
6149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The class name.
61614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
61714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getClassName()} directly.
6189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
61914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public CharSequence getClassName() {
62114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getClassName();
6229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the class name of the source.
6269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param className The lass name.
6289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
63014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
63114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setClassName(CharSequence)} directly.
6329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
63314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setClassName(CharSequence className) {
63514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setClassName(className);
6369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the text of the event. The index in the list represents the priority
6409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * of the text. Specifically, the lower the index the higher the priority.
6419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The text.
64314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
64414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getText()} directly.
6459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
64614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public List<CharSequence> getText() {
64814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getText();
6499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the text before a change.
6539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The text before the change.
65514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
65614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getBeforeText()} directly.
6579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
65814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public CharSequence getBeforeText() {
66014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getBeforeText();
6619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the text before a change.
6659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param beforeText The text before the change.
6679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
66914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
67014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setBeforeText(CharSequence)} directly.
6719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
67214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setBeforeText(CharSequence beforeText) {
67414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setBeforeText(beforeText);
6759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the description of the source.
6799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The description.
68114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
68214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getContentDescription()} directly.
6839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
68414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public CharSequence getContentDescription() {
68614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getContentDescription();
6879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the description of the source.
6919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param contentDescription The description.
6939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
69514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
69614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setContentDescription(CharSequence)} directly.
6979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
69814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
6999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setContentDescription(CharSequence contentDescription) {
70014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setContentDescription(contentDescription);
7019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the {@link Parcelable} data.
7059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The parcelable data.
70714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
70814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#getParcelableData()} directly.
7099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
71014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public Parcelable getParcelableData() {
71214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        return mRecord.getParcelableData();
7139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the {@link Parcelable} data of the event.
7179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param parcelableData The parcelable data.
7199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
72114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
72214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#setParcelableData(Parcelable)} directly.
7239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
72414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setParcelableData(Parcelable parcelableData) {
72614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.setParcelableData(parcelableData);
7279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Return an instance back to be reused.
7319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <p>
7329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <strong>Note:</strong> You must not touch the object after calling this
7339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * function.
7349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * </p>
7359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If the record is already recycled.
73714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     *
73814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#recycle()} directly.
7399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
74014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void recycle() {
74214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas        mRecord.recycle();
7439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
74514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
74614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord#hashCode()} directly.
74714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
74814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    @Override
7509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int hashCode() {
7519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return (mRecord == null) ? 0 : mRecord.hashCode();
7529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
75414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    /**
75514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     * @deprecated Use {@link AccessibilityRecord} directly.
75614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas     */
75714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas    @Deprecated
7589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    @Override
7599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean equals(Object obj) {
7609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (this == obj) {
7619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return true;
7629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
7639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (obj == null) {
7649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
7659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
7669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (getClass() != obj.getClass()) {
7679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
7689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
7699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        AccessibilityRecordCompat other = (AccessibilityRecordCompat) obj;
7709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (mRecord == null) {
7719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            if (other.mRecord != null) {
7729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov                return false;
7739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            }
7749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        } else if (!mRecord.equals(other.mRecord)) {
7759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
7769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
7779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return true;
7789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov}
780