From 9920f4fdeaa3a4c597f62c3d082becc48ea8a7ab Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Fri, 7 Oct 2011 18:39:11 -0700 Subject: [PATCH] Accessibility text changed event text not populated. Added the TYPE_VIEW_TEXT_CHANGED event to the populating events. bug:5430831 Change-Id: I78e87640ea4279227d89f399ad43e9b88eb4a486 --- core/java/android/view/View.java | 3 ++- .../android/view/accessibility/AccessibilityEvent.java | 9 --------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 15544ccc4887d..7f3c08c16583f 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -1486,7 +1486,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal | AccessibilityEvent.TYPE_VIEW_FOCUSED | AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED | AccessibilityEvent.TYPE_VIEW_HOVER_ENTER - | AccessibilityEvent.TYPE_VIEW_HOVER_EXIT; + | AccessibilityEvent.TYPE_VIEW_HOVER_EXIT + | AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED; /** * Temporary Rect currently for use in setBackground(). This will probably diff --git a/core/java/android/view/accessibility/AccessibilityEvent.java b/core/java/android/view/accessibility/AccessibilityEvent.java index 25bc559e94e34..86dd9df0cb0a2 100644 --- a/core/java/android/view/accessibility/AccessibilityEvent.java +++ b/core/java/android/view/accessibility/AccessibilityEvent.java @@ -200,15 +200,6 @@ import java.util.List; *
  • {@link #getBeforeText()} - The text of the source before the change.
  • *
  • {@link #getContentDescription()} - The content description of the source.
  • * - * Note: This event type is not dispatched to descendants though - * {@link android.view.View#dispatchPopulateAccessibilityEvent(AccessibilityEvent) - * View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)}, hence the event - * source {@link android.view.View} and the sub-tree rooted at it will not receive - * calls to {@link android.view.View#onPopulateAccessibilityEvent(AccessibilityEvent) - * View.onPopulateAccessibilityEvent(AccessibilityEvent)}. The preferred way to add - * text content to such events is by setting the - * {@link android.R.styleable#View_contentDescription contentDescription} of the source - * view.
    *

    *

    * View text selection changed - represents the event of changing the text