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

Commit b3efbf16 authored by Felix Oghina's avatar Felix Oghina Committed by Android (Google) Code Review
Browse files

Merge "Revert "[content-capture] ensure memory-safe charsequences""

parents 9e36e633 aad8d52e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -740,8 +740,7 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
        // Since the same CharSequence instance may be reused in the TextView, we need to make
        // a copy of its content so that its value will not be changed by subsequent updates
        // in the TextView.
        final CharSequence eventText =
                TextUtils.trimToParcelableSize(stringOrSpannedStringWithoutNoCopySpans(text));
        final CharSequence eventText = stringOrSpannedStringWithoutNoCopySpans(text);

        final int composingStart;
        final int composingEnd;
+3 −10
Original line number Diff line number Diff line
@@ -1052,21 +1052,14 @@ public final class ViewNode extends AssistStructure.ViewNode {
        }

        void writeToParcel(Parcel out, boolean simple) {
            CharSequence text = TextUtils.trimToParcelableSize(mText);
            TextUtils.writeToParcel(text, out, 0);
            TextUtils.writeToParcel(mText, out, 0);
            out.writeFloat(mTextSize);
            out.writeInt(mTextStyle);
            out.writeInt(mTextColor);
            if (!simple) {
                int selectionStart = text != null
                        ? Math.min(mTextSelectionStart, text.length())
                        : mTextSelectionStart;
                int selectionEnd = text != null
                        ? Math.min(mTextSelectionEnd, text.length())
                        : mTextSelectionEnd;
                out.writeInt(mTextBackgroundColor);
                out.writeInt(selectionStart);
                out.writeInt(selectionEnd);
                out.writeInt(mTextSelectionStart);
                out.writeInt(mTextSelectionEnd);
                out.writeIntArray(mLineCharOffsets);
                out.writeIntArray(mLineBaselines);
                out.writeString(mHint);
+1 −2
Original line number Diff line number Diff line
@@ -13631,8 +13631,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    @Nullable
    public AutofillValue getAutofillValue() {
        if (isTextEditable()) {
            final CharSequence text =
                    TextUtils.trimToParcelableSize(TextUtils.trimNoCopySpans(getText()));
            final CharSequence text = TextUtils.trimToParcelableSize(getText());
            return AutofillValue.forText(text);
        }
        return null;