Loading core/java/android/view/contentcapture/MainContentCaptureSession.java +2 −1 Original line number Diff line number Diff line Loading @@ -740,7 +740,8 @@ 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 = stringOrSpannedStringWithoutNoCopySpans(text); final CharSequence eventText = TextUtils.trimToParcelableSize(stringOrSpannedStringWithoutNoCopySpans(text)); final int composingStart; final int composingEnd; Loading core/java/android/view/contentcapture/ViewNode.java +10 −3 Original line number Diff line number Diff line Loading @@ -1052,14 +1052,21 @@ public final class ViewNode extends AssistStructure.ViewNode { } void writeToParcel(Parcel out, boolean simple) { TextUtils.writeToParcel(mText, out, 0); CharSequence text = TextUtils.trimToParcelableSize(mText); TextUtils.writeToParcel(text, 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(mTextSelectionStart); out.writeInt(mTextSelectionEnd); out.writeInt(selectionStart); out.writeInt(selectionEnd); out.writeIntArray(mLineCharOffsets); out.writeIntArray(mLineBaselines); out.writeString(mHint); Loading core/java/android/widget/TextView.java +2 −1 Original line number Diff line number Diff line Loading @@ -13601,7 +13601,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @Nullable public AutofillValue getAutofillValue() { if (isTextEditable()) { final CharSequence text = TextUtils.trimToParcelableSize(getText()); final CharSequence text = TextUtils.trimToParcelableSize(TextUtils.trimNoCopySpans(getText())); return AutofillValue.forText(text); } return null; Loading
core/java/android/view/contentcapture/MainContentCaptureSession.java +2 −1 Original line number Diff line number Diff line Loading @@ -740,7 +740,8 @@ 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 = stringOrSpannedStringWithoutNoCopySpans(text); final CharSequence eventText = TextUtils.trimToParcelableSize(stringOrSpannedStringWithoutNoCopySpans(text)); final int composingStart; final int composingEnd; Loading
core/java/android/view/contentcapture/ViewNode.java +10 −3 Original line number Diff line number Diff line Loading @@ -1052,14 +1052,21 @@ public final class ViewNode extends AssistStructure.ViewNode { } void writeToParcel(Parcel out, boolean simple) { TextUtils.writeToParcel(mText, out, 0); CharSequence text = TextUtils.trimToParcelableSize(mText); TextUtils.writeToParcel(text, 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(mTextSelectionStart); out.writeInt(mTextSelectionEnd); out.writeInt(selectionStart); out.writeInt(selectionEnd); out.writeIntArray(mLineCharOffsets); out.writeIntArray(mLineBaselines); out.writeString(mHint); Loading
core/java/android/widget/TextView.java +2 −1 Original line number Diff line number Diff line Loading @@ -13601,7 +13601,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @Nullable public AutofillValue getAutofillValue() { if (isTextEditable()) { final CharSequence text = TextUtils.trimToParcelableSize(getText()); final CharSequence text = TextUtils.trimToParcelableSize(TextUtils.trimNoCopySpans(getText())); return AutofillValue.forText(text); } return null;