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

Commit 0ebe6bd5 authored by Phil Weaver's avatar Phil Weaver
Browse files

Avoid copying NoCopySpans.

Move from Spannable to SpannableStringBuilder, as the latter doesn't
copy NoCopySpans.

Bug: 34712634
Test: CTS tests that verify clickable spans still work.
Change-Id: I0ab029a7c79cb7d0b48724890c5cabe841390f4a
parent eb0a2901
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.text.InputType;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.AccessibilityClickableSpan;
@@ -2421,7 +2422,7 @@ public class AccessibilityNodeInfo implements Parcelable {
            ClickableSpan[] spans =
                    ((Spanned) text).getSpans(0, text.length(), ClickableSpan.class);
            if (spans.length > 0) {
                Spannable spannable = Spannable.Factory.getInstance().newSpannable(text);
                Spannable spannable = new SpannableStringBuilder(text);
                for (int i = 0; i < spans.length; i++) {
                    ClickableSpan span = spans[i];
                    if ((span instanceof AccessibilityClickableSpan)