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

Commit 70ab0eec authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Fix: setExtractedText partial span change handling.

ExtractedText represents a partial text change when
partialStartOffset and partialEndOffset are set.
TextView#setExtractedText handles partial updates correctly when text
is changed, but it didn't handle them for span updates when text is
not changed.

Bug: 27635763
Change-Id: I7dc2ad0c0b7f1867738be3d6d40ea36d0d9a3e7e
parent 62006a72
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -6552,7 +6552,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                if (TextUtils.equals(content.subSequence(start, end), text.text)) {
                if (TextUtils.equals(content.subSequence(start, end), text.text)) {
                    if (text.text instanceof Spanned) {
                    if (text.text instanceof Spanned) {
                        // OK to copy spans only.
                        // OK to copy spans only.
                        TextUtils.copySpansFrom((Spanned) text.text, start, end,
                        TextUtils.copySpansFrom((Spanned) text.text, 0, end - start,
                                Object.class, content, start);
                                Object.class, content, start);
                    }
                    }
                } else {
                } else {