diff options
| author | Phil Weaver <pweaver@google.com> | 2019-10-03 15:43:46 -0700 |
|---|---|---|
| committer | Phil Weaver <pweaver@google.com> | 2019-10-03 15:43:46 -0700 |
| commit | 7f0348298e905b56fa791f5f7e62e5f3e3128d66 (patch) | |
| tree | 9e738185c3d26c914ff56f3b9fd328e0e33ff8ee /core/java/android/widget/TextView.java | |
| parent | 571854ead06ce125701104426f31b28043cfc54a (diff) | |
Add @CallSuper to TextView#onSelectionChanged
Clarifying the need to call super to make sure the a11y event
gets dispatched.
Bug: 65416426
Test: No functional changes, so just doing make
Change-Id: I34eb295b7d4d56c5211fb7c249e07d676ee7f295
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index f997d6878a9c..31f50555af1d 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -23,6 +23,7 @@ import static android.view.accessibility.AccessibilityNodeInfo.EXTRA_DATA_TEXT_C import static android.view.inputmethod.CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION; import android.R; +import android.annotation.CallSuper; import android.annotation.CheckResult; import android.annotation.ColorInt; import android.annotation.DrawableRes; @@ -10446,10 +10447,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener /** * This method is called when the selection has changed, in case any * subclasses would like to know. + * </p> + * <p class="note"><strong>Note:</strong> Always call the super implementation, which informs + * the accessibility subsystem about the selection change. + * </p> * * @param selStart The new selection start location. * @param selEnd The new selection end location. */ + @CallSuper protected void onSelectionChanged(int selStart, int selEnd) { sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED); } |
