429429 * view.</br>
430430 * </p>
431431 * <p>
432+ * <b>MISCELLANEOUS TYPES</b></br>
433+ * </p>
434+ * <p>
435+ * <b>Announcement</b> - represents the event of an application making an
436+ * announcement. Usually this announcement is related to some sort of a context
437+ * change for which none of the events representing UI transitions is a good fit.
438+ * For example, announcing a new page in a book.</br>
439+ * <em>Type:</em> {@link #TYPE_ANNOUNCEMENT}</br>
440+ * <em>Properties:</em></br>
441+ * <ul>
442+ * <li>{@link #getEventType()} - The type of the event.</li>
443+ * <li>{@link #getSource()} - The source info (for registered clients).</li>
444+ * <li>{@link #getClassName()} - The class name of the source.</li>
445+ * <li>{@link #getPackageName()} - The package name of the source.</li>
446+ * <li>{@link #getEventTime()} - The event time.</li>
447+ * <li>{@link #getText()} - The text of the announcement.</li>
448+ * <li>{@link #isEnabled()} - Whether the source is enabled.</li>
449+ * </ul>
450+ * </p>
451+ * <p>
432452 * <b>Security note</b>
433453 * <p>
434454 * Since an event contains the text of its source privacy can be compromised by leaking
@@ -537,6 +557,11 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
537557 */
538558 public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 0x00002000 ;
539559
560+ /**
561+ * Represents the event of an application making an announcement.
562+ */
563+ public static final int TYPE_ANNOUNCEMENT = 0x00004000 ;
564+
540565 /**
541566 * Mask for {@link AccessibilityEvent} all types.
542567 *
@@ -554,6 +579,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
554579 * @see #TYPE_WINDOW_CONTENT_CHANGED
555580 * @see #TYPE_VIEW_SCROLLED
556581 * @see #TYPE_VIEW_TEXT_SELECTION_CHANGED
582+ * @see #TYPE_ANNOUNCEMENT
557583 */
558584 public static final int TYPES_ALL_MASK = 0xFFFFFFFF ;
559585
@@ -984,6 +1010,8 @@ public static String eventTypeToString(int eventType) {
9841010 return "TYPE_VIEW_TEXT_SELECTION_CHANGED" ;
9851011 case TYPE_VIEW_SCROLLED :
9861012 return "TYPE_VIEW_SCROLLED" ;
1013+ case TYPE_ANNOUNCEMENT :
1014+ return "TYPE_ANNOUNCEMENT" ;
9871015 default :
9881016 return null ;
9891017 }
0 commit comments