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; 219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.View; 224184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslavimport android.view.accessibility.AccessibilityEvent; 2314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikasimport android.view.accessibility.AccessibilityRecord; 249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 259dede51868bbbe16aadcd65e04860bea8ea50e05Aurimas Liutikasimport androidx.annotation.NonNull; 269dede51868bbbe16aadcd65e04860bea8ea50e05Aurimas Liutikas 279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport java.util.List; 289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov/** 30645e5c8aa6b31961c5f73f3d30bb5261d5e04aebKirill Grouchnikov * Helper for accessing {@link AccessibilityRecord}. 319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovpublic class AccessibilityRecordCompat { 3314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas private final AccessibilityRecord mRecord; 349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 354184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav /** 364184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav * @deprecated This is not type safe. If you want to modify an 374184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav * {@link AccessibilityEvent}'s properties defined in 384184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav * {@link android.view.accessibility.AccessibilityRecord} use 398f590dabd4e7d3fa4abfc74c91640690b63fc45aSvetoslav * {@link AccessibilityEventCompat#asRecord(AccessibilityEvent)}. This method will be removed 404184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav * in a subsequent release of the support library. 419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 42d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public AccessibilityRecordCompat(Object record) { 4414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord = (AccessibilityRecord) record; 459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The wrapped implementation. 494184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav * 504184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav * @deprecated This method will be removed in a subsequent release of 514184a5ee0959c0071eb6eb94878de9c5408d4e5eSvetoslav * the support library. 529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 53d805095048f6be52cddbd572ee343c4639ba8187Alan Viverette @Deprecated 549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public Object getImpl() { 559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return mRecord; 569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Returns a cached instance if such is available or a new one is 609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * instantiated. The instance is initialized with data from the 619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * given record. 629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return An instance. 6414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 6514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#obtain(AccessibilityRecord)} directly. 669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 6714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public static AccessibilityRecordCompat obtain(AccessibilityRecordCompat record) { 6914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return new AccessibilityRecordCompat(AccessibilityRecord.obtain(record.mRecord)); 709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Returns a cached instance if such is available or a new one is 749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * instantiated. 759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return An instance. 7714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 7814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#obtain()} directly. 799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 8014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public static AccessibilityRecordCompat obtain() { 8214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return new AccessibilityRecordCompat(AccessibilityRecord.obtain()); 839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the event source. 879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param source The source. 899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 9114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 9214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setSource(View)} directly. 939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 9414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setSource(View source) { 9614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setSource(source); 979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 1003a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * Sets the source to be a virtual descendant of the given <code>root</code>. 1013a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * If <code>virtualDescendantId</code> equals to {@link View#NO_ID} the root 1023a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * is set as the source. 1033a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * <p> 1043a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * A virtual descendant is an imaginary View that is reported as a part of the view 1053a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * hierarchy for accessibility purposes. This enables custom views that draw complex 1063a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * content to report them selves as a tree of virtual views, thus conveying their 1073a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * logical structure. 1083a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * </p> 1093a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * 1103a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * @param root The root of the virtual subtree. 1113a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov * @param virtualDescendantId The id of the virtual descendant. 11214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 11314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link #setSource(AccessibilityRecord, View, int)} instead. 1143a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov */ 11514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 1163a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov public void setSource(View root, int virtualDescendantId) { 11714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas AccessibilityRecordCompat.setSource(mRecord, root, virtualDescendantId); 11814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas } 11914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas 12014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas /** 12114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * Sets the source to be a virtual descendant of the given <code>root</code>. 12214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * If <code>virtualDescendantId</code> equals to {@link View#NO_ID} the root 12314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * is set as the source. 12414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * <p> 12514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * A virtual descendant is an imaginary View that is reported as a part of the view 12614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * hierarchy for accessibility purposes. This enables custom views that draw complex 12714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * content to report them selves as a tree of virtual views, thus conveying their 12814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * logical structure. 12914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * </p> 13014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 13114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @param record The {@link AccessibilityRecord} instance to use. 13214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @param root The root of the virtual subtree. 13314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @param virtualDescendantId The id of the virtual descendant. 13414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas */ 13514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas public static void setSource(@NonNull AccessibilityRecord record, View root, 13614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas int virtualDescendantId) { 137e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas if (Build.VERSION.SDK_INT >= 16) { 138e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas record.setSource(root, virtualDescendantId); 139e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas } 1403a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov } 1413a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov 1423a137cd495b313a047b5e800d02a925dea707fa0Svetoslav Ganov /** 1439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the {@link android.view.accessibility.AccessibilityNodeInfo} of 1449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * the event source. 1459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * <p> 1469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * <strong>Note:</strong> It is a client responsibility to recycle the 1479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * received info by calling 1489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * {@link android.view.accessibility.AccessibilityNodeInfo#recycle() 1499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances. 1509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov *</p> 1519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 1529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The info of the source. 15314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 15414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getSource()} directly. 1559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 15614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 1579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public AccessibilityNodeInfoCompat getSource() { 15814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return AccessibilityNodeInfoCompat.wrapNonNullInstance(mRecord.getSource()); 1599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 1619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 1629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the id of the window from which the event comes from. 1639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 1649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The window id. 16514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 16614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getWindowId()} directly. 1679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 16814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 1699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int getWindowId() { 17014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getWindowId(); 1719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 1739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 1749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets if the source is checked. 1759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 1769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return True if the view is checked, false otherwise. 17714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 17814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#isChecked()} directly. 1799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 18014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 1819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public boolean isChecked() { 18214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.isChecked(); 1839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 1859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 1869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets if the source is checked. 1879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 1889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param isChecked True if the view is checked, false otherwise. 1899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 1909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 19114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 19214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setChecked(boolean)} directly. 1939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 19414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 1959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setChecked(boolean isChecked) { 19614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setChecked(isChecked); 1979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 1989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 1999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 2009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets if the source is enabled. 2019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return True if the view is enabled, false otherwise. 20314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 20414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#isEnabled()} directly. 2059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 20614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 2079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public boolean isEnabled() { 20814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.isEnabled(); 2099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 2109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 2119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 2129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets if the source is enabled. 2139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param isEnabled True if the view is enabled, false otherwise. 2159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 21714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 21814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#isEnabled()} directly. 2199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 22014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 2219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setEnabled(boolean isEnabled) { 22214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setEnabled(isEnabled); 2239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 2249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 2259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 2269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets if the source is a password field. 2279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return True if the view is a password field, false otherwise. 22914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 23014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#isPassword()} directly. 2319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 23214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 2339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public boolean isPassword() { 23414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.isPassword(); 2359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 2369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 2379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 2389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets if the source is a password field. 2399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param isPassword True if the view is a password field, false otherwise. 2419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 24314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 24414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setPassword(boolean)} directly. 2459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 24614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 2479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setPassword(boolean isPassword) { 24814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setPassword(isPassword); 2499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 2509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 2519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 2529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets if the source is taking the entire screen. 2539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return True if the source is full screen, false otherwise. 25514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 25614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#isFullScreen()} directly. 2579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 25814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 2599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public boolean isFullScreen() { 26014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.isFullScreen(); 2619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 2629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 2639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 2649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets if the source is taking the entire screen. 2659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param isFullScreen True if the source is full screen, false otherwise. 2679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 26914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 27014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setFullScreen(boolean)} directly. 2719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 27214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 2739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setFullScreen(boolean isFullScreen) { 27414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setFullScreen(isFullScreen); 2759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 2769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 2779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 2789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets if the source is scrollable. 2799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return True if the source is scrollable, false otherwise. 28114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 28214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#isScrollable()} directly. 2839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 28414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 2859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public boolean isScrollable() { 28614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.isScrollable(); 2879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 2889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 2899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 2909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets if the source is scrollable. 2919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param scrollable True if the source is scrollable, false otherwise. 2939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 2949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 29514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 29614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setScrollable(boolean)} directly. 2979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 29814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 2999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setScrollable(boolean scrollable) { 30014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setScrollable(scrollable); 3019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 3029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 3039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 3049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the number of items that can be visited. 3059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The number of items. 30714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 30814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getItemCount()} directly. 3099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 31014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 3119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int getItemCount() { 31214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getItemCount(); 3139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 3149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 3159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 3169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the number of items that can be visited. 3179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param itemCount The number of items. 3199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 32114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 32214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setItemCount(int)} directly. 3239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 32414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 3259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setItemCount(int itemCount) { 32614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setItemCount(itemCount); 3279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 3289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 3299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 3309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the index of the source in the list of items the can be visited. 3319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The current item index. 33314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 33414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getCurrentItemIndex()} directly. 3359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 33614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 3379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int getCurrentItemIndex() { 33814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getCurrentItemIndex(); 3399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 3409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 3419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 3429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the index of the source in the list of items that can be visited. 3439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param currentItemIndex The current item index. 3459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 34714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 34814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setCurrentItemIndex(int)} directly. 3499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 35014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 3519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setCurrentItemIndex(int currentItemIndex) { 35214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setCurrentItemIndex(currentItemIndex); 3539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 3549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 3559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 3569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the index of the first character of the changed sequence, 3579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * or the beginning of a text selection or the index of the first 3589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * visible item when scrolling. 3599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The index of the first character or selection 3619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * start or the first visible item. 36214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 36314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getFromIndex()} directly. 3649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 36514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 3669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int getFromIndex() { 36714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getFromIndex(); 3689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 3699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 3709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 3719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the index of the first character of the changed sequence 3729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * or the beginning of a text selection or the index of the first 3739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * visible item when scrolling. 3749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param fromIndex The index of the first character or selection 3769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * start or the first visible item. 3779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 37914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 38014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setFromIndex(int)} directly. 3819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 38214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 3839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setFromIndex(int fromIndex) { 38414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setFromIndex(fromIndex); 3859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 3869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 3879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 3889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the index of text selection end or the index of the last 3899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * visible item when scrolling. 3909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 3919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The index of selection end or last item index. 39214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 39314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getToIndex()} directly. 3949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 39514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 3969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int getToIndex() { 39714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getToIndex(); 3989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 3999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 4009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 4019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the index of text selection end or the index of the last 4029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * visible item when scrolling. 4039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 4049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param toIndex The index of selection end or last item index. 40514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 40614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setToIndex(int)} directly. 4079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 40814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 4099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setToIndex(int toIndex) { 41014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setToIndex(toIndex); 4119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 4129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 4139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 4149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the scroll offset of the source left edge in pixels. 4159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 4169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The scroll. 41714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 41814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getScrollX()} directly. 4199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 42014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 4219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int getScrollX() { 42214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getScrollX(); 4239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 4249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 4259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 4269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the scroll offset of the source left edge in pixels. 4279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 4289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param scrollX The scroll. 42914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 43014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setScrollX(int)} directly. 4319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 43214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 4339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setScrollX(int scrollX) { 43414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setScrollX(scrollX); 4359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 4369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 4379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 4389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the scroll offset of the source top edge in pixels. 4399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 4409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The scroll. 44114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 44214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getScrollY()} directly. 4439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 44414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 4459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int getScrollY() { 44614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getScrollY(); 4479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 4489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 4499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 4509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the scroll offset of the source top edge in pixels. 4519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 4529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param scrollY The scroll. 45314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 45414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setScrollY(int)} directly. 4559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 45614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 4579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setScrollY(int scrollY) { 45814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setScrollY(scrollY); 4599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 4609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 461c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov /** 462c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * Gets the max scroll offset of the source left edge in pixels. 463c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * 464c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * @return The max scroll. 46514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 46614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link #getMaxScrollX(AccessibilityRecord)} instead. 467c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov */ 46814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 469c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov public int getMaxScrollX() { 47014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return AccessibilityRecordCompat.getMaxScrollX(mRecord); 471c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov } 47214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas 47314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas /** 47414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * Gets the max scroll offset of the source left edge in pixels. 47514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 47614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @param record The {@link AccessibilityRecord} instance to use. 47714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @return The max scroll. 47814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas */ 47914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas public static int getMaxScrollX(AccessibilityRecord record) { 480e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas if (Build.VERSION.SDK_INT >= 15) { 481e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas return record.getMaxScrollX(); 482e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas } else { 483e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas return 0; 484e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas } 48514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas } 48614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas 487c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov /** 488c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * Sets the max scroll offset of the source left edge in pixels. 489c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * 490c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * @param maxScrollX The max scroll. 49114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 49214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link #setMaxScrollX(AccessibilityRecord, int)} instead. 493c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov */ 49414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 495c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov public void setMaxScrollX(int maxScrollX) { 49614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas AccessibilityRecordCompat.setMaxScrollX(mRecord, maxScrollX); 49714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas } 49814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas 49914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas /** 50014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * Sets the max scroll offset of the source left edge in pixels. 50114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 50214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @param record The {@link AccessibilityRecord} instance to use. 50314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @param maxScrollX The max scroll. 50414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas */ 50514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas public static void setMaxScrollX(AccessibilityRecord record, int maxScrollX) { 506e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas if (Build.VERSION.SDK_INT >= 15) { 507e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas record.setMaxScrollX(maxScrollX); 508e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas } 509c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov } 510c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov 511c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov /** 512c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * Gets the max scroll offset of the source top edge in pixels. 513c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * 514c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * @return The max scroll. 51514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 51614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link #getMaxScrollY(AccessibilityRecord)} instead. 517c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov */ 51814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 519c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov public int getMaxScrollY() { 52014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return AccessibilityRecordCompat.getMaxScrollY(mRecord); 52114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas } 52214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas 52314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas /** 52414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * Gets the max scroll offset of the source top edge in pixels. 52514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 52614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @param record The {@link AccessibilityRecord} instance to use. 52714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @return The max scroll. 52814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas */ 52914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas public static int getMaxScrollY(AccessibilityRecord record) { 530e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas if (Build.VERSION.SDK_INT >= 15) { 531e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas return record.getMaxScrollY(); 532e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas } else { 533e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas return 0; 534e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas } 535c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov } 536c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov 537c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov /** 538c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * Sets the max scroll offset of the source top edge in pixels. 539c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * 540c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov * @param maxScrollY The max scroll. 54114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 54214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link #setMaxScrollY(AccessibilityRecord, int)} instead. 543c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov */ 54414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 545c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov public void setMaxScrollY(int maxScrollY) { 54614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas AccessibilityRecordCompat.setMaxScrollY(mRecord, maxScrollY); 54714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas } 54814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas 54914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas /** 55014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * Sets the max scroll offset of the source top edge in pixels. 55114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 55214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @param record The {@link AccessibilityRecord} instance to use. 55314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @param maxScrollY The max scroll. 55414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas */ 55514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas public static void setMaxScrollY(AccessibilityRecord record, int maxScrollY) { 556e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas if (Build.VERSION.SDK_INT >= 15) { 557e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas record.setMaxScrollY(maxScrollY); 558e3e249607f5d0604f01ad01ec3681f1831c1800cAurimas Liutikas } 559c64858f808c159a8b144d22e3168459074cdc181Svetoslav Ganov } 5609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 5619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 5629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the number of added characters. 5639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 5649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The number of added characters. 56514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 56614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getAddedCount()} directly. 5679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 56814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 5699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int getAddedCount() { 57014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getAddedCount(); 5719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 5729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 5739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 5749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the number of added characters. 5759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 5769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param addedCount The number of added characters. 5779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 5789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 57914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 58014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setAddedCount(int)} directly. 5819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 58214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 5839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setAddedCount(int addedCount) { 58414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setAddedCount(addedCount); 5859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 5869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 5879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 5889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the number of removed characters. 5899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 5909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The number of removed characters. 59114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 59214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getRemovedCount()} directly. 5939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 59414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 5959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int getRemovedCount() { 59614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getRemovedCount(); 5979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 5989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 5999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 6009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the number of removed characters. 6019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param removedCount The number of removed characters. 6039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 60514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 60614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setRemovedCount(int)} directly. 6079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 60814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 6099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setRemovedCount(int removedCount) { 61014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setRemovedCount(removedCount); 6119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 6129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 6139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 6149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the class name of the source. 6159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The class name. 61714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 61814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getClassName()} directly. 6199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 62014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 6219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public CharSequence getClassName() { 62214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getClassName(); 6239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 6249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 6259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 6269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the class name of the source. 6279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param className The lass name. 6299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 63114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 63214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setClassName(CharSequence)} directly. 6339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 63414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 6359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setClassName(CharSequence className) { 63614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setClassName(className); 6379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 6389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 6399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 6409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the text of the event. The index in the list represents the priority 6419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * of the text. Specifically, the lower the index the higher the priority. 6429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The text. 64414d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 64514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getText()} directly. 6469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 64714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 6489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public List<CharSequence> getText() { 64914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getText(); 6509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 6519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 6529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 6539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the text before a change. 6549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The text before the change. 65614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 65714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getBeforeText()} directly. 6589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 65914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 6609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public CharSequence getBeforeText() { 66114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getBeforeText(); 6629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 6639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 6649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 6659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the text before a change. 6669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param beforeText The text before the change. 6689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 67014d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 67114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setBeforeText(CharSequence)} directly. 6729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 67314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 6749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setBeforeText(CharSequence beforeText) { 67514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setBeforeText(beforeText); 6769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 6779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 6789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 6799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the description of the source. 6809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The description. 68214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 68314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getContentDescription()} directly. 6849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 68514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 6869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public CharSequence getContentDescription() { 68714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getContentDescription(); 6889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 6899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 6909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 6919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the description of the source. 6929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param contentDescription The description. 6949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 6959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 69614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 69714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setContentDescription(CharSequence)} directly. 6989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 69914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 7009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setContentDescription(CharSequence contentDescription) { 70114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setContentDescription(contentDescription); 7029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 7049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 7059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Gets the {@link Parcelable} data. 7069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 7079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @return The parcelable data. 70814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 70914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#getParcelableData()} directly. 7109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 71114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 7129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public Parcelable getParcelableData() { 71314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas return mRecord.getParcelableData(); 7149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 7169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 7179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Sets the {@link Parcelable} data of the event. 7189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 7199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @param parcelableData The parcelable data. 7209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 7219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 72214d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 72314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#setParcelableData(Parcelable)} directly. 7249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 72514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 7269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void setParcelableData(Parcelable parcelableData) { 72714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.setParcelableData(parcelableData); 7289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 7309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov /** 7319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Return an instance back to be reused. 7329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * <p> 7339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * <strong>Note:</strong> You must not touch the object after calling this 7349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * function. 7359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * </p> 7369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * 7379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * @throws IllegalStateException If the record is already recycled. 73814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * 73914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#recycle()} directly. 7409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */ 74114d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 7429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public void recycle() { 74314d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas mRecord.recycle(); 7449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 74614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas /** 74714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord#hashCode()} directly. 74814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas */ 74914d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 7509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov @Override 7519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public int hashCode() { 7529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return (mRecord == null) ? 0 : mRecord.hashCode(); 7539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov 75514d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas /** 75614d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas * @deprecated Use {@link AccessibilityRecord} directly. 75714d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas */ 75814d02ef06479168249fdfeea47bc105d05e88749Aurimas Liutikas @Deprecated 7599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov @Override 7609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov public boolean equals(Object obj) { 7619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov if (this == obj) { 7629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return true; 7639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov if (obj == null) { 7659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return false; 7669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov if (getClass() != obj.getClass()) { 7689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return false; 7699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov AccessibilityRecordCompat other = (AccessibilityRecordCompat) obj; 7719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov if (mRecord == null) { 7729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov if (other.mRecord != null) { 7739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return false; 7749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } else if (!mRecord.equals(other.mRecord)) { 7769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return false; 7779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov return true; 7799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov } 7809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov} 781