175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov/* 275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Copyright (C) 2009 The Android Open Source Project 375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Licensed under the Apache License, Version 2.0 (the "License"); 575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * you may not use this file except in compliance with the License. 675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * You may obtain a copy of the License at 775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * http://www.apache.org/licenses/LICENSE-2.0 975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 1075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Unless required by applicable law or agreed to in writing, software 1175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * distributed under the License is distributed on an "AS IS" BASIS, 1275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * See the License for the specific language governing permissions and 1475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * limitations under the License. 1575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 1675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 1775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganovpackage android.view.accessibility; 1875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 1975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganovimport android.os.Parcel; 2075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganovimport android.os.Parcelable; 2175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganovimport android.text.TextUtils; 2275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 2375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganovimport java.util.ArrayList; 24eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganovimport java.util.List; 2575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 2675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov/** 2738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <p> 2875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * This class represents accessibility events that are sent by the system when 2975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * something notable happens in the user interface. For example, when a 3075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.Button} is clicked, a {@link android.view.View} is focused, etc. 3138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 3275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 33736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * An accessibility event is fired by an individual view which populates the event with 3438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * data for its state and requests from its parent to send the event to interested 3538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * parties. The parent can optionally add an {@link AccessibilityRecord} for itself before 3638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * dispatching a similar request to its parent. A parent can also choose not to respect the 3738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * request for sending an event. The accessibility event is sent by the topmost view in the 3838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * view tree. Therefore, an {@link android.accessibilityservice.AccessibilityService} can 3938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * explore all records in an accessibility event to obtain more information about the 4038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * context in which the event was fired. 4138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 42736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * <p> 4338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * The main purpose of an accessibility event is to expose enough information for an 4438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link android.accessibilityservice.AccessibilityService} to provide meaningful feedback 4538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * to the user. Sometimes however, an accessibility service may need more contextual 4638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * information then the one in the event pay-load. In such cases the service can obtain 4738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * the event source which is an {@link AccessibilityNodeInfo} (snapshot of a View state) 4838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * which can be used for exploring the window content. Note that the privilege for accessing 4938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * an event's source, thus the window content, has to be explicitly requested. For more 5038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * details refer to {@link android.accessibilityservice.AccessibilityService}. If an 5138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * accessibility service has not requested to retrieve the window content the event will 5238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * not contain reference to its source. Also for events of type 5338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link #TYPE_NOTIFICATION_STATE_CHANGED} the source is never available. 5438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 55736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * <p> 5675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * This class represents various semantically different accessibility event 5738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * types. Each event type has an associated set of related properties. In other 5875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * words, each event type is characterized via a subset of the properties exposed 5975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * by this class. For each event type there is a corresponding constant defined 6038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * in this class. Follows a specification of the event types and their associated properties: 6138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 62e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * <div class="special reference"> 63e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * <h3>Developer Guides</h3> 64e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * <p>For more information about creating and processing AccessibilityEvents, read the 65e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * <a href="{@docRoot}guide/topics/ui/accessibility/index.html">Accessibility</a> 66e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * developer guide.</p> 67e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * </div> 6875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 6938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>VIEW TYPES</b></br> 7038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 7175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 7275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View clicked</b> - represents the event of clicking on a {@link android.view.View} 7338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * like {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc.</br> 7438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em>{@link #TYPE_VIEW_CLICKED}</br> 7538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 76a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 7782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 7838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 79a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 80a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 81a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 8282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 83a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 84a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 85a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 8682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 87d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 88d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 89d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 90d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 91d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 92d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 93d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 94d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 95d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 96d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 97a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 9838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 9975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 10075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View long clicked</b> - represents the event of long clicking on a {@link android.view.View} 10138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * like {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc </br> 10238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em>{@link #TYPE_VIEW_LONG_CLICKED}</br> 10338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 104a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 10582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 10638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 107a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 108a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 109a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 11082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 111a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 112a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 113a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 11482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 115d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 116d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 117d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 118d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 119d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 120d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 121d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 122d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 123d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 124d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 125a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 12638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 12775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 12875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View selected</b> - represents the event of selecting an item usually in 12938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * the context of an {@link android.widget.AdapterView}.</br> 13038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_SELECTED}</br> 13138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 132a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 13382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 13438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 135a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 136a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 137a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 13882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 139a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 140a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 141a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 14238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getItemCount()} - The number of selectable items of the source.</li> 143a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getCurrentItemIndex()} - The currently selected item index.</li> 14482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 145d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 146d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 147d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 148d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 149d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 150d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 151d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 152d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 153d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 154d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 155a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 15638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 15775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 15875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View focused</b> - represents the event of focusing a 15938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link android.view.View}.</br> 16038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_FOCUSED}</br> 16138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 162a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 16382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 16438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 165a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 166a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 167a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 16882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 169a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 170a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 171a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 17238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getItemCount()} - The number of focusable items on the screen.</li> 173a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getCurrentItemIndex()} - The currently focused item index.</li> 17482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 175d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 176d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 177d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 178d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 179d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 180d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 181d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 182d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 183d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 184d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 185a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 18638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 18775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 18875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View text changed</b> - represents the event of changing the text of an 18938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link android.widget.EditText}.</br> 19038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_TEXT_CHANGED}</br> 19138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 192a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 19382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 19438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 195a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 196a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 197a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 198a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getText()} - The text of the source.</li> 199a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 200a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 201a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 202a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getFromIndex()} - The text change start index.</li> 203a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getAddedCount()} - The number of added characters.</li> 204a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getRemovedCount()} - The number of removed characters.</li> 205a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getBeforeText()} - The text of the source before the change.</li> 20682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 207a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 20838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 209a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <p> 210a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <b>View text selection changed</b> - represents the event of changing the text 21138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * selection of an {@link android.widget.EditText}.</br> 21238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_TEXT_SELECTION_CHANGED} </br> 21338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 214a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 21582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 21638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 217a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 218a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 219a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 220a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getText()} - The text of the source.</li> 221a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 222a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getFromIndex()} - The selection start index.</li> 223a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getToIndex()} - The selection end index.</li> 224a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getItemCount()} - The length of the source text.</li> 22582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 22682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 22738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </ul> 22838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 2292b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * <b>View text traversed at movement granularity</b> - represents the event of traversing the 230b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * text of a view at a given granularity. For example, moving to the next word.</br> 2312b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY} </br> 232b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <em>Properties:</em></br> 233b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <ul> 234b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 235b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 236b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 237b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 238b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 2396d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getMovementGranularity()} - Sets the granularity at which a view's text 2406d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * was traversed.</li> 2416d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 2426d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getFromIndex()} - The start of the next/previous text at the specified granularity 2436d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * - inclusive.</li> 2446d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getToIndex()} - The end of the next/previous text at the specified granularity 2456d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * - exclusive.</li> 246b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 247b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 248b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 2492b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * <li>{@link #getMovementGranularity()} - Sets the granularity at which a view's text 2502b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * was traversed.</li> 2516d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getAction()} - Gets traversal action which specifies the direction.</li> 252b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * </ul> 253b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * </p> 254a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <p> 255a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <b>View scrolled</b> - represents the event of scrolling a view. If 256a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * the source is a descendant of {@link android.widget.AdapterView} the 257a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * scroll is reported in terms of visible items - the first visible item, 258a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * the last visible item, and the total items - because the the source 25982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * is unaware of its pixel size since its adapter is responsible for 260a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * creating views. In all other cases the scroll is reported as the current 261a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * scroll on the X and Y axis respectively plus the height of the source in 26238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * pixels.</br> 26338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_SCROLLED}</br> 26438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 265a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 26682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 26738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 268a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 269a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 270a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 27182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 272a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 27382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 274d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 275d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 276d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 277d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 278d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 279d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 280d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 281d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 282d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 283d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 28438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </ul> 28582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Note:</em> This event type is not dispatched to descendants though 28682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.view.View#dispatchPopulateAccessibilityEvent(AccessibilityEvent) 28782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)}, hence the event 28882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * source {@link android.view.View} and the sub-tree rooted at it will not receive 28982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * calls to {@link android.view.View#onPopulateAccessibilityEvent(AccessibilityEvent) 29082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.onPopulateAccessibilityEvent(AccessibilityEvent)}. The preferred way to add 29182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * text content to such events is by setting the 29282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.R.styleable#View_contentDescription contentDescription} of the source 29382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * view.</br> 29438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 29575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 29638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>TRANSITION TYPES</b></br> 29738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 29882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 299eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * <b>Window state changed</b> - represents the event of opening a 30075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.PopupWindow}, {@link android.view.Menu}, 30138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link android.app.Dialog}, etc.</br> 30238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_WINDOW_STATE_CHANGED}</br> 30338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 304a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 30582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 30638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 307a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 308a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 309a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 31082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 31182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 312a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 31338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 31475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 315eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * <b>Window content changed</b> - represents the event of change in the 316eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * content of a window. This change can be adding/removing view, changing 31738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * a view size, etc.</br> 31882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 31938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <p> 32038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <strong>Note:</strong> This event is fired only for the window source of the 32182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * last accessibility event different from {@link #TYPE_NOTIFICATION_STATE_CHANGED} 32238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * and its purpose is to notify clients that the content of the user interaction 32382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * window has changed.</br> 32438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_WINDOW_CONTENT_CHANGED}</br> 32538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 326a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 32782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 32838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 329a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 330a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 331a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 33238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </ul> 33382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Note:</em> This event type is not dispatched to descendants though 33482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.view.View#dispatchPopulateAccessibilityEvent(AccessibilityEvent) 33582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)}, hence the event 33682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * source {@link android.view.View} and the sub-tree rooted at it will not receive 33782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * calls to {@link android.view.View#onPopulateAccessibilityEvent(AccessibilityEvent) 33882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.onPopulateAccessibilityEvent(AccessibilityEvent)}. The preferred way to add 33982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * text content to such events is by setting the 34082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.R.styleable#View_contentDescription contentDescription} of the source 34182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * view.</br> 34282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 343eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * <p> 34438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>NOTIFICATION TYPES</b></br> 34582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 34675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 34738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>Notification state changed</b> - represents the event showing 34882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.app.Notification}.</br> 34938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_NOTIFICATION_STATE_CHANGED}</br> 35038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 351a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 35282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 353a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 354a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 355a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 35682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 357a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getParcelableData()} - The posted {@link android.app.Notification}.</li> 35882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - Text for providing more context.</li> 359a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 36082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Note:</em> This event type is not dispatched to descendants though 36182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.view.View#dispatchPopulateAccessibilityEvent(AccessibilityEvent) 36282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)}, hence the event 36382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * source {@link android.view.View} and the sub-tree rooted at it will not receive 36482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * calls to {@link android.view.View#onPopulateAccessibilityEvent(AccessibilityEvent) 36582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.onPopulateAccessibilityEvent(AccessibilityEvent)}. The preferred way to add 36682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * text content to such events is by setting the 36782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.R.styleable#View_contentDescription contentDescription} of the source 36882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * view.</br> 36982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 37082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 37182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>EXPLORATION TYPES</b></br> 37282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 37382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 37482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>View hover enter</b> - represents the event of beginning to hover 37582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * over a {@link android.view.View}. The hover may be generated via 37682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * exploring the screen by touch or via a pointing device.</br> 37782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_HOVER_ENTER}</br> 37882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Properties:</em></br> 37982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <ul> 38082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 38182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 38282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 38382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 38482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 38582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 38682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 38782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 388d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 389d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 390d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 391d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 392d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 393d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 394d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 395d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 396d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 397d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 39882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </ul> 39982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 40082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>View hover exit</b> - represents the event of stopping to hover 40182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * over a {@link android.view.View}. The hover may be generated via 40282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * exploring the screen by touch or via a pointing device.</br> 40382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_HOVER_EXIT}</br> 40482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Properties:</em></br> 40582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <ul> 40682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 40782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 40882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 40982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 41082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 41182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 41282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 41382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 414d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 415d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 416d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 417d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 418d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 419d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 420d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 421d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 422d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 423d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 42482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </ul> 42582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 42682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 42777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <b>Touch interaction start</b> - represents the event of starting a touch 42877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * interaction, which is the user starts touching the screen.</br> 42977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Type:</em> {@link #TYPE_TOUCH_INTERACTION_START}</br> 43077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Properties:</em></br> 43177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <ul> 43277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 43377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </ul> 43477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 43577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 43677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </p> 43777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <p> 43877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <b>Touch interaction end</b> - represents the event of ending a touch 43977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * interaction, which is the user stops touching the screen.</br> 44077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Type:</em> {@link #TYPE_TOUCH_INTERACTION_END}</br> 44177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Properties:</em></br> 44277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <ul> 44377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 44477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </ul> 44577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 44677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 44777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </p> 44877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <p> 44982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>Touch exploration gesture start</b> - represents the event of starting a touch 45082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * exploring gesture.</br> 45182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Type:</em> {@link #TYPE_TOUCH_EXPLORATION_GESTURE_START}</br> 45282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Properties:</em></br> 45382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <ul> 45482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 45582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </ul> 45677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 45777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 45882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 45982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 46082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>Touch exploration gesture end</b> - represents the event of ending a touch 46182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * exploring gesture.</br> 46282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Type:</em> {@link #TYPE_TOUCH_EXPLORATION_GESTURE_END}</br> 46382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Properties:</em></br> 46482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <ul> 46582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 46682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </ul> 46777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 46877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 46977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </p> 47077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <p> 47177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <b>Touch gesture detection start</b> - represents the event of starting a user 47277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * gesture detection.</br> 47377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Type:</em> {@link #TYPE_GESTURE_DETECTION_START}</br> 47477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Properties:</em></br> 47577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <ul> 47677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 47777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </ul> 47877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 47977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 48077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </p> 48177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <p> 48277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <b>Touch gesture detection end</b> - represents the event of ending a user 48377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * gesture detection.</br> 48477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Type:</em> {@link #TYPE_GESTURE_DETECTION_END}</br> 48577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Properties:</em></br> 48677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <ul> 48777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 48877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </ul> 48977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 49077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 49138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 49275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 49351ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <b>MISCELLANEOUS TYPES</b></br> 49451ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * </p> 49551ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <p> 49651ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <b>Announcement</b> - represents the event of an application making an 49751ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * announcement. Usually this announcement is related to some sort of a context 49851ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * change for which none of the events representing UI transitions is a good fit. 49951ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * For example, announcing a new page in a book.</br> 50051ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <em>Type:</em> {@link #TYPE_ANNOUNCEMENT}</br> 50151ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <em>Properties:</em></br> 50251ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <ul> 50351ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 50451ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 50551ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 50651ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 50751ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 50851ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getText()} - The text of the announcement.</li> 50951ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 51051ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * </ul> 51151ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * </p> 51251ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <p> 51375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>Security note</b> 51475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 51538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Since an event contains the text of its source privacy can be compromised by leaking 51675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * sensitive information such as passwords. To address this issue any event fired in response 51775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * to manipulation of a PASSWORD field does NOT CONTAIN the text of the password. 51882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 51975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 52075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see android.view.accessibility.AccessibilityManager 52175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see android.accessibilityservice.AccessibilityService 52238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see AccessibilityNodeInfo 52375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 524736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganovpublic final class AccessibilityEvent extends AccessibilityRecord implements Parcelable { 5258643aa0179e598e78d938c59035389054535a229Svetoslav Ganov private static final boolean DEBUG = false; 52675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 52775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 52875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Invalid selection/focus position. 52975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 53075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #getCurrentItemIndex() 53175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 53275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int INVALID_POSITION = -1; 53375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 53475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 53575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Maximum length of the text fields. 53675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 53775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #getBeforeText() 53875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #getText() 539c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov * </br> 540c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov * Note: This constant is no longer needed since there 541c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov * is no limit on the length of text that is contained 542c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov * in an accessibility event anymore. 54375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 544c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov @Deprecated 54575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int MAX_TEXT_LENGTH = 500; 54675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 54775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 54875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Represents the event of clicking on a {@link android.view.View} like 54975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc. 55075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 55175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_CLICKED = 0x00000001; 55275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 55375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 55475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Represents the event of long clicking on a {@link android.view.View} like 55575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc. 55675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 55775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_LONG_CLICKED = 0x00000002; 55875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 55975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 56075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Represents the event of selecting an item usually in the context of an 56175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.AdapterView}. 56275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 56375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_SELECTED = 0x00000004; 56475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 56575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 5664213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * Represents the event of setting input focus of a {@link android.view.View}. 56775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 56875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_FOCUSED = 0x00000008; 56975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 57075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 57175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Represents the event of changing the text of an {@link android.widget.EditText}. 57275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 57375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_TEXT_CHANGED = 0x00000010; 57475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 57575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 57638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Represents the event of opening a {@link android.widget.PopupWindow}, 57775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.view.Menu}, {@link android.app.Dialog}, etc. 57875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 57975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_WINDOW_STATE_CHANGED = 0x00000020; 58075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 58175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 58238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Represents the event showing a {@link android.app.Notification}. 58375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 58475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_NOTIFICATION_STATE_CHANGED = 0x00000040; 58575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 58675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 587736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Represents the event of a hover enter over a {@link android.view.View}. 588736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 589736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public static final int TYPE_VIEW_HOVER_ENTER = 0x00000080; 590736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 591736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 592736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Represents the event of a hover exit over a {@link android.view.View}. 593736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 594736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public static final int TYPE_VIEW_HOVER_EXIT = 0x00000100; 595736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 596736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 597736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Represents the event of starting a touch exploration gesture. 598736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 599736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public static final int TYPE_TOUCH_EXPLORATION_GESTURE_START = 0x00000200; 600736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 601736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 602736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Represents the event of ending a touch exploration gesture. 603736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 604736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public static final int TYPE_TOUCH_EXPLORATION_GESTURE_END = 0x00000400; 605736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 606736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 6074213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * Represents the event of changing the content of a window and more 6084213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * specifically the sub-tree rooted at the event's source. 609eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov */ 610eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov public static final int TYPE_WINDOW_CONTENT_CHANGED = 0x00000800; 611eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov 612eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov /** 613a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * Represents the event of scrolling a view. 614a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov */ 615a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov public static final int TYPE_VIEW_SCROLLED = 0x00001000; 616a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov 617a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov /** 618a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * Represents the event of changing the selection in an {@link android.widget.EditText}. 619a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov */ 620a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 0x00002000; 621a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov 622a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov /** 62351ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * Represents the event of an application making an announcement. 62451ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov */ 62551ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov public static final int TYPE_ANNOUNCEMENT = 0x00004000; 62651ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov 62751ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov /** 6284213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * Represents the event of gaining accessibility focus. 6294213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov */ 6304213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov public static final int TYPE_VIEW_ACCESSIBILITY_FOCUSED = 0x00008000; 6314213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov 6324213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov /** 6334213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * Represents the event of clearing accessibility focus. 6344213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov */ 6354213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 0x00010000; 6364213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov 6374213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov /** 6382b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * Represents the event of traversing the text of a view at a given movement granularity. 639b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov */ 6402b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 0x00020000; 641b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov 642b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov /** 64377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * Represents the event of beginning gesture detection. 64477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov */ 64577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov public static final int TYPE_GESTURE_DETECTION_START = 0x00040000; 64677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov 64777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov /** 64877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * Represents the event of ending gesture detection. 64977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov */ 65077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov public static final int TYPE_GESTURE_DETECTION_END = 0x00080000; 65177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov 65277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov /** 65377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * Represents the event of the user starting to touch the screen. 65477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov */ 65577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov public static final int TYPE_TOUCH_INTERACTION_START = 0x00100000; 65677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov 65777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov /** 65877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * Represents the event of the user ending to touch the screen. 65977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov */ 66077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov public static final int TYPE_TOUCH_INTERACTION_END = 0x00200000; 66177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov 66277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov /** 66375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Mask for {@link AccessibilityEvent} all types. 66475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 66575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_CLICKED 66675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_LONG_CLICKED 66775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_SELECTED 66875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_FOCUSED 66975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_TEXT_CHANGED 67075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_WINDOW_STATE_CHANGED 67175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_NOTIFICATION_STATE_CHANGED 67238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_VIEW_HOVER_ENTER 67338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_VIEW_HOVER_EXIT 67438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_TOUCH_EXPLORATION_GESTURE_START 67538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_TOUCH_EXPLORATION_GESTURE_END 67638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_WINDOW_CONTENT_CHANGED 67738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_VIEW_SCROLLED 67838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_VIEW_TEXT_SELECTION_CHANGED 67951ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * @see #TYPE_ANNOUNCEMENT 6802b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * @see #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY 68177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * @see #TYPE_GESTURE_DETECTION_START 68277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * @see #TYPE_GESTURE_DETECTION_END 68377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * @see #TYPE_TOUCH_INTERACTION_START 68477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * @see #TYPE_TOUCH_INTERACTION_END 68575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 68675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPES_ALL_MASK = 0xFFFFFFFF; 68775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 688736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private static final int MAX_POOL_SIZE = 10; 689887e1a17eb9b12448f5929791b564565b2665aabSvetoslav Ganov private static final Object sPoolLock = new Object(); 69075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov private static AccessibilityEvent sPool; 69175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov private static int sPoolSize; 69275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov private AccessibilityEvent mNext; 693736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private boolean mIsInPool; 69475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 69575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov private int mEventType; 6963fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell private CharSequence mPackageName; 697736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private long mEventTime; 6982b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov int mMovementGranularity; 6996d17a936f73976971135aa1e6248662533343292Svetoslav Ganov int mAction; 7003fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell 701736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private final ArrayList<AccessibilityRecord> mRecords = new ArrayList<AccessibilityRecord>(); 70275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 70375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /* 70475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Hide constructor from clients. 70575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 70675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov private AccessibilityEvent() { 7078643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } 70875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 7098643aa0179e598e78d938c59035389054535a229Svetoslav Ganov /** 7108643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * Initialize an event from another one. 7118643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 7128643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @param event The event to initialize from. 7138643aa0179e598e78d938c59035389054535a229Svetoslav Ganov */ 7148643aa0179e598e78d938c59035389054535a229Svetoslav Ganov void init(AccessibilityEvent event) { 7158643aa0179e598e78d938c59035389054535a229Svetoslav Ganov super.init(event); 7168643aa0179e598e78d938c59035389054535a229Svetoslav Ganov mEventType = event.mEventType; 7172b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov mMovementGranularity = event.mMovementGranularity; 7186d17a936f73976971135aa1e6248662533343292Svetoslav Ganov mAction = event.mAction; 7198643aa0179e598e78d938c59035389054535a229Svetoslav Ganov mEventTime = event.mEventTime; 7208643aa0179e598e78d938c59035389054535a229Svetoslav Ganov mPackageName = event.mPackageName; 721eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov } 722eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov 723eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov /** 724eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * Sets if this instance is sealed. 725eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * 726eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * @param sealed Whether is sealed. 727eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * 728eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * @hide 729eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov */ 730eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov @Override 731eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov public void setSealed(boolean sealed) { 732eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov super.setSealed(sealed); 733eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov List<AccessibilityRecord> records = mRecords; 734eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov final int recordCount = records.size(); 735eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov for (int i = 0; i < recordCount; i++) { 736eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov AccessibilityRecord record = records.get(i); 737eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov record.setSealed(sealed); 738eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov } 73975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 74075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 74175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 742736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Gets the number of records contained in the event. 74375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 744736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @return The number of records. 74575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 746736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public int getRecordCount() { 747736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov return mRecords.size(); 74875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 74975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 75075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 751736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Appends an {@link AccessibilityRecord} to the end of event records. 75275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 753736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param record The record to append. 7548643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 7558643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 75675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 757736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public void appendRecord(AccessibilityRecord record) { 7588643aa0179e598e78d938c59035389054535a229Svetoslav Ganov enforceNotSealed(); 759736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov mRecords.add(record); 76075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 76175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 76275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 76338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Gets the record at a given index. 76475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 765736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param index The index. 76638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @return The record at the specified index. 76775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 768736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public AccessibilityRecord getRecord(int index) { 769736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov return mRecords.get(index); 77075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 77175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 77275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 77375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Gets the event type. 77475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 77575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return The event type. 77675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 77775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public int getEventType() { 77875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return mEventType; 77975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 78075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 78175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 78275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Sets the event type. 78375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 78475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @param eventType The event type. 7858643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 7868643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 78775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 78875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void setEventType(int eventType) { 7898643aa0179e598e78d938c59035389054535a229Svetoslav Ganov enforceNotSealed(); 79075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mEventType = eventType; 79175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 79275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 79375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 79475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Gets the time in which this event was sent. 79575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 79675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return The event time. 79775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 79875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public long getEventTime() { 79975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return mEventTime; 80075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 80175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 80275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 80375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Sets the time in which this event was sent. 80475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 80575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @param eventTime The event time. 8068643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 8078643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 80875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 80975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void setEventTime(long eventTime) { 8108643aa0179e598e78d938c59035389054535a229Svetoslav Ganov enforceNotSealed(); 81175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mEventTime = eventTime; 81275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 81375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 81475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 81575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Gets the package name of the source. 81675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 81775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return The package name. 81875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 81975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public CharSequence getPackageName() { 82075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return mPackageName; 82175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 82275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 82375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 82475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Sets the package name of the source. 82575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 82675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @param packageName The package name. 8278643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 8288643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 82975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 83075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void setPackageName(CharSequence packageName) { 8318643aa0179e598e78d938c59035389054535a229Svetoslav Ganov enforceNotSealed(); 83275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mPackageName = packageName; 83375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 83475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 83575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 8362b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * Sets the movement granularity that was traversed. 837b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * 838b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * @param granularity The granularity. 839b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * 840b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 841b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov */ 8422b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov public void setMovementGranularity(int granularity) { 843b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov enforceNotSealed(); 8442b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov mMovementGranularity = granularity; 845b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov } 846b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov 847b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov /** 8482b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * Gets the movement granularity that was traversed. 849b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * 850b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * @return The granularity. 851b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov */ 8522b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov public int getMovementGranularity() { 8532b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov return mMovementGranularity; 854b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov } 855b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov 856b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov /** 8576d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * Sets the performed action that triggered this event. 8586d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * 8596d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * @param action The action. 8606d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * 8616d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 8626d17a936f73976971135aa1e6248662533343292Svetoslav Ganov */ 8636d17a936f73976971135aa1e6248662533343292Svetoslav Ganov public void setAction(int action) { 8646d17a936f73976971135aa1e6248662533343292Svetoslav Ganov enforceNotSealed(); 8656d17a936f73976971135aa1e6248662533343292Svetoslav Ganov mAction = action; 8666d17a936f73976971135aa1e6248662533343292Svetoslav Ganov } 8676d17a936f73976971135aa1e6248662533343292Svetoslav Ganov 8686d17a936f73976971135aa1e6248662533343292Svetoslav Ganov /** 8696d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * Gets the performed action that triggered this event. 8706d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * 8716d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * @return The action. 8726d17a936f73976971135aa1e6248662533343292Svetoslav Ganov */ 8736d17a936f73976971135aa1e6248662533343292Svetoslav Ganov public int getAction() { 8746d17a936f73976971135aa1e6248662533343292Svetoslav Ganov return mAction; 8756d17a936f73976971135aa1e6248662533343292Svetoslav Ganov } 8766d17a936f73976971135aa1e6248662533343292Svetoslav Ganov 8776d17a936f73976971135aa1e6248662533343292Svetoslav Ganov /** 87875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Returns a cached instance if such is available or a new one is 87938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * instantiated with its type property set. 88075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 88175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @param eventType The event type. 88275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return An instance. 88375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 88475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static AccessibilityEvent obtain(int eventType) { 88575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov AccessibilityEvent event = AccessibilityEvent.obtain(); 88675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov event.setEventType(eventType); 88775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return event; 88875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 88975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 89075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 89175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Returns a cached instance if such is available or a new one is 89235bfedeaba724aeadc6f6c890269cb6bf7ef42f5Svetoslav Ganov * created. The returned instance is initialized from the given 89335bfedeaba724aeadc6f6c890269cb6bf7ef42f5Svetoslav Ganov * <code>event</code>. 8948643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 8958643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @param event The other event. 8968643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @return An instance. 8978643aa0179e598e78d938c59035389054535a229Svetoslav Ganov */ 8988643aa0179e598e78d938c59035389054535a229Svetoslav Ganov public static AccessibilityEvent obtain(AccessibilityEvent event) { 8998643aa0179e598e78d938c59035389054535a229Svetoslav Ganov AccessibilityEvent eventClone = AccessibilityEvent.obtain(); 9008643aa0179e598e78d938c59035389054535a229Svetoslav Ganov eventClone.init(event); 9018643aa0179e598e78d938c59035389054535a229Svetoslav Ganov 9028643aa0179e598e78d938c59035389054535a229Svetoslav Ganov final int recordCount = event.mRecords.size(); 9038643aa0179e598e78d938c59035389054535a229Svetoslav Ganov for (int i = 0; i < recordCount; i++) { 9048643aa0179e598e78d938c59035389054535a229Svetoslav Ganov AccessibilityRecord record = event.mRecords.get(i); 9058643aa0179e598e78d938c59035389054535a229Svetoslav Ganov AccessibilityRecord recordClone = AccessibilityRecord.obtain(record); 9068643aa0179e598e78d938c59035389054535a229Svetoslav Ganov eventClone.mRecords.add(recordClone); 9078643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } 9088643aa0179e598e78d938c59035389054535a229Svetoslav Ganov 9098643aa0179e598e78d938c59035389054535a229Svetoslav Ganov return eventClone; 9108643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } 9118643aa0179e598e78d938c59035389054535a229Svetoslav Ganov 9128643aa0179e598e78d938c59035389054535a229Svetoslav Ganov /** 9138643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * Returns a cached instance if such is available or a new one is 91475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * instantiated. 91575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 91675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return An instance. 91775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 91875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static AccessibilityEvent obtain() { 919887e1a17eb9b12448f5929791b564565b2665aabSvetoslav Ganov synchronized (sPoolLock) { 92075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov if (sPool != null) { 92175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov AccessibilityEvent event = sPool; 92275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov sPool = sPool.mNext; 92375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov sPoolSize--; 92475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov event.mNext = null; 92575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov event.mIsInPool = false; 92675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return event; 92775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 92875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return new AccessibilityEvent(); 92975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 93075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 93175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 93275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 93338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Recycles an instance back to be reused. 93475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 93538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>Note: You must not touch the object after calling this function.</b> 93638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 937887e1a17eb9b12448f5929791b564565b2665aabSvetoslav Ganov * 938887e1a17eb9b12448f5929791b564565b2665aabSvetoslav Ganov * @throws IllegalStateException If the event is already recycled. 93975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 940736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov @Override 94175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void recycle() { 94275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov if (mIsInPool) { 943887e1a17eb9b12448f5929791b564565b2665aabSvetoslav Ganov throw new IllegalStateException("Event already recycled!"); 94475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 94575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov clear(); 946887e1a17eb9b12448f5929791b564565b2665aabSvetoslav Ganov synchronized (sPoolLock) { 94775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov if (sPoolSize <= MAX_POOL_SIZE) { 94875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mNext = sPool; 94975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov sPool = this; 95075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mIsInPool = true; 95175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov sPoolSize++; 95275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 95375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 95475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 95575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 95675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 95775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Clears the state of this instance. 9588643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 9598643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @hide 96075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 961736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov @Override 962736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov protected void clear() { 963736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov super.clear(); 96475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mEventType = 0; 9652b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov mMovementGranularity = 0; 9666d17a936f73976971135aa1e6248662533343292Svetoslav Ganov mAction = 0; 9673fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell mPackageName = null; 968736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov mEventTime = 0; 969736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov while (!mRecords.isEmpty()) { 970736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov AccessibilityRecord record = mRecords.remove(0); 971736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.recycle(); 9723fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell } 973ac84d3ba81f08036308b17e1ab919e43987a3df5Svetoslav Ganov } 974ac84d3ba81f08036308b17e1ab919e43987a3df5Svetoslav Ganov 975ac84d3ba81f08036308b17e1ab919e43987a3df5Svetoslav Ganov /** 9763fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell * Creates a new instance from a {@link Parcel}. 9773fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell * 9783fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell * @param parcel A parcel containing the state of a {@link AccessibilityEvent}. 979ac84d3ba81f08036308b17e1ab919e43987a3df5Svetoslav Ganov */ 9803fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell public void initFromParcel(Parcel parcel) { 981d116d7c78a9c53f30a73bf273bd7618312cf3847Svetoslav Ganov mSealed = (parcel.readInt() == 1); 9823fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell mEventType = parcel.readInt(); 9832b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov mMovementGranularity = parcel.readInt(); 9846d17a936f73976971135aa1e6248662533343292Svetoslav Ganov mAction = parcel.readInt(); 9853fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell mPackageName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); 986736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov mEventTime = parcel.readLong(); 987d116d7c78a9c53f30a73bf273bd7618312cf3847Svetoslav Ganov mConnectionId = parcel.readInt(); 988736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov readAccessibilityRecordFromParcel(this, parcel); 989736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 990736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov // Read the records. 991736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov final int recordCount = parcel.readInt(); 992736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov for (int i = 0; i < recordCount; i++) { 993736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov AccessibilityRecord record = AccessibilityRecord.obtain(); 99434e350daf89aed09ac748c2185f4506772a63b3fSvetoslav Ganov readAccessibilityRecordFromParcel(record, parcel); 995d116d7c78a9c53f30a73bf273bd7618312cf3847Svetoslav Ganov record.mConnectionId = mConnectionId; 996736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov mRecords.add(record); 997736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 9983fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell } 9993fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell 1000736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 1001736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Reads an {@link AccessibilityRecord} from a parcel. 1002736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * 1003736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param record The record to initialize. 1004736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param parcel The parcel to read from. 1005736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 1006736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private void readAccessibilityRecordFromParcel(AccessibilityRecord record, 1007736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov Parcel parcel) { 1008736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mBooleanProperties = parcel.readInt(); 1009736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mCurrentItemIndex = parcel.readInt(); 1010736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mItemCount = parcel.readInt(); 1011736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mFromIndex = parcel.readInt(); 1012a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov record.mToIndex = parcel.readInt(); 1013a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov record.mScrollX = parcel.readInt(); 1014a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov record.mScrollY = parcel.readInt(); 1015d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov record.mMaxScrollX = parcel.readInt(); 1016d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov record.mMaxScrollY = parcel.readInt(); 1017736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mAddedCount = parcel.readInt(); 1018736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mRemovedCount = parcel.readInt(); 1019736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mClassName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); 1020736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mContentDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); 1021736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mBeforeText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); 1022736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mParcelableData = parcel.readParcelable(null); 1023736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.readList(record.mText, null); 1024eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov record.mSourceWindowId = parcel.readInt(); 1025021078554b902179442a345a9d080a165c3b5139Svetoslav Ganov record.mSourceNodeId = parcel.readLong(); 1026eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov record.mSealed = (parcel.readInt() == 1); 1027736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 1028736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 1029736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 1030736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * {@inheritDoc} 1031736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 103275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void writeToParcel(Parcel parcel, int flags) { 10338643aa0179e598e78d938c59035389054535a229Svetoslav Ganov parcel.writeInt(isSealed() ? 1 : 0); 103475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov parcel.writeInt(mEventType); 10352b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov parcel.writeInt(mMovementGranularity); 10366d17a936f73976971135aa1e6248662533343292Svetoslav Ganov parcel.writeInt(mAction); 10373fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell TextUtils.writeToParcel(mPackageName, parcel, 0); 1038736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeLong(mEventTime); 1039d116d7c78a9c53f30a73bf273bd7618312cf3847Svetoslav Ganov parcel.writeInt(mConnectionId); 1040736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov writeAccessibilityRecordToParcel(this, parcel, flags); 1041736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 1042736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov // Write the records. 1043736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov final int recordCount = getRecordCount(); 1044736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(recordCount); 1045736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov for (int i = 0; i < recordCount; i++) { 1046736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov AccessibilityRecord record = mRecords.get(i); 1047736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov writeAccessibilityRecordToParcel(record, parcel, flags); 1048736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 1049736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 1050736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 1051736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 1052736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Writes an {@link AccessibilityRecord} to a parcel. 1053736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * 1054736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param record The record to write. 1055736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param parcel The parcel to which to write. 1056736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 1057736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private void writeAccessibilityRecordToParcel(AccessibilityRecord record, Parcel parcel, 1058736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov int flags) { 1059736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mBooleanProperties); 1060736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mCurrentItemIndex); 1061736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mItemCount); 1062736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mFromIndex); 1063a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov parcel.writeInt(record.mToIndex); 1064a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov parcel.writeInt(record.mScrollX); 1065a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov parcel.writeInt(record.mScrollY); 1066d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov parcel.writeInt(record.mMaxScrollX); 1067d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov parcel.writeInt(record.mMaxScrollY); 1068736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mAddedCount); 1069736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mRemovedCount); 1070736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov TextUtils.writeToParcel(record.mClassName, parcel, flags); 1071736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov TextUtils.writeToParcel(record.mContentDescription, parcel, flags); 1072736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov TextUtils.writeToParcel(record.mBeforeText, parcel, flags); 1073736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeParcelable(record.mParcelableData, flags); 1074736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeList(record.mText); 1075eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov parcel.writeInt(record.mSourceWindowId); 1076021078554b902179442a345a9d080a165c3b5139Svetoslav Ganov parcel.writeLong(record.mSourceNodeId); 1077eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov parcel.writeInt(record.mSealed ? 1 : 0); 107875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 107975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 1080736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 1081736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * {@inheritDoc} 1082736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 108375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public int describeContents() { 108475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return 0; 108575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 108675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 108775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov @Override 108875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public String toString() { 108975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov StringBuilder builder = new StringBuilder(); 109038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov builder.append("EventType: ").append(eventTypeToString(mEventType)); 1091cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov builder.append("; EventTime: ").append(mEventTime); 1092cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov builder.append("; PackageName: ").append(mPackageName); 10932b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov builder.append("; MovementGranularity: ").append(mMovementGranularity); 10946d17a936f73976971135aa1e6248662533343292Svetoslav Ganov builder.append("; Action: ").append(mAction); 1095736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov builder.append(super.toString()); 10968643aa0179e598e78d938c59035389054535a229Svetoslav Ganov if (DEBUG) { 1097736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov builder.append("\n"); 1098eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov builder.append("; sourceWindowId: ").append(mSourceWindowId); 1099021078554b902179442a345a9d080a165c3b5139Svetoslav Ganov builder.append("; mSourceNodeId: ").append(mSourceNodeId); 11008643aa0179e598e78d938c59035389054535a229Svetoslav Ganov for (int i = 0; i < mRecords.size(); i++) { 11018643aa0179e598e78d938c59035389054535a229Svetoslav Ganov AccessibilityRecord record = mRecords.get(i); 11028643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(" Record "); 11038643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(i); 11048643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(":"); 11058643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(" [ ClassName: " + record.mClassName); 11068643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; Text: " + record.mText); 11078643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; ContentDescription: " + record.mContentDescription); 11088643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; ItemCount: " + record.mItemCount); 11098643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; CurrentItemIndex: " + record.mCurrentItemIndex); 11108643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; IsEnabled: " + record.isEnabled()); 11118643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; IsPassword: " + record.isPassword()); 11128643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; IsChecked: " + record.isChecked()); 11138643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; IsFullScreen: " + record.isFullScreen()); 1114a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov builder.append("; Scrollable: " + record.isScrollable()); 11158643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; BeforeText: " + record.mBeforeText); 11168643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; FromIndex: " + record.mFromIndex); 1117a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov builder.append("; ToIndex: " + record.mToIndex); 1118a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov builder.append("; ScrollX: " + record.mScrollX); 1119a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov builder.append("; ScrollY: " + record.mScrollY); 11208643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; AddedCount: " + record.mAddedCount); 11218643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; RemovedCount: " + record.mRemovedCount); 11228643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; ParcelableData: " + record.mParcelableData); 11238643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(" ]"); 11248643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("\n"); 11258643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } 11268643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } else { 1127e4aa13b20166219a62916a92294055e7cc5c9f10Svetoslav Ganov builder.append("; recordCount: ").append(getRecordCount()); 1128736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 112975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return builder.toString(); 113075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 113175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 113275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 1133cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov * Returns the string representation of an event type. For example, 1134cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov * {@link #TYPE_VIEW_CLICKED} is represented by the string TYPE_VIEW_CLICKED. 1135cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov * 113638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @param eventType The event type 1137cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov * @return The string representation. 1138cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov */ 113938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov public static String eventTypeToString(int eventType) { 114038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov switch (eventType) { 1141cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_VIEW_CLICKED: 1142cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_VIEW_CLICKED"; 1143cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_VIEW_LONG_CLICKED: 1144cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_VIEW_LONG_CLICKED"; 1145cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_VIEW_SELECTED: 1146cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_VIEW_SELECTED"; 1147cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_VIEW_FOCUSED: 1148cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_VIEW_FOCUSED"; 1149cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_VIEW_TEXT_CHANGED: 1150cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_VIEW_TEXT_CHANGED"; 1151cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_WINDOW_STATE_CHANGED: 1152cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_WINDOW_STATE_CHANGED"; 1153cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_VIEW_HOVER_ENTER: 1154cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_VIEW_HOVER_ENTER"; 1155cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_VIEW_HOVER_EXIT: 1156cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_VIEW_HOVER_EXIT"; 1157cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_NOTIFICATION_STATE_CHANGED: 1158cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_NOTIFICATION_STATE_CHANGED"; 1159cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_TOUCH_EXPLORATION_GESTURE_START: 1160cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_TOUCH_EXPLORATION_GESTURE_START"; 1161cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov case TYPE_TOUCH_EXPLORATION_GESTURE_END: 1162cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return "TYPE_TOUCH_EXPLORATION_GESTURE_END"; 1163eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov case TYPE_WINDOW_CONTENT_CHANGED: 1164eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov return "TYPE_WINDOW_CONTENT_CHANGED"; 1165a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov case TYPE_VIEW_TEXT_SELECTION_CHANGED: 1166a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov return "TYPE_VIEW_TEXT_SELECTION_CHANGED"; 1167a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov case TYPE_VIEW_SCROLLED: 1168a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov return "TYPE_VIEW_SCROLLED"; 116951ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov case TYPE_ANNOUNCEMENT: 117051ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov return "TYPE_ANNOUNCEMENT"; 11714213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov case TYPE_VIEW_ACCESSIBILITY_FOCUSED: 11724213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov return "TYPE_VIEW_ACCESSIBILITY_FOCUSED"; 11734213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov case TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED: 11744213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov return "TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED"; 11752b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov case TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY: 11762b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov return "TYPE_CURRENT_AT_GRANULARITY_MOVEMENT_CHANGED"; 117777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov case TYPE_GESTURE_DETECTION_START: 117877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov return "TYPE_GESTURE_DETECTION_START"; 117977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov case TYPE_GESTURE_DETECTION_END: 118077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov return "TYPE_GESTURE_DETECTION_END"; 118177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov case TYPE_TOUCH_INTERACTION_START: 118277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov return "TYPE_TOUCH_INTERACTION_START"; 118377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov case TYPE_TOUCH_INTERACTION_END: 118477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov return "TYPE_TOUCH_INTERACTION_END"; 1185cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov default: 1186cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov return null; 1187cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov } 1188cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov } 1189cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov 1190cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov /** 119175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see Parcelable.Creator 119275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 119375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final Parcelable.Creator<AccessibilityEvent> CREATOR = 119475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov new Parcelable.Creator<AccessibilityEvent>() { 119575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public AccessibilityEvent createFromParcel(Parcel parcel) { 119675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov AccessibilityEvent event = AccessibilityEvent.obtain(); 119775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov event.initFromParcel(parcel); 119875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return event; 119975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 120075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 120175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public AccessibilityEvent[] newArray(int size) { 120275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return new AccessibilityEvent[size]; 120375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 120475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov }; 120575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov} 1206