Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f034829 authored by Phil Weaver's avatar Phil Weaver
Browse files

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
parent 571854ea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57394,7 +57394,7 @@ package android.widget {
    method public boolean onPrivateIMECommand(String, android.os.Bundle);
    method public void onRestoreInstanceState(android.os.Parcelable);
    method public android.os.Parcelable onSaveInstanceState();
    method protected void onSelectionChanged(int, int);
    method @CallSuper protected void onSelectionChanged(int, int);
    method protected void onTextChanged(CharSequence, int, int, int);
    method public boolean onTextContextMenuItem(int);
    method public void removeTextChangedListener(android.text.TextWatcher);
+6 −0
Original line number Diff line number Diff line
@@ -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);
    }