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; 22f4782ec9c57a40224ac0974fce6b6fe280c829ceSvetoslav Ganovimport android.util.Pools.SynchronizedPool; 2375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 2475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganovimport java.util.ArrayList; 25eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganovimport java.util.List; 2675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 2775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov/** 2838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <p> 2975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * This class represents accessibility events that are sent by the system when 3075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * something notable happens in the user interface. For example, when a 3175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.Button} is clicked, a {@link android.view.View} is focused, etc. 3238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 3375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 34736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * An accessibility event is fired by an individual view which populates the event with 3538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * data for its state and requests from its parent to send the event to interested 3638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * parties. The parent can optionally add an {@link AccessibilityRecord} for itself before 3738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * dispatching a similar request to its parent. A parent can also choose not to respect the 3838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * request for sending an event. The accessibility event is sent by the topmost view in the 3938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * view tree. Therefore, an {@link android.accessibilityservice.AccessibilityService} can 4038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * explore all records in an accessibility event to obtain more information about the 4138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * context in which the event was fired. 4238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 43736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * <p> 4438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * The main purpose of an accessibility event is to expose enough information for an 4538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link android.accessibilityservice.AccessibilityService} to provide meaningful feedback 4638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * to the user. Sometimes however, an accessibility service may need more contextual 4738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * information then the one in the event pay-load. In such cases the service can obtain 4838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * the event source which is an {@link AccessibilityNodeInfo} (snapshot of a View state) 4938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * which can be used for exploring the window content. Note that the privilege for accessing 5038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * an event's source, thus the window content, has to be explicitly requested. For more 5138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * details refer to {@link android.accessibilityservice.AccessibilityService}. If an 5238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * accessibility service has not requested to retrieve the window content the event will 5338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * not contain reference to its source. Also for events of type 5438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link #TYPE_NOTIFICATION_STATE_CHANGED} the source is never available. 5538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 56736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * <p> 5775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * This class represents various semantically different accessibility event 5838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * types. Each event type has an associated set of related properties. In other 5975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * words, each event type is characterized via a subset of the properties exposed 6075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * by this class. For each event type there is a corresponding constant defined 6138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * in this class. Follows a specification of the event types and their associated properties: 6238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 63e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * <div class="special reference"> 64e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * <h3>Developer Guides</h3> 65e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * <p>For more information about creating and processing AccessibilityEvents, read the 66e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * <a href="{@docRoot}guide/topics/ui/accessibility/index.html">Accessibility</a> 67e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * developer guide.</p> 68e1302edd40c5cc264f842e17e3796e0a11d6f045Joe Fernandez * </div> 6975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 7038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>VIEW TYPES</b></br> 7138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 7275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 7375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View clicked</b> - represents the event of clicking on a {@link android.view.View} 7438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * like {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc.</br> 7538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em>{@link #TYPE_VIEW_CLICKED}</br> 7638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 77a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 7882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 7938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 80a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 81a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 82a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 8382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 84a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 85a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 86a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 8782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 88d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 89d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 90d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 91d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 92d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 93d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 94d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 95d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 96d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 97d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 98a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 9938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 10075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 10175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View long clicked</b> - represents the event of long clicking on a {@link android.view.View} 10238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * like {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc </br> 10338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em>{@link #TYPE_VIEW_LONG_CLICKED}</br> 10438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 105a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 10682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 10738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 108a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 109a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 110a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 11182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 112a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 113a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 114a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 11582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 116d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 117d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 118d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 119d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 120d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 121d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 122d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 123d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 124d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 125d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 126a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 12738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 12875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 12975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View selected</b> - represents the event of selecting an item usually in 13038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * the context of an {@link android.widget.AdapterView}.</br> 13138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_SELECTED}</br> 13238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 133a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 13482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 13538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 136a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 137a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 138a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 13982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 140a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 141a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 142a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 14338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getItemCount()} - The number of selectable items of the source.</li> 144a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getCurrentItemIndex()} - The currently selected item index.</li> 14582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 146d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 147d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 148d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 149d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 150d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 151d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 152d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 153d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 154d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 155d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 156a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 15738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 15875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 15975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View focused</b> - represents the event of focusing a 16038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link android.view.View}.</br> 16138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_FOCUSED}</br> 16238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 163a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 16482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 16538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 166a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 167a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 168a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 16982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 170a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 171a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 172a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 17338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getItemCount()} - The number of focusable items on the screen.</li> 174a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getCurrentItemIndex()} - The currently focused item index.</li> 17582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 176d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 177d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 178d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 179d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 180d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 181d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 182d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 183d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 184d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 185d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 186a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 18738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 18875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 18975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>View text changed</b> - represents the event of changing the text of an 19038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link android.widget.EditText}.</br> 19138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_TEXT_CHANGED}</br> 19238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 193a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 19482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 19538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 196a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 197a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 198a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 199a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getText()} - The text of the source.</li> 200a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 201a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 202a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isChecked()} - Whether the source is checked.</li> 203a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getFromIndex()} - The text change start index.</li> 204a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getAddedCount()} - The number of added characters.</li> 205a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getRemovedCount()} - The number of removed characters.</li> 206a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getBeforeText()} - The text of the source before the change.</li> 20782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 208a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 20938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 210a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <p> 211a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <b>View text selection changed</b> - represents the event of changing the text 21238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * selection of an {@link android.widget.EditText}.</br> 21338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_TEXT_SELECTION_CHANGED} </br> 21438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 215a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 21682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 21738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 218a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 219a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 220a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 221a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getText()} - The text of the source.</li> 222a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 223a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getFromIndex()} - The selection start index.</li> 224a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getToIndex()} - The selection end index.</li> 225a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getItemCount()} - The length of the source text.</li> 22682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 22782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 22838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </ul> 22938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 2302b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * <b>View text traversed at movement granularity</b> - represents the event of traversing the 231b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * text of a view at a given granularity. For example, moving to the next word.</br> 2322b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY} </br> 233b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <em>Properties:</em></br> 234b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <ul> 235b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 236b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 237b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 238b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 239b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 2406d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getMovementGranularity()} - Sets the granularity at which a view's text 2416d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * was traversed.</li> 2426d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 2436d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getFromIndex()} - The start of the next/previous text at the specified granularity 2446d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * - inclusive.</li> 2456d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getToIndex()} - The end of the next/previous text at the specified granularity 2466d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * - exclusive.</li> 247b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #isPassword()} - Whether the source is password.</li> 248b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 249b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 2502b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * <li>{@link #getMovementGranularity()} - Sets the granularity at which a view's text 2512b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * was traversed.</li> 2526d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * <li>{@link #getAction()} - Gets traversal action which specifies the direction.</li> 253b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * </ul> 254b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * </p> 255a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <p> 256a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <b>View scrolled</b> - represents the event of scrolling a view. If 257a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * the source is a descendant of {@link android.widget.AdapterView} the 258a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * scroll is reported in terms of visible items - the first visible item, 259a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * the last visible item, and the total items - because the the source 26082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * is unaware of its pixel size since its adapter is responsible for 261a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * creating views. In all other cases the scroll is reported as the current 262a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * scroll on the X and Y axis respectively plus the height of the source in 26338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * pixels.</br> 26438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_SCROLLED}</br> 26538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 266a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 26782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 26838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 269a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 270a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 271a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 27282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 273a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 27482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 275d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 276d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 277d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 278d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 279d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 280d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 281d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 282d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 283d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 284d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 28538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </ul> 28682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Note:</em> This event type is not dispatched to descendants though 28782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.view.View#dispatchPopulateAccessibilityEvent(AccessibilityEvent) 28882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)}, hence the event 28982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * source {@link android.view.View} and the sub-tree rooted at it will not receive 29082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * calls to {@link android.view.View#onPopulateAccessibilityEvent(AccessibilityEvent) 29182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.onPopulateAccessibilityEvent(AccessibilityEvent)}. The preferred way to add 29282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * text content to such events is by setting the 29382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.R.styleable#View_contentDescription contentDescription} of the source 29482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * view.</br> 29538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 29675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 29738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>TRANSITION TYPES</b></br> 29838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 29982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 300eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * <b>Window state changed</b> - represents the event of opening a 30175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.PopupWindow}, {@link android.view.Menu}, 30238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * {@link android.app.Dialog}, etc.</br> 30338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_WINDOW_STATE_CHANGED}</br> 30438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 305a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 30682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 30738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 308a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 309a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 310a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 31182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 31282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 313a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 31438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 31575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 316eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * <b>Window content changed</b> - represents the event of change in the 317eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * content of a window. This change can be adding/removing view, changing 31838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * a view size, etc.</br> 31982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 32038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <p> 32138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <strong>Note:</strong> This event is fired only for the window source of the 32282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * last accessibility event different from {@link #TYPE_NOTIFICATION_STATE_CHANGED} 32338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * and its purpose is to notify clients that the content of the user interaction 32482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * window has changed.</br> 32538e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_WINDOW_CONTENT_CHANGED}</br> 32638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 327a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 32882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 32977e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <li>{@link #getContentChangeTypes()} - The type of content changes.</li> 33038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 331a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 332a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 333a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 33438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </ul> 33582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Note:</em> This event type is not dispatched to descendants though 33682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.view.View#dispatchPopulateAccessibilityEvent(AccessibilityEvent) 33782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)}, hence the event 33882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * source {@link android.view.View} and the sub-tree rooted at it will not receive 33982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * calls to {@link android.view.View#onPopulateAccessibilityEvent(AccessibilityEvent) 34082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.onPopulateAccessibilityEvent(AccessibilityEvent)}. The preferred way to add 34182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * text content to such events is by setting the 34282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.R.styleable#View_contentDescription contentDescription} of the source 34382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * view.</br> 34482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 345eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * <p> 34638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>NOTIFICATION TYPES</b></br> 34782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 34875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 34938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>Notification state changed</b> - represents the event showing 35082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.app.Notification}.</br> 35138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Type:</em> {@link #TYPE_NOTIFICATION_STATE_CHANGED}</br> 35238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <em>Properties:</em></br> 353a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <ul> 35482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 355a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 356a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 357a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 35882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 359a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * <li>{@link #getParcelableData()} - The posted {@link android.app.Notification}.</li> 36082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - Text for providing more context.</li> 361a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * </ul> 36282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Note:</em> This event type is not dispatched to descendants though 36382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.view.View#dispatchPopulateAccessibilityEvent(AccessibilityEvent) 36482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)}, hence the event 36582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * source {@link android.view.View} and the sub-tree rooted at it will not receive 36682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * calls to {@link android.view.View#onPopulateAccessibilityEvent(AccessibilityEvent) 36782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * View.onPopulateAccessibilityEvent(AccessibilityEvent)}. The preferred way to add 36882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * text content to such events is by setting the 36982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * {@link android.R.styleable#View_contentDescription contentDescription} of the source 37082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * view.</br> 37182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 37282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 37382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>EXPLORATION TYPES</b></br> 37482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 37582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 37682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>View hover enter</b> - represents the event of beginning to hover 37782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * over a {@link android.view.View}. The hover may be generated via 37882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * exploring the screen by touch or via a pointing device.</br> 37982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_HOVER_ENTER}</br> 38082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Properties:</em></br> 38182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <ul> 38282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 38382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 38482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 38582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 38682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 38782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 38882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 38982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 390d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 391d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 392d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 393d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 394d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 395d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 396d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 397d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 398d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 399d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 40082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </ul> 40182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 40282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>View hover exit</b> - represents the event of stopping to hover 40382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * over a {@link android.view.View}. The hover may be generated via 40482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * exploring the screen by touch or via a pointing device.</br> 40582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Type:</em> {@link #TYPE_VIEW_HOVER_EXIT}</br> 40682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Properties:</em></br> 40782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <ul> 40882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 40982e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 41082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 41182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 41282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 41382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getText()} - The text of the source's sub-tree.</li> 41482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 41582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getContentDescription()} - The content description of the source.</li> 416d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollX()} - The offset of the source left edge in pixels 417d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 418d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getScrollY()} - The offset of the source top edge in pixels 419d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (without descendants of AdapterView).</li> 420d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getFromIndex()} - The zero based index of the first visible item of the source, 421d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 422d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getToIndex()} - The zero based index of the last visible item of the source, 423d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * inclusive (for descendants of AdapterView).</li> 424d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * <li>{@link #getItemCount()} - The total items of the source 425d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov * (for descendants of AdapterView).</li> 42682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </ul> 42782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 42882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 42977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <b>Touch interaction start</b> - represents the event of starting a touch 43077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * interaction, which is the user starts touching the screen.</br> 43177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Type:</em> {@link #TYPE_TOUCH_INTERACTION_START}</br> 43277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Properties:</em></br> 43377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <ul> 43477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 43577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </ul> 43677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 43777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 43877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </p> 43977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <p> 44077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <b>Touch interaction end</b> - represents the event of ending a touch 44177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * interaction, which is the user stops touching the screen.</br> 44277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Type:</em> {@link #TYPE_TOUCH_INTERACTION_END}</br> 44377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Properties:</em></br> 44477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <ul> 44577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 44677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </ul> 44777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 44877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 44977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </p> 45077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <p> 45182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>Touch exploration gesture start</b> - represents the event of starting a touch 45282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * exploring gesture.</br> 45382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Type:</em> {@link #TYPE_TOUCH_EXPLORATION_GESTURE_START}</br> 45482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Properties:</em></br> 45582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <ul> 45682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 45782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </ul> 45877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 45977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 46082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 46182e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <p> 46282e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <b>Touch exploration gesture end</b> - represents the event of ending a touch 46382e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * exploring gesture.</br> 46482e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Type:</em> {@link #TYPE_TOUCH_EXPLORATION_GESTURE_END}</br> 46582e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <em>Properties:</em></br> 46682e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <ul> 46782e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 46882e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </ul> 46977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 47077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 47177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </p> 47277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <p> 47377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <b>Touch gesture detection start</b> - represents the event of starting a user 47477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * gesture detection.</br> 47577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Type:</em> {@link #TYPE_GESTURE_DETECTION_START}</br> 47677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Properties:</em></br> 47777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <ul> 47877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 47977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </ul> 48077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 48177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 48277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </p> 48377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <p> 48477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <b>Touch gesture detection end</b> - represents the event of ending a user 48577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * gesture detection.</br> 48677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Type:</em> {@link #TYPE_GESTURE_DETECTION_END}</br> 48777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Properties:</em></br> 48877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <ul> 48977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 49077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * </ul> 49177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * <em>Note:</em> This event is fired only by the system and is not passed to the 49277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * view tree to be populated.</br> 49338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 49475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 49551ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <b>MISCELLANEOUS TYPES</b></br> 49651ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * </p> 49751ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <p> 49851ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <b>Announcement</b> - represents the event of an application making an 49951ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * announcement. Usually this announcement is related to some sort of a context 50051ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * change for which none of the events representing UI transitions is a good fit. 50151ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * For example, announcing a new page in a book.</br> 50251ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <em>Type:</em> {@link #TYPE_ANNOUNCEMENT}</br> 50351ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <em>Properties:</em></br> 50451ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <ul> 50551ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getEventType()} - The type of the event.</li> 50651ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getSource()} - The source info (for registered clients).</li> 50751ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getClassName()} - The class name of the source.</li> 50851ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getPackageName()} - The package name of the source.</li> 50951ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getEventTime()} - The event time.</li> 51051ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #getText()} - The text of the announcement.</li> 51151ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <li>{@link #isEnabled()} - Whether the source is enabled.</li> 51251ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * </ul> 51351ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * </p> 51451ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * <p> 51575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <b>Security note</b> 51675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 51738e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Since an event contains the text of its source privacy can be compromised by leaking 51875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * sensitive information such as passwords. To address this issue any event fired in response 51975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * to manipulation of a PASSWORD field does NOT CONTAIN the text of the password. 52082e236d72ac197d6673d0b4d484fe5f0b9436731Svetoslav Ganov * </p> 52175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 52275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see android.view.accessibility.AccessibilityManager 52375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see android.accessibilityservice.AccessibilityService 52438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see AccessibilityNodeInfo 52575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 526736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganovpublic final class AccessibilityEvent extends AccessibilityRecord implements Parcelable { 5278643aa0179e598e78d938c59035389054535a229Svetoslav Ganov private static final boolean DEBUG = false; 52875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 52975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 53075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Invalid selection/focus position. 53175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 53275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #getCurrentItemIndex() 53375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 53475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int INVALID_POSITION = -1; 53575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 53675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 53775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Maximum length of the text fields. 53875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 53975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #getBeforeText() 54075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #getText() 541c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov * </br> 542c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov * Note: This constant is no longer needed since there 543c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov * is no limit on the length of text that is contained 544c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov * in an accessibility event anymore. 54575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 546c0a8cd10a5829bf4e94ee073ba6f553128e9d8e9Svetoslav Ganov @Deprecated 54775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int MAX_TEXT_LENGTH = 500; 54875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 54975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 55075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Represents the event of clicking on a {@link android.view.View} like 55175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc. 55275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 55375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_CLICKED = 0x00000001; 55475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 55575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 55675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Represents the event of long clicking on a {@link android.view.View} like 55775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.Button}, {@link android.widget.CompoundButton}, etc. 55875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 55975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_LONG_CLICKED = 0x00000002; 56075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 56175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 56275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Represents the event of selecting an item usually in the context of an 56375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.widget.AdapterView}. 56475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 56575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_SELECTED = 0x00000004; 56675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 56775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 5684213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * Represents the event of setting input focus of a {@link android.view.View}. 56975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 57075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_FOCUSED = 0x00000008; 57175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 57275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 57375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Represents the event of changing the text of an {@link android.widget.EditText}. 57475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 57575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_VIEW_TEXT_CHANGED = 0x00000010; 57675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 57775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 57838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Represents the event of opening a {@link android.widget.PopupWindow}, 57975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * {@link android.view.Menu}, {@link android.app.Dialog}, etc. 58075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 58175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_WINDOW_STATE_CHANGED = 0x00000020; 58275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 58375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 58438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Represents the event showing a {@link android.app.Notification}. 58575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 58675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPE_NOTIFICATION_STATE_CHANGED = 0x00000040; 58775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 58875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 589736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Represents the event of a hover enter over a {@link android.view.View}. 590736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 591736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public static final int TYPE_VIEW_HOVER_ENTER = 0x00000080; 592736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 593736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 594736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Represents the event of a hover exit over a {@link android.view.View}. 595736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 596736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public static final int TYPE_VIEW_HOVER_EXIT = 0x00000100; 597736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 598736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 599736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Represents the event of starting a touch exploration gesture. 600736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 601736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public static final int TYPE_TOUCH_EXPLORATION_GESTURE_START = 0x00000200; 602736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 603736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 604736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Represents the event of ending a touch exploration gesture. 605736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 606736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public static final int TYPE_TOUCH_EXPLORATION_GESTURE_END = 0x00000400; 607736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 608736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 6094213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * Represents the event of changing the content of a window and more 6104213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * specifically the sub-tree rooted at the event's source. 611eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov */ 612eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov public static final int TYPE_WINDOW_CONTENT_CHANGED = 0x00000800; 613eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov 614eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov /** 615a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * Represents the event of scrolling a view. 616a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov */ 617a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov public static final int TYPE_VIEW_SCROLLED = 0x00001000; 618a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov 619a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov /** 620a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov * Represents the event of changing the selection in an {@link android.widget.EditText}. 621a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov */ 622a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 0x00002000; 623a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov 624a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov /** 62551ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * Represents the event of an application making an announcement. 62651ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov */ 62751ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov public static final int TYPE_ANNOUNCEMENT = 0x00004000; 62851ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov 62951ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov /** 6304213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * Represents the event of gaining accessibility focus. 6314213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov */ 6324213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov public static final int TYPE_VIEW_ACCESSIBILITY_FOCUSED = 0x00008000; 6334213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov 6344213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov /** 6354213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov * Represents the event of clearing accessibility focus. 6364213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov */ 6374213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 0x00010000; 6384213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov 6394213804541a8b05cd0587b138a2fd9a3b7fd9350Svetoslav Ganov /** 6402b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * Represents the event of traversing the text of a view at a given movement granularity. 641b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov */ 6422b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 0x00020000; 643b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov 644b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov /** 64577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * Represents the event of beginning gesture detection. 64677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov */ 64777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov public static final int TYPE_GESTURE_DETECTION_START = 0x00040000; 64877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov 64977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov /** 65077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * Represents the event of ending gesture detection. 65177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov */ 65277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov public static final int TYPE_GESTURE_DETECTION_END = 0x00080000; 65377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov 65477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov /** 65577276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * Represents the event of the user starting to touch the screen. 65677276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov */ 65777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov public static final int TYPE_TOUCH_INTERACTION_START = 0x00100000; 65877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov 65977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov /** 66077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * Represents the event of the user ending to touch the screen. 66177276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov */ 66277276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov public static final int TYPE_TOUCH_INTERACTION_END = 0x00200000; 66377276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov 66477276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov /** 6656254f4806dd3db53b7380e77fbb183065685573eSvetoslav * Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event: 66677e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * The type of change is not defined. 6676254f4806dd3db53b7380e77fbb183065685573eSvetoslav */ 66877e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette public static final int CONTENT_CHANGE_TYPE_UNDEFINED = 0x00000000; 6696254f4806dd3db53b7380e77fbb183065685573eSvetoslav 6706254f4806dd3db53b7380e77fbb183065685573eSvetoslav /** 6716254f4806dd3db53b7380e77fbb183065685573eSvetoslav * Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event: 67277e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * A node in the subtree rooted at the source node was added or removed. 6736254f4806dd3db53b7380e77fbb183065685573eSvetoslav */ 67477e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette public static final int CONTENT_CHANGE_TYPE_SUBTREE = 0x00000001; 67577e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette 67677e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette /** 67777e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event: 67877e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * The node's text changed. 67977e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette */ 68077e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette public static final int CONTENT_CHANGE_TYPE_TEXT = 0x00000002; 68177e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette 68277e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette /** 68377e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event: 68477e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * The node's content description changed. 68577e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette */ 68677e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette public static final int CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION = 0x00000004; 6876254f4806dd3db53b7380e77fbb183065685573eSvetoslav 6886254f4806dd3db53b7380e77fbb183065685573eSvetoslav /** 68975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Mask for {@link AccessibilityEvent} all types. 69075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 69175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_CLICKED 69275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_LONG_CLICKED 69375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_SELECTED 69475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_FOCUSED 69575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_VIEW_TEXT_CHANGED 69675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_WINDOW_STATE_CHANGED 69775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see #TYPE_NOTIFICATION_STATE_CHANGED 69838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_VIEW_HOVER_ENTER 69938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_VIEW_HOVER_EXIT 70038e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_TOUCH_EXPLORATION_GESTURE_START 70138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_TOUCH_EXPLORATION_GESTURE_END 70238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_WINDOW_CONTENT_CHANGED 70338e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_VIEW_SCROLLED 70438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @see #TYPE_VIEW_TEXT_SELECTION_CHANGED 70551ab90cab1609cf0ddd2dfe5a660f020d823d4d5Svetoslav Ganov * @see #TYPE_ANNOUNCEMENT 7062b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * @see #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY 70777276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * @see #TYPE_GESTURE_DETECTION_START 70877276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * @see #TYPE_GESTURE_DETECTION_END 70977276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * @see #TYPE_TOUCH_INTERACTION_START 71077276b60851a158ad3e142cb3b091d57ae5ceffbSvetoslav Ganov * @see #TYPE_TOUCH_INTERACTION_END 71175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 71275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final int TYPES_ALL_MASK = 0xFFFFFFFF; 71375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 714736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private static final int MAX_POOL_SIZE = 10; 715f4782ec9c57a40224ac0974fce6b6fe280c829ceSvetoslav Ganov private static final SynchronizedPool<AccessibilityEvent> sPool = 716f4782ec9c57a40224ac0974fce6b6fe280c829ceSvetoslav Ganov new SynchronizedPool<AccessibilityEvent>(MAX_POOL_SIZE); 71775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 71875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov private int mEventType; 7193fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell private CharSequence mPackageName; 720736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private long mEventTime; 7212b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov int mMovementGranularity; 7226d17a936f73976971135aa1e6248662533343292Svetoslav Ganov int mAction; 72377e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette int mContentChangeTypes; 7243fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell 725736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private final ArrayList<AccessibilityRecord> mRecords = new ArrayList<AccessibilityRecord>(); 72675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 72775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /* 72875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Hide constructor from clients. 72975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 73075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov private AccessibilityEvent() { 7318643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } 73275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 7338643aa0179e598e78d938c59035389054535a229Svetoslav Ganov /** 7348643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * Initialize an event from another one. 7358643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 7368643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @param event The event to initialize from. 7378643aa0179e598e78d938c59035389054535a229Svetoslav Ganov */ 7388643aa0179e598e78d938c59035389054535a229Svetoslav Ganov void init(AccessibilityEvent event) { 7398643aa0179e598e78d938c59035389054535a229Svetoslav Ganov super.init(event); 7408643aa0179e598e78d938c59035389054535a229Svetoslav Ganov mEventType = event.mEventType; 7412b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov mMovementGranularity = event.mMovementGranularity; 7426d17a936f73976971135aa1e6248662533343292Svetoslav Ganov mAction = event.mAction; 74377e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette mContentChangeTypes = event.mContentChangeTypes; 7448643aa0179e598e78d938c59035389054535a229Svetoslav Ganov mEventTime = event.mEventTime; 7458643aa0179e598e78d938c59035389054535a229Svetoslav Ganov mPackageName = event.mPackageName; 746eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov } 747eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov 748eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov /** 749eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * Sets if this instance is sealed. 750eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * 751eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * @param sealed Whether is sealed. 752eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * 753eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov * @hide 754eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov */ 755eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov @Override 756eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov public void setSealed(boolean sealed) { 757eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov super.setSealed(sealed); 758eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov List<AccessibilityRecord> records = mRecords; 759eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov final int recordCount = records.size(); 760eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov for (int i = 0; i < recordCount; i++) { 761eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov AccessibilityRecord record = records.get(i); 762eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov record.setSealed(sealed); 763eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov } 76475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 76575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 76675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 767736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Gets the number of records contained in the event. 76875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 769736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @return The number of records. 77075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 771736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public int getRecordCount() { 772736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov return mRecords.size(); 77375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 77475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 77575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 776736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Appends an {@link AccessibilityRecord} to the end of event records. 77775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 778736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param record The record to append. 7798643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 7808643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 78175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 782736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public void appendRecord(AccessibilityRecord record) { 7838643aa0179e598e78d938c59035389054535a229Svetoslav Ganov enforceNotSealed(); 784736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov mRecords.add(record); 78575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 78675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 78775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 78838e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Gets the record at a given index. 78975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 790736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param index The index. 79138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @return The record at the specified index. 79275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 793736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov public AccessibilityRecord getRecord(int index) { 794736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov return mRecords.get(index); 79575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 79675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 79775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 79875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Gets the event type. 79975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 80075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return The event type. 80175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 80275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public int getEventType() { 80375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return mEventType; 80475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 80575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 80675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 80777e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * Gets the bit mask of change types signaled by an 80877e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * {@link #TYPE_WINDOW_CONTENT_CHANGED} event. A single event may represent 80977e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * multiple change types. 8106254f4806dd3db53b7380e77fbb183065685573eSvetoslav * 81177e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * @return The bit mask of change types. One or more of: 81277e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <ul> 81377e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION} 81477e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_SUBTREE} 81577e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_TEXT} 81677e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * <li>{@link AccessibilityEvent#CONTENT_CHANGE_TYPE_UNDEFINED} 81777e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * </ul> 8186254f4806dd3db53b7380e77fbb183065685573eSvetoslav */ 81977e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette public int getContentChangeTypes() { 82077e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette return mContentChangeTypes; 8216254f4806dd3db53b7380e77fbb183065685573eSvetoslav } 8226254f4806dd3db53b7380e77fbb183065685573eSvetoslav 8236254f4806dd3db53b7380e77fbb183065685573eSvetoslav /** 82477e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * Sets the bit mask of node tree changes signaled by an 8256254f4806dd3db53b7380e77fbb183065685573eSvetoslav * {@link #TYPE_WINDOW_CONTENT_CHANGED} event. 8266254f4806dd3db53b7380e77fbb183065685573eSvetoslav * 82777e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * @param changeTypes The bit mask of change types. 82877e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * @throws IllegalStateException If called from an AccessibilityService. 82977e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette * @see #getContentChangeTypes() 8306254f4806dd3db53b7380e77fbb183065685573eSvetoslav */ 83177e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette public void setContentChangeTypes(int changeTypes) { 8326254f4806dd3db53b7380e77fbb183065685573eSvetoslav enforceNotSealed(); 83377e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette mContentChangeTypes = changeTypes; 8346254f4806dd3db53b7380e77fbb183065685573eSvetoslav } 8356254f4806dd3db53b7380e77fbb183065685573eSvetoslav 8366254f4806dd3db53b7380e77fbb183065685573eSvetoslav /** 83775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Sets the event type. 83875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 83975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @param eventType The event type. 8408643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 8418643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 84275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 84375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void setEventType(int eventType) { 8448643aa0179e598e78d938c59035389054535a229Svetoslav Ganov enforceNotSealed(); 84575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mEventType = eventType; 84675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 84775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 84875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 84975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Gets the time in which this event was sent. 85075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 85175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return The event time. 85275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 85375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public long getEventTime() { 85475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return mEventTime; 85575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 85675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 85775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 85875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Sets the time in which this event was sent. 85975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 86075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @param eventTime The event time. 8618643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 8628643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 86375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 86475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void setEventTime(long eventTime) { 8658643aa0179e598e78d938c59035389054535a229Svetoslav Ganov enforceNotSealed(); 86675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mEventTime = eventTime; 86775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 86875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 86975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 87075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Gets the package name of the source. 87175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 87275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return The package name. 87375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 87475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public CharSequence getPackageName() { 87575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return mPackageName; 87675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 87775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 87875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 87975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Sets the package name of the source. 88075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 88175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @param packageName The package name. 8828643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 8838643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 88475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 88575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void setPackageName(CharSequence packageName) { 8868643aa0179e598e78d938c59035389054535a229Svetoslav Ganov enforceNotSealed(); 88775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mPackageName = packageName; 88875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 88975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 89075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 8912b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * Sets the movement granularity that was traversed. 892b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * 893b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * @param granularity The granularity. 894b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * 895b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 896b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov */ 8972b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov public void setMovementGranularity(int granularity) { 898b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov enforceNotSealed(); 8992b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov mMovementGranularity = granularity; 900b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov } 901b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov 902b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov /** 9032b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov * Gets the movement granularity that was traversed. 904b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * 905b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov * @return The granularity. 906b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov */ 9072b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov public int getMovementGranularity() { 9082b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov return mMovementGranularity; 909b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov } 910b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov 911b7ff3255c6d4e12f9d2334e3bbec0a125b7b09dcSvetoslav Ganov /** 9126d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * Sets the performed action that triggered this event. 913af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * <p> 914af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * Valid actions are defined in {@link AccessibilityNodeInfo}: 915af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * <ul> 916af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * <li>{@link AccessibilityNodeInfo#ACTION_ACCESSIBILITY_FOCUS} 917af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * <li>{@link AccessibilityNodeInfo#ACTION_CLEAR_ACCESSIBILITY_FOCUS} 918af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * <li>{@link AccessibilityNodeInfo#ACTION_CLEAR_FOCUS} 919af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * <li>{@link AccessibilityNodeInfo#ACTION_CLEAR_SELECTION} 920af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * <li>{@link AccessibilityNodeInfo#ACTION_CLICK} 921af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * <li>etc. 922af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * </ul> 9236d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * 9246d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * @param action The action. 9256d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * @throws IllegalStateException If called from an AccessibilityService. 926af43110c020a9557233a64c08cede07bb37fe440Alan Viverette * @see AccessibilityNodeInfo#performAction(int) 9276d17a936f73976971135aa1e6248662533343292Svetoslav Ganov */ 9286d17a936f73976971135aa1e6248662533343292Svetoslav Ganov public void setAction(int action) { 9296d17a936f73976971135aa1e6248662533343292Svetoslav Ganov enforceNotSealed(); 9306d17a936f73976971135aa1e6248662533343292Svetoslav Ganov mAction = action; 9316d17a936f73976971135aa1e6248662533343292Svetoslav Ganov } 9326d17a936f73976971135aa1e6248662533343292Svetoslav Ganov 9336d17a936f73976971135aa1e6248662533343292Svetoslav Ganov /** 9346d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * Gets the performed action that triggered this event. 9356d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * 9366d17a936f73976971135aa1e6248662533343292Svetoslav Ganov * @return The action. 9376d17a936f73976971135aa1e6248662533343292Svetoslav Ganov */ 9386d17a936f73976971135aa1e6248662533343292Svetoslav Ganov public int getAction() { 9396d17a936f73976971135aa1e6248662533343292Svetoslav Ganov return mAction; 9406d17a936f73976971135aa1e6248662533343292Svetoslav Ganov } 9416d17a936f73976971135aa1e6248662533343292Svetoslav Ganov 9426d17a936f73976971135aa1e6248662533343292Svetoslav Ganov /** 94375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Returns a cached instance if such is available or a new one is 94438e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * instantiated with its type property set. 94575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 94675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @param eventType The event type. 94775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return An instance. 94875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 94975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static AccessibilityEvent obtain(int eventType) { 95075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov AccessibilityEvent event = AccessibilityEvent.obtain(); 95175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov event.setEventType(eventType); 95275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return event; 95375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 95475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 95575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 95675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Returns a cached instance if such is available or a new one is 95735bfedeaba724aeadc6f6c890269cb6bf7ef42f5Svetoslav Ganov * created. The returned instance is initialized from the given 95835bfedeaba724aeadc6f6c890269cb6bf7ef42f5Svetoslav Ganov * <code>event</code>. 9598643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 9608643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @param event The other event. 9618643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @return An instance. 9628643aa0179e598e78d938c59035389054535a229Svetoslav Ganov */ 9638643aa0179e598e78d938c59035389054535a229Svetoslav Ganov public static AccessibilityEvent obtain(AccessibilityEvent event) { 9648643aa0179e598e78d938c59035389054535a229Svetoslav Ganov AccessibilityEvent eventClone = AccessibilityEvent.obtain(); 9658643aa0179e598e78d938c59035389054535a229Svetoslav Ganov eventClone.init(event); 9668643aa0179e598e78d938c59035389054535a229Svetoslav Ganov 9678643aa0179e598e78d938c59035389054535a229Svetoslav Ganov final int recordCount = event.mRecords.size(); 9688643aa0179e598e78d938c59035389054535a229Svetoslav Ganov for (int i = 0; i < recordCount; i++) { 9698643aa0179e598e78d938c59035389054535a229Svetoslav Ganov AccessibilityRecord record = event.mRecords.get(i); 9708643aa0179e598e78d938c59035389054535a229Svetoslav Ganov AccessibilityRecord recordClone = AccessibilityRecord.obtain(record); 9718643aa0179e598e78d938c59035389054535a229Svetoslav Ganov eventClone.mRecords.add(recordClone); 9728643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } 9738643aa0179e598e78d938c59035389054535a229Svetoslav Ganov 9748643aa0179e598e78d938c59035389054535a229Svetoslav Ganov return eventClone; 9758643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } 9768643aa0179e598e78d938c59035389054535a229Svetoslav Ganov 9778643aa0179e598e78d938c59035389054535a229Svetoslav Ganov /** 9788643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * Returns a cached instance if such is available or a new one is 97975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * instantiated. 98075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * 98175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @return An instance. 98275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 98375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static AccessibilityEvent obtain() { 984f4782ec9c57a40224ac0974fce6b6fe280c829ceSvetoslav Ganov AccessibilityEvent event = sPool.acquire(); 985f4782ec9c57a40224ac0974fce6b6fe280c829ceSvetoslav Ganov return (event != null) ? event : new AccessibilityEvent(); 98675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 98775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 98875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 98938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * Recycles an instance back to be reused. 99075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * <p> 99138e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * <b>Note: You must not touch the object after calling this function.</b> 99238e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * </p> 993887e1a17eb9b12448f5929791b564565b2665aabSvetoslav Ganov * 994887e1a17eb9b12448f5929791b564565b2665aabSvetoslav Ganov * @throws IllegalStateException If the event is already recycled. 99575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 996736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov @Override 99775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void recycle() { 99875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov clear(); 999f4782ec9c57a40224ac0974fce6b6fe280c829ceSvetoslav Ganov sPool.release(this); 100075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 100175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 100275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 100375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * Clears the state of this instance. 10048643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * 10058643aa0179e598e78d938c59035389054535a229Svetoslav Ganov * @hide 100675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 1007736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov @Override 1008736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov protected void clear() { 1009736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov super.clear(); 101075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov mEventType = 0; 10112b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov mMovementGranularity = 0; 10126d17a936f73976971135aa1e6248662533343292Svetoslav Ganov mAction = 0; 101377e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette mContentChangeTypes = 0; 10143fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell mPackageName = null; 1015736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov mEventTime = 0; 1016736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov while (!mRecords.isEmpty()) { 1017736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov AccessibilityRecord record = mRecords.remove(0); 1018736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.recycle(); 10193fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell } 1020ac84d3ba81f08036308b17e1ab919e43987a3df5Svetoslav Ganov } 1021ac84d3ba81f08036308b17e1ab919e43987a3df5Svetoslav Ganov 1022ac84d3ba81f08036308b17e1ab919e43987a3df5Svetoslav Ganov /** 10233fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell * Creates a new instance from a {@link Parcel}. 10243fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell * 10253fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell * @param parcel A parcel containing the state of a {@link AccessibilityEvent}. 1026ac84d3ba81f08036308b17e1ab919e43987a3df5Svetoslav Ganov */ 10273fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell public void initFromParcel(Parcel parcel) { 1028d116d7c78a9c53f30a73bf273bd7618312cf3847Svetoslav Ganov mSealed = (parcel.readInt() == 1); 10293fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell mEventType = parcel.readInt(); 10302b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov mMovementGranularity = parcel.readInt(); 10316d17a936f73976971135aa1e6248662533343292Svetoslav Ganov mAction = parcel.readInt(); 103277e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette mContentChangeTypes = parcel.readInt(); 10333fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell mPackageName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); 1034736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov mEventTime = parcel.readLong(); 1035d116d7c78a9c53f30a73bf273bd7618312cf3847Svetoslav Ganov mConnectionId = parcel.readInt(); 1036736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov readAccessibilityRecordFromParcel(this, parcel); 1037736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 1038736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov // Read the records. 1039736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov final int recordCount = parcel.readInt(); 1040736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov for (int i = 0; i < recordCount; i++) { 1041736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov AccessibilityRecord record = AccessibilityRecord.obtain(); 104234e350daf89aed09ac748c2185f4506772a63b3fSvetoslav Ganov readAccessibilityRecordFromParcel(record, parcel); 1043d116d7c78a9c53f30a73bf273bd7618312cf3847Svetoslav Ganov record.mConnectionId = mConnectionId; 1044736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov mRecords.add(record); 1045736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 10463fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell } 10473fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell 1048736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 1049736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Reads an {@link AccessibilityRecord} from a parcel. 1050736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * 1051736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param record The record to initialize. 1052736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param parcel The parcel to read from. 1053736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 1054736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private void readAccessibilityRecordFromParcel(AccessibilityRecord record, 1055736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov Parcel parcel) { 1056736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mBooleanProperties = parcel.readInt(); 1057736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mCurrentItemIndex = parcel.readInt(); 1058736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mItemCount = parcel.readInt(); 1059736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mFromIndex = parcel.readInt(); 1060a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov record.mToIndex = parcel.readInt(); 1061a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov record.mScrollX = parcel.readInt(); 1062a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov record.mScrollY = parcel.readInt(); 1063d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov record.mMaxScrollX = parcel.readInt(); 1064d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov record.mMaxScrollY = parcel.readInt(); 1065736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mAddedCount = parcel.readInt(); 1066736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mRemovedCount = parcel.readInt(); 1067736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mClassName = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); 1068736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mContentDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); 1069736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mBeforeText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); 1070736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov record.mParcelableData = parcel.readParcelable(null); 1071736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.readList(record.mText, null); 1072eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov record.mSourceWindowId = parcel.readInt(); 1073021078554b902179442a345a9d080a165c3b5139Svetoslav Ganov record.mSourceNodeId = parcel.readLong(); 1074eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov record.mSealed = (parcel.readInt() == 1); 1075736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 1076736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 1077736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 1078736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * {@inheritDoc} 1079736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 108075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public void writeToParcel(Parcel parcel, int flags) { 10818643aa0179e598e78d938c59035389054535a229Svetoslav Ganov parcel.writeInt(isSealed() ? 1 : 0); 108275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov parcel.writeInt(mEventType); 10832b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov parcel.writeInt(mMovementGranularity); 10846d17a936f73976971135aa1e6248662533343292Svetoslav Ganov parcel.writeInt(mAction); 108577e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette parcel.writeInt(mContentChangeTypes); 10863fb3d7c4e756bd32d5abde0abca9ab52d559bc84Adam Powell TextUtils.writeToParcel(mPackageName, parcel, 0); 1087736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeLong(mEventTime); 1088d116d7c78a9c53f30a73bf273bd7618312cf3847Svetoslav Ganov parcel.writeInt(mConnectionId); 1089736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov writeAccessibilityRecordToParcel(this, parcel, flags); 1090736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 1091736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov // Write the records. 1092736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov final int recordCount = getRecordCount(); 1093736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(recordCount); 1094736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov for (int i = 0; i < recordCount; i++) { 1095736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov AccessibilityRecord record = mRecords.get(i); 1096736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov writeAccessibilityRecordToParcel(record, parcel, flags); 1097736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 1098736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 1099736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov 1100736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 1101736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * Writes an {@link AccessibilityRecord} to a parcel. 1102736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * 1103736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param record The record to write. 1104736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * @param parcel The parcel to which to write. 1105736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 1106736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov private void writeAccessibilityRecordToParcel(AccessibilityRecord record, Parcel parcel, 1107736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov int flags) { 1108736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mBooleanProperties); 1109736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mCurrentItemIndex); 1110736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mItemCount); 1111736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mFromIndex); 1112a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov parcel.writeInt(record.mToIndex); 1113a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov parcel.writeInt(record.mScrollX); 1114a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov parcel.writeInt(record.mScrollY); 1115d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov parcel.writeInt(record.mMaxScrollX); 1116d9ee72fddb8be40e414a831fb80458dc48699613Svetoslav Ganov parcel.writeInt(record.mMaxScrollY); 1117736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mAddedCount); 1118736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeInt(record.mRemovedCount); 1119736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov TextUtils.writeToParcel(record.mClassName, parcel, flags); 1120736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov TextUtils.writeToParcel(record.mContentDescription, parcel, flags); 1121736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov TextUtils.writeToParcel(record.mBeforeText, parcel, flags); 1122736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeParcelable(record.mParcelableData, flags); 1123736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov parcel.writeList(record.mText); 1124eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov parcel.writeInt(record.mSourceWindowId); 1125021078554b902179442a345a9d080a165c3b5139Svetoslav Ganov parcel.writeLong(record.mSourceNodeId); 1126eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov parcel.writeInt(record.mSealed ? 1 : 0); 112775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 112875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 1129736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov /** 1130736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov * {@inheritDoc} 1131736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov */ 113275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public int describeContents() { 113375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return 0; 113475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 113575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 113675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov @Override 113775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public String toString() { 113875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov StringBuilder builder = new StringBuilder(); 113938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov builder.append("EventType: ").append(eventTypeToString(mEventType)); 1140cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov builder.append("; EventTime: ").append(mEventTime); 1141cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov builder.append("; PackageName: ").append(mPackageName); 11422b435aada3d274a9c08d334946fff1ab9ba15b48Svetoslav Ganov builder.append("; MovementGranularity: ").append(mMovementGranularity); 11436d17a936f73976971135aa1e6248662533343292Svetoslav Ganov builder.append("; Action: ").append(mAction); 1144736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov builder.append(super.toString()); 11458643aa0179e598e78d938c59035389054535a229Svetoslav Ganov if (DEBUG) { 1146736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov builder.append("\n"); 114777e9a28e2faa36f127231b842476d47f9823a83aAlan Viverette builder.append("; ContentChangeTypes: ").append(mContentChangeTypes); 1148eeee4d2c01d3c4ed99e4891dbc75c7de69a803faSvetoslav Ganov builder.append("; sourceWindowId: ").append(mSourceWindowId); 1149021078554b902179442a345a9d080a165c3b5139Svetoslav Ganov builder.append("; mSourceNodeId: ").append(mSourceNodeId); 11508643aa0179e598e78d938c59035389054535a229Svetoslav Ganov for (int i = 0; i < mRecords.size(); i++) { 11518643aa0179e598e78d938c59035389054535a229Svetoslav Ganov AccessibilityRecord record = mRecords.get(i); 11528643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(" Record "); 11538643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(i); 11548643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(":"); 11558643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(" [ ClassName: " + record.mClassName); 11568643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; Text: " + record.mText); 11578643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; ContentDescription: " + record.mContentDescription); 11588643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; ItemCount: " + record.mItemCount); 11598643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; CurrentItemIndex: " + record.mCurrentItemIndex); 11608643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; IsEnabled: " + record.isEnabled()); 11618643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; IsPassword: " + record.isPassword()); 11628643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; IsChecked: " + record.isChecked()); 11638643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; IsFullScreen: " + record.isFullScreen()); 1164a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov builder.append("; Scrollable: " + record.isScrollable()); 11658643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; BeforeText: " + record.mBeforeText); 11668643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; FromIndex: " + record.mFromIndex); 1167a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov builder.append("; ToIndex: " + record.mToIndex); 1168a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov builder.append("; ScrollX: " + record.mScrollX); 1169a0156177cdc809795dd8bc5a19943dd2b6f82b66Svetoslav Ganov builder.append("; ScrollY: " + record.mScrollY); 11708643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; AddedCount: " + record.mAddedCount); 11718643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; RemovedCount: " + record.mRemovedCount); 11728643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("; ParcelableData: " + record.mParcelableData); 11738643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append(" ]"); 11748643aa0179e598e78d938c59035389054535a229Svetoslav Ganov builder.append("\n"); 11758643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } 11768643aa0179e598e78d938c59035389054535a229Svetoslav Ganov } else { 1177e4aa13b20166219a62916a92294055e7cc5c9f10Svetoslav Ganov builder.append("; recordCount: ").append(getRecordCount()); 1178736c2756bf3c14ae9fef7255c119057f7a2be1edSvetoslav Ganov } 117975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return builder.toString(); 118075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 118175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 118275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov /** 1183cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov * Returns the string representation of an event type. For example, 1184cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov * {@link #TYPE_VIEW_CLICKED} is represented by the string TYPE_VIEW_CLICKED. 1185cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov * 118638e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov * @param eventType The event type 1187cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov * @return The string representation. 1188cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov */ 118938e8b4e5bc3c93affdffbc064fd9db5aeccc3e8eSvetoslav Ganov public static String eventTypeToString(int eventType) { 11906ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventType == TYPES_ALL_MASK) { 11916ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov return "TYPES_ALL_MASK"; 1192cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov } 11936ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov StringBuilder builder = new StringBuilder(); 11946ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov int eventTypeCount = 0; 11956ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov while (eventType != 0) { 11966ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov final int eventTypeFlag = 1 << Integer.numberOfTrailingZeros(eventType); 11976ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventType &= ~eventTypeFlag; 11986ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov switch (eventTypeFlag) { 11996ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_CLICKED: { 12006ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12016ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12026ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12036ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_CLICKED"); 12046ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12056ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12066ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_LONG_CLICKED: { 12076ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12086ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12096ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12106ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_LONG_CLICKED"); 12116ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12126ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12136ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_SELECTED: { 12146ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12156ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12166ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12176ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_SELECTED"); 12186ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12196ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12206ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_FOCUSED: { 12216ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12226ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12236ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12246ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_FOCUSED"); 12256ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12266ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12276ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_TEXT_CHANGED: { 12286ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12296ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12306ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12316ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_TEXT_CHANGED"); 12326ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12336ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12346ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_WINDOW_STATE_CHANGED: { 12356ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12366ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12376ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12386ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_WINDOW_STATE_CHANGED"); 12396ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12406ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12416ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_HOVER_ENTER: { 12426ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12436ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12446ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12456ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_HOVER_ENTER"); 12466ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12476ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12486ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_HOVER_EXIT: { 12496ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12506ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12516ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12526ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_HOVER_EXIT"); 12536ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12546ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12556ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_NOTIFICATION_STATE_CHANGED: { 12566ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12576ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12586ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12596ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_NOTIFICATION_STATE_CHANGED"); 12606ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12616ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12626ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_TOUCH_EXPLORATION_GESTURE_START: { 12636ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12646ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12656ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12666ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_TOUCH_EXPLORATION_GESTURE_START"); 12676ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12686ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12696ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_TOUCH_EXPLORATION_GESTURE_END: { 12706ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12716ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12726ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12736ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_TOUCH_EXPLORATION_GESTURE_END"); 12746ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12756ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12766ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_WINDOW_CONTENT_CHANGED: { 12776ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12786ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12796ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12806ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_WINDOW_CONTENT_CHANGED"); 12816ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12826ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12836ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_TEXT_SELECTION_CHANGED: { 12846ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12856ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12866ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12876ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_TEXT_SELECTION_CHANGED"); 12886ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12896ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12906ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_SCROLLED: { 12916ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12926ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 12936ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 12946ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_SCROLLED"); 12956ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 12966ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 12976ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_ANNOUNCEMENT: { 12986ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 12996ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 13006ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13016ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_ANNOUNCEMENT"); 13026ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 13036ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 13046ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_ACCESSIBILITY_FOCUSED: { 13056ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 13066ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 13076ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13086ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_ACCESSIBILITY_FOCUSED"); 13096ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 13106ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 13116ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED: { 13126ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 13136ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 13146ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13156ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED"); 13166ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 13176ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 13186ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY: { 13196ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 13206ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 13216ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 1322abad55d860be793b8b9b3e288a74214da89fb368Svetoslav builder.append("TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY"); 13236ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 13246ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 13256ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_GESTURE_DETECTION_START: { 13266ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 13276ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 13286ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13296ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_GESTURE_DETECTION_START"); 13306ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 13316ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 13326ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_GESTURE_DETECTION_END: { 13336ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 13346ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 13356ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13366ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_GESTURE_DETECTION_END"); 13376ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 13386ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 13396ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_TOUCH_INTERACTION_START: { 13406ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 13416ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 13426ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13436ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_TOUCH_INTERACTION_START"); 13446ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 13456ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 13466ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov case TYPE_TOUCH_INTERACTION_END: { 13476ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 0) { 13486ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(", "); 13496ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13506ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append("TYPE_TOUCH_INTERACTION_END"); 13516ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov eventTypeCount++; 13526ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } break; 13536ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13546ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13556ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov if (eventTypeCount > 1) { 13566ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.insert(0, '['); 13576ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov builder.append(']'); 13586ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov } 13596ce77cdd6aff7193c746cd1eb87d5babf9158bacSvetoslav Ganov return builder.toString(); 1360cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov } 1361cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov 1362cc4053e031371456fe54d51bbad1db721db4ae38Svetoslav Ganov /** 136375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov * @see Parcelable.Creator 136475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov */ 136575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public static final Parcelable.Creator<AccessibilityEvent> CREATOR = 136675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov new Parcelable.Creator<AccessibilityEvent>() { 136775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public AccessibilityEvent createFromParcel(Parcel parcel) { 136875986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov AccessibilityEvent event = AccessibilityEvent.obtain(); 136975986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov event.initFromParcel(parcel); 137075986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return event; 137175986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 137275986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov 137375986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov public AccessibilityEvent[] newArray(int size) { 137475986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov return new AccessibilityEvent[size]; 137575986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov } 137675986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov }; 137775986cf9bc57ef11ad70f36fb77fbbf5d63af6ecsvetoslavganov} 1378