AccessibilityRecordCompat.java revision 0574ca37da4619afe4e26753f5a1b4de314b6565
19648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov/*
29648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Copyright (C) 2011 The Android Open Source Project
39648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov *
49648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Licensed under the Apache License, Version 2.0 (the "License");
59648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * you may not use this file except in compliance with the License.
69648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * You may obtain a copy of the License at
79648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov *
89648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov *      http://www.apache.org/licenses/LICENSE-2.0
99648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov *
109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * Unless required by applicable law or agreed to in writing, software
119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * distributed under the License is distributed on an "AS IS" BASIS,
129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * See the License for the specific language governing permissions and
149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov * limitations under the License.
159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */
169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovpackage android.support.v4.view.accessibility;
189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.os.Build;
209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.os.Parcelable;
219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport android.view.View;
229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
23f9c2277244722eca88c784b9cfdcc78df7f94781Svetoslav Ganovimport java.util.Collections;
249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovimport java.util.List;
259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov/**
270574ca37da4619afe4e26753f5a1b4de314b6565Svetoslav Ganov * Helper for accessing {@link android.view.accessibility.AccessibilityRecord}
280574ca37da4619afe4e26753f5a1b4de314b6565Svetoslav Ganov * introduced after API level 4 in a backwards compatible fashion.
299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov */
309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganovpublic class AccessibilityRecordCompat {
319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    static interface AccessibilityRecordImpl {
339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Object obtain();
349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Object obtain(Object record);
359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setSource(Object record, View source);
369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Object getSource(Object record);
379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getWindowId(Object record);
389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isChecked(Object record);
399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setChecked(Object record, boolean isChecked);
409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isEnabled(Object record);
419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setEnabled(Object record, boolean isEnabled);
429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isPassword(Object record);
439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setPassword(Object record, boolean isPassword);
449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isFullScreen(Object record);
459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setFullScreen(Object record, boolean isFullScreen);
469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isScrollable(Object record);
479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setScrollable(Object record, boolean scrollable);
489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getItemCount(Object record);
499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setItemCount(Object record, int itemCount);
509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getCurrentItemIndex(Object record);
519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setCurrentItemIndex(Object record, int currentItemIndex);
529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getFromIndex(Object record);
539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setFromIndex(Object record, int fromIndex);
549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getToIndex(Object record);
559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setToIndex(Object record, int toIndex);
569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getScrollX(Object record);
579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setScrollX(Object record, int scrollX);
589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getScrollY(Object record);
599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setScrollY(Object record, int scrollY);
609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getMaxScrollX(Object record);
619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setMaxScrollX(Object record, int maxScrollX);
629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getMaxScrollY(Object record);
639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setMaxScrollY(Object record, int maxScrollY);
649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getAddedCount(Object record);
659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setAddedCount(Object record, int addedCount);
669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getRemovedCount(Object record);
679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setRemovedCount(Object record, int removedCount);
689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public CharSequence getClassName(Object record);
699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setClassName(Object record, CharSequence className);
709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public List<CharSequence> getText(Object record);
719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public CharSequence getBeforeText(Object record);
729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setBeforeText(Object record, CharSequence beforeText);
739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public CharSequence getContentDescription(Object record);
749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setContentDescription(Object record, CharSequence contentDescription);
759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Parcelable getParcelableData(Object record);
769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setParcelableData(Object record, Parcelable parcelableData);
779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void recycle(Object record);
789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    static class AccessibilityRecordStubImpl implements AccessibilityRecordImpl {
819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Object obtain() {
829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return null;
839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Object obtain(Object record) {
869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return null;
879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getAddedCount(Object record) {
909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public CharSequence getBeforeText(Object record) {
949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return null;
959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public CharSequence getClassName(Object record) {
989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return null;
999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public CharSequence getContentDescription(Object record) {
1029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return null;
1039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getCurrentItemIndex(Object record) {
1069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getFromIndex(Object record) {
1109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getItemCount(Object record) {
1149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getMaxScrollX(Object record) {
1189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getMaxScrollY(Object record) {
1229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Parcelable getParcelableData(Object record) {
1269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return null;
1279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getRemovedCount(Object record) {
1309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getScrollX(Object record) {
1349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getScrollY(Object record) {
1389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Object getSource(Object record) {
1429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return null;
1439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public List<CharSequence> getText(Object record) {
146f9c2277244722eca88c784b9cfdcc78df7f94781Svetoslav Ganov            return Collections.emptyList();
1479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getToIndex(Object record) {
1509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getWindowId(Object record) {
1549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;
1559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isChecked(Object record) {
1589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
1599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isEnabled(Object record) {
1629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
1639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isFullScreen(Object record) {
1669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
1679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isPassword(Object record) {
1709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
1719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isScrollable(Object record) {
1749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
1759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void recycle(Object record) {
1789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setAddedCount(Object record, int addedCount) {
1829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setBeforeText(Object record, CharSequence beforeText) {
1869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setChecked(Object record, boolean isChecked) {
1909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setClassName(Object record, CharSequence className) {
1949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
1969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setContentDescription(Object record, CharSequence contentDescription) {
1989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
1999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setCurrentItemIndex(Object record, int currentItemIndex) {
2029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setEnabled(Object record, boolean isEnabled) {
2069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setFromIndex(Object record, int fromIndex) {
2109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setFullScreen(Object record, boolean isFullScreen) {
2149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setItemCount(Object record, int itemCount) {
2189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setMaxScrollX(Object record, int maxScrollX) {
2229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setMaxScrollY(Object record, int maxScrollY) {
2269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setParcelableData(Object record, Parcelable parcelableData) {
2309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setPassword(Object record, boolean isPassword) {
2349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setRemovedCount(Object record, int removedCount) {
2389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setScrollX(Object record, int scrollX) {
2429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setScrollY(Object record, int scrollY) {
2469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setScrollable(Object record, boolean scrollable) {
2509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setSource(Object record, View source) {
2549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setToIndex(Object record, int toIndex) {
2589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
2619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    static class AccessibilityRecordIcsImpl implements AccessibilityRecordImpl {
2639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Object obtain() {
2649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.obtain();
2659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Object obtain(Object record) {
2689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.obtain(record);
2699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getAddedCount(Object record) {
2729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getAddedCount(record);
2739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public CharSequence getBeforeText(Object record) {
2769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getBeforeText(record);
2779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public CharSequence getClassName(Object record) {
2809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getClassName(record);
2819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public CharSequence getContentDescription(Object record) {
2849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getContentDescription(record);
2859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getCurrentItemIndex(Object record) {
2889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getCurrentItemIndex(record);
2899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getFromIndex(Object record) {
2929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getFromIndex(record);
2939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getItemCount(Object record) {
2969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getItemCount(record);
2979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
2989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
2999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getMaxScrollX(Object record) {
3009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            // TODO: Uncomment when these APIs become public
3019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;//AccessibilityRecordCompatIcs.getMaxScrollX(record);
3029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getMaxScrollY(Object record) {
3059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            // TODO: Uncomment when these APIs become public
3069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return 0;//AccessibilityRecordCompatIcs.getMaxScrollY(record);
3079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Parcelable getParcelableData(Object record) {
3109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getParcelableData(record);
3119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getRemovedCount(Object record) {
3149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getRemovedCount(record);
3159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getScrollX(Object record) {
3189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getScrollX(record);
3199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getScrollY(Object record) {
3229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getScrollY(record);
3239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public Object getSource(Object record) {
3269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getSource(record);
3279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public List<CharSequence> getText(Object record) {
3309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getText(record);
3319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getToIndex(Object record) {
3349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getToIndex(record);
3359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public int getWindowId(Object record) {
3389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.getWindowId(record);
3399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isChecked(Object record) {
3429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.isChecked(record);
3439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isEnabled(Object record) {
3469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.isEnabled(record);
3479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isFullScreen(Object record) {
3509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.isFullScreen(record);
3519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isPassword(Object record) {
3549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.isPassword(record);
3559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public boolean isScrollable(Object record) {
3589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return AccessibilityRecordCompatIcs.isScrollable(record);
3599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void recycle(Object record) {
3629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.recycle(record);
3639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setAddedCount(Object record, int addedCount) {
3669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setAddedCount(record, addedCount);
3679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setBeforeText(Object record, CharSequence beforeText) {
3709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setBeforeText(record, beforeText);
3719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setChecked(Object record, boolean isChecked) {
3749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setChecked(record, isChecked);
3759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setClassName(Object record, CharSequence className) {
3789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setClassName(record, className);
3799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setContentDescription(Object record, CharSequence contentDescription) {
3829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setContentDescription(record, contentDescription);
3839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setCurrentItemIndex(Object record, int currentItemIndex) {
3869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setCurrentItemIndex(record, currentItemIndex);
3879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setEnabled(Object record, boolean isEnabled) {
3909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setEnabled(record, isEnabled);
3919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setFromIndex(Object record, int fromIndex) {
3949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setFromIndex(record, fromIndex);
3959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
3969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
3979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setFullScreen(Object record, boolean isFullScreen) {
3989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setFullScreen(record, isFullScreen);
3999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setItemCount(Object record, int itemCount) {
4029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setItemCount(record, itemCount);
4039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setMaxScrollX(Object record, int maxScrollX) {
4069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//        TODO: Uncomment when these APIs become public
4079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//            AccessibilityRecordCompatIcs.setMaxScrollX(record, maxScrollX);
4089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setMaxScrollY(Object record, int maxScrollY) {
4119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//        TODO: Uncomment when these APIs become public
4129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//            AccessibilityRecordCompatIcs.setMaxScrollY(record, maxScrollY);
4139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setParcelableData(Object record, Parcelable parcelableData) {
4169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setParcelableData(record, parcelableData);
4179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setPassword(Object record, boolean isPassword) {
4209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setPassword(record, isPassword);
4219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setRemovedCount(Object record, int removedCount) {
4249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setRemovedCount(record, removedCount);
4259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setScrollX(Object record, int scrollX) {
4289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setScrollX(record, scrollX);
4299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setScrollY(Object record, int scrollY) {
4329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setScrollY(record, scrollY);
4339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setScrollable(Object record, boolean scrollable) {
4369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setScrollable(record, scrollable);
4379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setSource(Object record, View source) {
4409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setSource(record, source);
4419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        public void setToIndex(Object record, int toIndex) {
4449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            AccessibilityRecordCompatIcs.setToIndex(record, toIndex);
4459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    static {
4499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (Build.VERSION.SDK_INT >= 14) { // ICS
4509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            IMPL = new AccessibilityRecordIcsImpl();
4519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        } else {
4529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            IMPL = new AccessibilityRecordStubImpl();
4539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
4549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    private static final AccessibilityRecordImpl IMPL;
4579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    private final Object mRecord;
4599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /*
4619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Hide constructor from clients.
4629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
4639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public AccessibilityRecordCompat(Object record) {
4649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        mRecord = record;
4659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The wrapped implementation.
4699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
4709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public Object getImpl() {
4719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return mRecord;
4729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Returns a cached instance if such is available or a new one is
4769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * instantiated. The instance is initialized with data from the
4779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * given record.
4789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return An instance.
4809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
4819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public static AccessibilityRecordCompat obtain(AccessibilityRecordCompat record) {
4829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov       return new AccessibilityRecordCompat(IMPL.obtain(record.mRecord));
4839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Returns a cached instance if such is available or a new one is
4879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * instantiated.
4889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return An instance.
4909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
4919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public static AccessibilityRecordCompat obtain() {
4929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return new AccessibilityRecordCompat(IMPL.obtain());
4939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
4949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
4959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
4969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the event source.
4979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
4989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param source The source.
4999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
5019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setSource(View source) {
5039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setSource(mRecord, source);
5049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the {@link android.view.accessibility.AccessibilityNodeInfo} of
5089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * the event source.
5099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <p>
5109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <strong>Note:</strong> It is a client responsibility to recycle the
5119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * received info by calling
5129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * {@link android.view.accessibility.AccessibilityNodeInfo#recycle()
5139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.
5149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *</p>
5159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The info of the source.
5179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public AccessibilityNodeInfoCompat getSource() {
5199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return new AccessibilityNodeInfoCompat(IMPL.getSource(mRecord));
5209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the id of the window from which the event comes from.
5249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The window id.
5269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getWindowId() {
5289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getWindowId(mRecord);
5299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is checked.
5339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the view is checked, false otherwise.
5359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isChecked() {
5379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.isChecked(mRecord);
5389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is checked.
5429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isChecked True if the view is checked, false otherwise.
5449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
5469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setChecked(boolean isChecked) {
5489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setChecked(mRecord, isChecked);
5499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is enabled.
5539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the view is enabled, false otherwise.
5559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isEnabled() {
5579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.isEnabled(mRecord);
5589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is enabled.
5629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isEnabled True if the view is enabled, false otherwise.
5649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
5669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setEnabled(boolean isEnabled) {
5689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setEnabled(mRecord, isEnabled);
5699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is a password field.
5739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the view is a password field, false otherwise.
5759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isPassword() {
5779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.isPassword(mRecord);
5789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is a password field.
5829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isPassword True if the view is a password field, false otherwise.
5849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
5869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setPassword(boolean isPassword) {
5889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setPassword(mRecord, isPassword);
5899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
5919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
5929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is taking the entire screen.
5939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
5949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the source is full screen, false otherwise.
5959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
5969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isFullScreen() {
5979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.isFullScreen(mRecord);
5989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
5999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is taking the entire screen.
6029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param isFullScreen True if the source is full screen, false otherwise.
6049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
6069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setFullScreen(boolean isFullScreen) {
6089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setFullScreen(mRecord, isFullScreen);
6099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets if the source is scrollable.
6139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return True if the source is scrollable, false otherwise.
6159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean isScrollable() {
6179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.isScrollable(mRecord);
6189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets if the source is scrollable.
6229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param scrollable True if the source is scrollable, false otherwise.
6249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
6269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setScrollable(boolean scrollable) {
6289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setScrollable(mRecord, scrollable);
6299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the number of items that can be visited.
6339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The number of items.
6359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getItemCount() {
6379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getItemCount(mRecord);
6389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the number of items that can be visited.
6429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param itemCount The number of items.
6449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
6469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setItemCount(int itemCount) {
6489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setItemCount(mRecord, itemCount);
6499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the index of the source in the list of items the can be visited.
6539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The current item index.
6559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getCurrentItemIndex() {
6579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getCurrentItemIndex(mRecord);
6589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the index of the source in the list of items that can be visited.
6629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param currentItemIndex The current item index.
6649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
6669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setCurrentItemIndex(int currentItemIndex) {
6689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setCurrentItemIndex(mRecord, currentItemIndex);
6699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the index of the first character of the changed sequence,
6739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * or the beginning of a text selection or the index of the first
6749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
6759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The index of the first character or selection
6779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *        start or the first visible item.
6789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getFromIndex() {
6809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getFromIndex(mRecord);
6819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the index of the first character of the changed sequence
6859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * or the beginning of a text selection or the index of the first
6869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
6879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param fromIndex The index of the first character or selection
6899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *        start or the first visible item.
6909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
6919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
6929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
6939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setFromIndex(int fromIndex) {
6949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setFromIndex(mRecord, fromIndex);
6959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
6969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
6979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
6989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the index of text selection end or the index of the last
6999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
7009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The index of selection end or last item index.
7029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
7039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getToIndex() {
7049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getToIndex(mRecord);
7059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the index of text selection end or the index of the last
7099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * visible item when scrolling.
7109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param toIndex The index of selection end or last item index.
7129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
7139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setToIndex(int toIndex) {
7149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setToIndex(mRecord, toIndex);
7159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the scroll offset of the source left edge in pixels.
7199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The scroll.
7219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
7229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getScrollX() {
7239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getScrollX(mRecord);
7249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the scroll offset of the source left edge in pixels.
7289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param scrollX The scroll.
7309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
7319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setScrollX(int scrollX) {
7329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setScrollX(mRecord, scrollX);
7339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the scroll offset of the source top edge in pixels.
7379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The scroll.
7399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
7409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getScrollY() {
7419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getScrollY(mRecord);
7429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the scroll offset of the source top edge in pixels.
7469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param scrollY The scroll.
7489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
7499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setScrollY(int scrollY) {
7509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setScrollY(mRecord, scrollY);
7519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//  TODO: Uncomment when these APIs become public
7549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    /**
7559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     * Gets the max scroll offset of the source left edge in pixels.
7569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     *
7579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     * @return The max scroll.
7589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     */
7599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    public int getMaxScrollX() {
7609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//        return IMPL.getMaxScrollX(mRecord);
7619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    }
7629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    /**
7639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     * Sets the max scroll offset of the source left edge in pixels.
7649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     *
7659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     * @param maxScrollX The max scroll.
7669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     */
7679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    public void setMaxScrollX(int maxScrollX) {
7689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//        IMPL.setMaxScrollX(mRecord, maxScrollX);
7699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    }
7709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//
7719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    /**
7729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     * Gets the max scroll offset of the source top edge in pixels.
7739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     *
7749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     * @return The max scroll.
7759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     */
7769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    public int getMaxScrollY() {
7779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//        return IMPL.getMaxScrollY(mRecord);
7789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    }
7799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//
7809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    /**
7819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     * Sets the max scroll offset of the source top edge in pixels.
7829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     *
7839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     * @param maxScrollY The max scroll.
7849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//     */
7859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    public void setMaxScrollY(int maxScrollY) {
7869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//        IMPL.setMaxScrollY(mRecord, maxScrollY);
7879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov//    }
7889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the number of added characters.
7919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
7929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The number of added characters.
7939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
7949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getAddedCount() {
7959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getAddedCount(mRecord);
7969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
7979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
7989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
7999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the number of added characters.
8009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param addedCount The number of added characters.
8029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
8049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setAddedCount(int addedCount) {
8069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setAddedCount(mRecord, addedCount);
8079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
8109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the number of removed characters.
8119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The number of removed characters.
8139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int getRemovedCount() {
8159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getRemovedCount(mRecord);
8169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
8199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the number of removed characters.
8209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param removedCount The number of removed characters.
8229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
8249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setRemovedCount(int removedCount) {
8269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setRemovedCount(mRecord, removedCount);
8279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
8309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the class name of the source.
8319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The class name.
8339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public CharSequence getClassName() {
8359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getClassName(mRecord);
8369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
8399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the class name of the source.
8409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param className The lass name.
8429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
8449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setClassName(CharSequence className) {
8469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setClassName(mRecord, className);
8479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
8509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the text of the event. The index in the list represents the priority
8519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * of the text. Specifically, the lower the index the higher the priority.
8529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The text.
8549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public List<CharSequence> getText() {
8569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getText(mRecord);
8579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
8609648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the text before a change.
8619648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8629648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The text before the change.
8639648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8649648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public CharSequence getBeforeText() {
8659648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getBeforeText(mRecord);
8669648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8679648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8689648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
8699648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the text before a change.
8709648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8719648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param beforeText The text before the change.
8729648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8739648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
8749648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8759648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setBeforeText(CharSequence beforeText) {
8769648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setBeforeText(mRecord, beforeText);
8779648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8789648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8799648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
8809648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the description of the source.
8819648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8829648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The description.
8839648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8849648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public CharSequence getContentDescription() {
8859648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getContentDescription(mRecord);
8869648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8879648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8889648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
8899648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the description of the source.
8909648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8919648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param contentDescription The description.
8929648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
8939648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
8949648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
8959648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setContentDescription(CharSequence contentDescription) {
8969648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setContentDescription(mRecord, contentDescription);
8979648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
8989648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
8999648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
9009648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Gets the {@link Parcelable} data.
9019648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
9029648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @return The parcelable data.
9039648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
9049648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public Parcelable getParcelableData() {
9059648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return IMPL.getParcelableData(mRecord);
9069648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
9079648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
9089648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
9099648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Sets the {@link Parcelable} data of the event.
9109648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
9119648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @param parcelableData The parcelable data.
9129648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
9139648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If called from an AccessibilityService.
9149648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
9159648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void setParcelableData(Parcelable parcelableData) {
9169648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.setParcelableData(mRecord, parcelableData);
9179648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
9189648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
9199648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    /**
9209648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * Return an instance back to be reused.
9219648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <p>
9229648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * <strong>Note:</strong> You must not touch the object after calling this
9239648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * function.
9249648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * </p>
9259648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     *
9269648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     * @throws IllegalStateException If the record is already recycled.
9279648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov     */
9289648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public void recycle() {
9299648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        IMPL.recycle(mRecord);
9309648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
9319648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
9329648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    @Override
9339648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public int hashCode() {
9349648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return (mRecord == null) ? 0 : mRecord.hashCode();
9359648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
9369648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
9379648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov
9389648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    @Override
9399648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    public boolean equals(Object obj) {
9409648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (this == obj) {
9419648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return true;
9429648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
9439648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (obj == null) {
9449648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
9459648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
9469648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (getClass() != obj.getClass()) {
9479648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
9489648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
9499648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        AccessibilityRecordCompat other = (AccessibilityRecordCompat) obj;
9509648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        if (mRecord == null) {
9519648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            if (other.mRecord != null) {
9529648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov                return false;
9539648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            }
9549648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        } else if (!mRecord.equals(other.mRecord)) {
9559648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov            return false;
9569648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        }
9579648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov        return true;
9589648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov    }
9599648c538bac4f04145c118cc41168d1d7a536312Svetoslav Ganov}
960