diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index ffc98d2c8e906..cfb2130508161 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -8204,7 +8204,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * to populate information about the event source (this View), then calls * {@link #dispatchPopulateAccessibilityEvent(AccessibilityEvent)} to * populate the text content of the event source including its descendants, - * and last calls + * then for events type {@link AccessibilityEvent#TYPE_VIEW_SCROLLED} + * and {@link AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED} with + * subtype {@link AccessibilityEvent#CONTENT_CHANGE_TYPE_STATE_DESCRIPTION}, + * throttle the events, and last calls * {@link ViewParent#requestSendAccessibilityEvent(View, AccessibilityEvent)} * on its parent to request sending of the event to interested parties. *
@@ -8213,11 +8216,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link AccessibilityDelegate#sendAccessibilityEvent(View, int)} is * responsible for handling this call. *
+ *+ * If this view uses {@link AccessibilityNodeProvider} to provide virtual view hierarchy rooted + * at this view, this method should not be called to send events from virtual children because + * it will populate the events with wrong information and the events should be throttled per + * child instead at the virtual root level. To send events from virtual children, call + * {@link ViewParent#requestSendAccessibilityEvent(View, AccessibilityEvent)} on the view's + * parent to request sending of the event to interested parties. + *
* * @param eventType The type of the event to send, as defined by several types from - * {@link android.view.accessibility.AccessibilityEvent}, such as - * {@link android.view.accessibility.AccessibilityEvent#TYPE_VIEW_CLICKED} or - * {@link android.view.accessibility.AccessibilityEvent#TYPE_VIEW_HOVER_ENTER}. + * {@link AccessibilityEvent}, such as + * {@link AccessibilityEvent#TYPE_VIEW_CLICKED} or + * {@link AccessibilityEvent#TYPE_VIEW_HOVER_ENTER}. * * @see #onInitializeAccessibilityEvent(AccessibilityEvent) * @see #dispatchPopulateAccessibilityEvent(AccessibilityEvent)