3232 * when {@link AccessibilityEvent}s are fired. Such events denote some state transition
3333 * in the user interface, for example, the focus has changed, a button has been clicked,
3434 * etc. Such a service can optionally request the capability for querying the content
35- * of the active window. Development of an accessibility service requires extends this
36- * class and implements its abstract methods.
37- * <p>
38- * <strong>Lifecycle</strong>
39- * </p>
35+ * of the active window. Development of an accessibility service requires extending this
36+ * class and implementing its abstract methods.
37+ * <h3>Lifecycle</h3>
4038 * <p>
4139 * The lifecycle of an accessibility service is managed exclusively by the system and
4240 * follows the established service life cycle. Additionally, starting or stopping an
4543 * calls {@link AccessibilityService#onServiceConnected()}. This method can be
4644 * overriden by clients that want to perform post binding setup.
4745 * </p>
48- * <p>
49- * <strong>Declaration</strong>
50- * </p>
46+ * <h3>Declaration</h3>
5147 * <p>
5248 * An accessibility is declared as any other service in an AndroidManifest.xml but it
5349 * must also specify that it handles the "android.accessibilityservice.AccessibilityService"
5450 * {@link android.content.Intent}. Failure to declare this intent will cause the system to
5551 * ignore the accessibility service. Following is an example declaration:
5652 * </p>
57- * <p>
58- * <code>
59- * <pre>
60- * <service android:name=".MyAccessibilityService">
53+ * <pre> <service android:name=".MyAccessibilityService">
6154 * <intent-filter>
62- * <action android:name="android.accessibilityservice.AccessibilityService" />
55+ * <action android:name="android.accessibilityservice.AccessibilityService" />
6356 * </intent-filter>
6457 * . . .
65- * </service>
66- * </pre>
67- * </code>
68- * </p>
69- * <p>
70- * <strong>Configuration</strong>
71- * </p>
58+ * </service></pre>
59+ * <h3>Configuration</h3>
7260 * <p>
7361 * An accessibility service can be configured to receive specific types of accessibility events,
7462 * listen only to specific packages, get events from each type only once in a given time frame,
8169 * <li>
8270 * Providing a {@link #SERVICE_META_DATA meta-data} entry in the manifest when declaring
8371 * the service. A service declaration with a meta-data tag is presented below:
84- * <p>
85- * <code>
86- * <pre>
87- * <service android:name=".MyAccessibilityService">
72+ * <pre> <service android:name=".MyAccessibilityService">
8873 * <intent-filter>
89- * <action android:name="android.accessibilityservice.AccessibilityService" />
74+ * <action android:name="android.accessibilityservice.AccessibilityService" />
9075 * </intent-filter>
9176 * <meta-data android:name="android.accessibilityservice" android:resource="@xml/accessibilityservice" />
92- * </service>
93- * </pre>
94- * </code>
95- * </p>
96- * <p>
97- * <strong>Note:</strong>This approach enables setting all properties.
77+ * </service></pre>
78+ * <p class="note">
79+ * <strong>Note:</strong> This approach enables setting all properties.
9880 * </p>
9981 * <p>
10082 * For more details refer to {@link #SERVICE_META_DATA} and
101- * <code><{@link android.R.styleable#AccessibilityService accessibility-service}></code>..
83+ * <code><{@link android.R.styleable#AccessibilityService accessibility-service}></code>.
10284 * </p>
10385 * </li>
10486 * <li>
10587 * Calling {@link AccessibilityService#setServiceInfo(AccessibilityServiceInfo)}. Note
10688 * that this method can be called any time to dynamically change the service configuration.
107- * <p>
89+ * <p class="note" >
10890 * <strong>Note:</strong> This approach enables setting only dynamically configurable properties:
10991 * {@link AccessibilityServiceInfo#eventTypes},
11092 * {@link AccessibilityServiceInfo#feedbackType},
11799 * </p>
118100 * </li>
119101 * </ul>
120- * <p>
121- * <strong>Retrieving window content</strong>
122- * </p>
102+ * <h3>Retrieving window content</h3>
123103 * <p>
124104 * An service can specify in its declaration that it can retrieve the active window
125105 * content which is represented as a tree of {@link AccessibilityNodeInfo}. Note that
144124 * this method will return an {@link AccessibilityNodeInfo} that can be used to traverse the
145125 * window content which represented as a tree of such objects.
146126 * </p>
147- * <p>
148- * <strong>Note</strong>An accessibility service may have requested to be notified for
127+ * <p class="note" >
128+ * <strong>Note</strong> An accessibility service may have requested to be notified for
149129 * a subset of the event types, thus be unaware that the active window has changed. Therefore
150130 * accessibility service that would like to retrieve window content should:
151131 * <ul>
158138 * <li>
159139 * Prepare that a retrieval method on {@link AccessibilityNodeInfo} may fail since the
160140 * active window has changed and the service did not get the accessibility event yet. Note
161- * that it is possible to have a retrieval method failing event adopting the strategy
141+ * that it is possible to have a retrieval method failing even adopting the strategy
162142 * specified in the previous bullet because the accessibility event dispatch is asynchronous
163143 * and crosses process boundaries.
164144 * </li>
165145 * </ul>
166146 * </p>
167- * <p>
168- * <b>Notification strategy</b>
169- * </p>
147+ * <h3>Notification strategy</h3>
170148 * <p>
171149 * For each feedback type only one accessibility service is notified. Services are notified
172150 * in the order of registration. Hence, if two services are registered for the same
178156 * well with most applications to coexist with "polished" ones that are targeted for
179157 * specific applications.
180158 * </p>
181- * <p>
182- * <b>Event types</b>
183- * </p>
184- * {@link AccessibilityEvent#TYPE_VIEW_CLICKED}
185- * {@link AccessibilityEvent#TYPE_VIEW_LONG_CLICKED}
186- * {@link AccessibilityEvent#TYPE_VIEW_FOCUSED}
187- * {@link AccessibilityEvent#TYPE_VIEW_SELECTED}
188- * {@link AccessibilityEvent#TYPE_VIEW_TEXT_CHANGED}
189- * {@link AccessibilityEvent#TYPE_WINDOW_STATE_CHANGED}
190- * {@link AccessibilityEvent#TYPE_NOTIFICATION_STATE_CHANGED}
191- * {@link AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_START}
192- * {@link AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_END}
193- * {@link AccessibilityEvent#TYPE_VIEW_HOVER_ENTER}
194- * {@link AccessibilityEvent#TYPE_VIEW_HOVER_EXIT}
195- * {@link AccessibilityEvent#TYPE_VIEW_SCROLLED}
196- * {@link AccessibilityEvent#TYPE_VIEW_TEXT_SELECTION_CHANGED}
197- * {@link AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED}
198- * <p>
199- * <b>Feedback types</b>
200- * <p>
201- * {@link AccessibilityServiceInfo#FEEDBACK_AUDIBLE}
202- * {@link AccessibilityServiceInfo#FEEDBACK_HAPTIC}
203- * {@link AccessibilityServiceInfo#FEEDBACK_AUDIBLE}
204- * {@link AccessibilityServiceInfo#FEEDBACK_VISUAL}
205- * {@link AccessibilityServiceInfo#FEEDBACK_GENERIC}
206- *
207- * @see AccessibilityEvent
208- * @see AccessibilityServiceInfo
209- * @see android.view.accessibility.AccessibilityManager
210- *
159+ * <p class="note">
211160 * <strong>Note:</strong> The event notification timeout is useful to avoid propagating
212161 * events to the client too frequently since this is accomplished via an expensive
213162 * interprocess call. One can think of the timeout as a criteria to determine when
214- * event generation has settled down.
163+ * event generation has settled down.</p>
164+ * <h3>Event types</h3>
165+ * <ul>
166+ * <li>{@link AccessibilityEvent#TYPE_VIEW_CLICKED}
167+ * <li>{@link AccessibilityEvent#TYPE_VIEW_LONG_CLICKED}
168+ * <li>{@link AccessibilityEvent#TYPE_VIEW_FOCUSED}
169+ * <li>{@link AccessibilityEvent#TYPE_VIEW_SELECTED}
170+ * <li>{@link AccessibilityEvent#TYPE_VIEW_TEXT_CHANGED}
171+ * <li>{@link AccessibilityEvent#TYPE_WINDOW_STATE_CHANGED}
172+ * <li>{@link AccessibilityEvent#TYPE_NOTIFICATION_STATE_CHANGED}
173+ * <li>{@link AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_START}
174+ * <li>{@link AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_END}
175+ * <li>{@link AccessibilityEvent#TYPE_VIEW_HOVER_ENTER}
176+ * <li>{@link AccessibilityEvent#TYPE_VIEW_HOVER_EXIT}
177+ * <li>{@link AccessibilityEvent#TYPE_VIEW_SCROLLED}
178+ * <li>{@link AccessibilityEvent#TYPE_VIEW_TEXT_SELECTION_CHANGED}
179+ * <li>{@link AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED}
180+ * </ul>
181+ * <h3>Feedback types</h3>
182+ * <ul>
183+ * <li>{@link AccessibilityServiceInfo#FEEDBACK_AUDIBLE}
184+ * <li>{@link AccessibilityServiceInfo#FEEDBACK_HAPTIC}
185+ * <li>{@link AccessibilityServiceInfo#FEEDBACK_AUDIBLE}
186+ * <li>{@link AccessibilityServiceInfo#FEEDBACK_VISUAL}
187+ * <li>{@link AccessibilityServiceInfo#FEEDBACK_GENERIC}
188+ * </ul>
189+ * @see AccessibilityEvent
190+ * @see AccessibilityServiceInfo
191+ * @see android.view.accessibility.AccessibilityManager
215192 */
216193public abstract class AccessibilityService extends Service {
217194 /**
@@ -225,10 +202,7 @@ public abstract class AccessibilityService extends Service {
225202 * about itself. This meta-data must reference an XML resource containing an
226203 * <code><{@link android.R.styleable#AccessibilityService accessibility-service}></code>
227204 * tag. This is a a sample XML file configuring an accessibility service:
228- * <p>
229- * <code>
230- * <pre>
231- * <accessibility-service
205+ * <pre> <accessibility-service
232206 * android:accessibilityEventTypes="typeViewClicked|typeViewFocused"
233207 * android:packageNames="foo.bar, foo.baz"
234208 * android:accessibilityFeedbackType="feedbackSpoken"
@@ -237,10 +211,7 @@ public abstract class AccessibilityService extends Service {
237211 * android:settingsActivity="foo.bar.TestBackActivity"
238212 * android:canRetrieveWindowContent="true"
239213 * . . .
240- * />
241- * </pre>
242- * </code>
243- * </p>
214+ * /></pre>
244215 */
245216 public static final String SERVICE_META_DATA = "android.accessibilityservice" ;
246217
0 commit comments