Merge "Prevent poorly-extended ParcelableSpans from writing to parcels" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5299968517
@@ -38,6 +38,11 @@ public class Annotation implements ParcelableSpan {
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.ANNOTATION;
|
||||
}
|
||||
|
||||
@@ -46,6 +51,11 @@ public class Annotation implements ParcelableSpan {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeString(mKey);
|
||||
dest.writeString(mValue);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.text;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
@@ -27,5 +28,21 @@ public interface ParcelableSpan extends Parcelable {
|
||||
/**
|
||||
* Return a special type identifier for this span class.
|
||||
*/
|
||||
public abstract int getSpanTypeId();
|
||||
int getSpanTypeId();
|
||||
|
||||
/**
|
||||
* Internal implementation of {@link #getSpanTypeId()} that is not meant to
|
||||
* be overridden outside of the framework.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
int getSpanTypeIdInternal();
|
||||
|
||||
/**
|
||||
* Internal implementation of {@link Parcelable#writeToParcel(Parcel, int)}
|
||||
* that is not meant to be overridden outside of the framework.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
void writeToParcelInternal(Parcel dest, int flags);
|
||||
}
|
||||
|
||||
@@ -622,8 +622,7 @@ public class TextUtils {
|
||||
* Flatten a CharSequence and whatever styles can be copied across processes
|
||||
* into the parcel.
|
||||
*/
|
||||
public static void writeToParcel(CharSequence cs, Parcel p,
|
||||
int parcelableFlags) {
|
||||
public static void writeToParcel(CharSequence cs, Parcel p, int parcelableFlags) {
|
||||
if (cs instanceof Spanned) {
|
||||
p.writeInt(0);
|
||||
p.writeString(cs.toString());
|
||||
@@ -645,15 +644,15 @@ public class TextUtils {
|
||||
}
|
||||
|
||||
if (prop instanceof ParcelableSpan) {
|
||||
ParcelableSpan ps = (ParcelableSpan)prop;
|
||||
int spanTypeId = ps.getSpanTypeId();
|
||||
final ParcelableSpan ps = (ParcelableSpan) prop;
|
||||
final int spanTypeId = ps.getSpanTypeIdInternal();
|
||||
if (spanTypeId < FIRST_SPAN || spanTypeId > LAST_SPAN) {
|
||||
Log.e(TAG, "external class \"" + ps.getClass().getSimpleName()
|
||||
Log.e(TAG, "External class \"" + ps.getClass().getSimpleName()
|
||||
+ "\" is attempting to use the frameworks-only ParcelableSpan"
|
||||
+ " interface");
|
||||
} else {
|
||||
p.writeInt(spanTypeId);
|
||||
ps.writeToParcel(p, parcelableFlags);
|
||||
ps.writeToParcelInternal(p, parcelableFlags);
|
||||
writeWhere(p, sp, o);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,11 @@ public class AbsoluteSizeSpan extends MetricAffectingSpan implements ParcelableS
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.ABSOLUTE_SIZE_SPAN;
|
||||
}
|
||||
|
||||
@@ -57,6 +62,11 @@ public class AbsoluteSizeSpan extends MetricAffectingSpan implements ParcelableS
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeInt(mSize);
|
||||
dest.writeInt(mDip ? 1 : 0);
|
||||
}
|
||||
|
||||
@@ -22,10 +22,9 @@ import android.text.ParcelableSpan;
|
||||
import android.text.TextUtils;
|
||||
|
||||
public interface AlignmentSpan extends ParagraphStyle {
|
||||
public Layout.Alignment getAlignment();
|
||||
Layout.Alignment getAlignment();
|
||||
|
||||
public static class Standard
|
||||
implements AlignmentSpan, ParcelableSpan {
|
||||
class Standard implements AlignmentSpan, ParcelableSpan {
|
||||
public Standard(Layout.Alignment align) {
|
||||
mAlignment = align;
|
||||
}
|
||||
@@ -35,6 +34,11 @@ public interface AlignmentSpan extends ParagraphStyle {
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.ALIGNMENT_SPAN;
|
||||
}
|
||||
|
||||
@@ -43,6 +47,11 @@ public interface AlignmentSpan extends ParagraphStyle {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeString(mAlignment.name());
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,11 @@ public class BackgroundColorSpan extends CharacterStyle
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.BACKGROUND_COLOR_SPAN;
|
||||
}
|
||||
|
||||
@@ -43,6 +48,11 @@ public class BackgroundColorSpan extends CharacterStyle
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeInt(mColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,11 @@ public class BulletSpan implements LeadingMarginSpan, ParcelableSpan {
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.BULLET_SPAN;
|
||||
}
|
||||
|
||||
@@ -68,6 +73,11 @@ public class BulletSpan implements LeadingMarginSpan, ParcelableSpan {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeInt(mGapWidth);
|
||||
dest.writeInt(mWantColor ? 1 : 0);
|
||||
dest.writeInt(mColor);
|
||||
|
||||
@@ -91,12 +91,22 @@ public class EasyEditSpan implements ParcelableSpan {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeParcelable(mPendingIntent, 0);
|
||||
dest.writeByte((byte) (mDeleteEnabled ? 1 : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.EASY_EDIT_SPAN;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,14 +36,24 @@ public class ForegroundColorSpan extends CharacterStyle
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.FOREGROUND_COLOR_SPAN;
|
||||
}
|
||||
|
||||
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeInt(mColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,6 +125,11 @@ extends ParagraphStyle
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.LEADING_MARGIN_SPAN;
|
||||
}
|
||||
|
||||
@@ -133,6 +138,11 @@ extends ParagraphStyle
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeInt(mFirst);
|
||||
dest.writeInt(mRest);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,11 @@ public class LocaleSpan extends MetricAffectingSpan implements ParcelableSpan {
|
||||
|
||||
@Override
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.LOCALE_SPAN;
|
||||
}
|
||||
|
||||
@@ -54,6 +59,11 @@ public class LocaleSpan extends MetricAffectingSpan implements ParcelableSpan {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeString(mLocale.getLanguage());
|
||||
dest.writeString(mLocale.getCountry());
|
||||
dest.writeString(mLocale.getVariant());
|
||||
|
||||
@@ -45,6 +45,11 @@ public class QuoteSpan implements LeadingMarginSpan, ParcelableSpan {
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.QUOTE_SPAN;
|
||||
}
|
||||
|
||||
@@ -53,6 +58,11 @@ public class QuoteSpan implements LeadingMarginSpan, ParcelableSpan {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeInt(mColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,11 @@ public class RelativeSizeSpan extends MetricAffectingSpan implements ParcelableS
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.RELATIVE_SIZE_SPAN;
|
||||
}
|
||||
|
||||
@@ -42,6 +47,11 @@ public class RelativeSizeSpan extends MetricAffectingSpan implements ParcelableS
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeFloat(mProportion);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,11 @@ public class ScaleXSpan extends MetricAffectingSpan implements ParcelableSpan {
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.SCALE_X_SPAN;
|
||||
}
|
||||
|
||||
@@ -42,6 +47,11 @@ public class ScaleXSpan extends MetricAffectingSpan implements ParcelableSpan {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeFloat(mProportion);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,11 +54,21 @@ public class SpellCheckSpan implements ParcelableSpan {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeInt(mSpellCheckInProgress ? 1 : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.SPELL_CHECK_SPAN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,11 @@ public class StrikethroughSpan extends CharacterStyle
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.STRIKETHROUGH_SPAN;
|
||||
}
|
||||
|
||||
@@ -38,6 +43,11 @@ public class StrikethroughSpan extends CharacterStyle
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,6 +50,11 @@ public class StyleSpan extends MetricAffectingSpan implements ParcelableSpan {
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.STYLE_SPAN;
|
||||
}
|
||||
|
||||
@@ -58,6 +63,11 @@ public class StyleSpan extends MetricAffectingSpan implements ParcelableSpan {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeInt(mStyle);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,11 @@ public class SubscriptSpan extends MetricAffectingSpan implements ParcelableSpan
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.SUBSCRIPT_SPAN;
|
||||
}
|
||||
|
||||
@@ -37,6 +42,11 @@ public class SubscriptSpan extends MetricAffectingSpan implements ParcelableSpan
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,11 +46,21 @@ public class SuggestionRangeSpan extends CharacterStyle implements ParcelableSpa
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeInt(mBackgroundColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.SUGGESTION_RANGE_SPAN;
|
||||
}
|
||||
|
||||
|
||||
@@ -248,6 +248,11 @@ public class SuggestionSpan extends CharacterStyle implements ParcelableSpan {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeStringArray(mSuggestions);
|
||||
dest.writeInt(mFlags);
|
||||
dest.writeString(mLocaleString);
|
||||
@@ -264,6 +269,11 @@ public class SuggestionSpan extends CharacterStyle implements ParcelableSpan {
|
||||
|
||||
@Override
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.SUGGESTION_SPAN;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,11 @@ public class SuperscriptSpan extends MetricAffectingSpan implements ParcelableSp
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.SUPERSCRIPT_SPAN;
|
||||
}
|
||||
|
||||
@@ -37,6 +42,11 @@ public class SuperscriptSpan extends MetricAffectingSpan implements ParcelableSp
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -136,6 +136,11 @@ public class TextAppearanceSpan extends MetricAffectingSpan implements Parcelabl
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.TEXT_APPEARANCE_SPAN;
|
||||
}
|
||||
|
||||
@@ -144,6 +149,11 @@ public class TextAppearanceSpan extends MetricAffectingSpan implements Parcelabl
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeString(mTypeface);
|
||||
dest.writeInt(mStyle);
|
||||
dest.writeInt(mTextSize);
|
||||
|
||||
@@ -495,12 +495,22 @@ public class TtsSpan implements ParcelableSpan {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeString(mType);
|
||||
dest.writePersistableBundle(mArgs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.TTS_SPAN;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,11 @@ public class TypefaceSpan extends MetricAffectingSpan implements ParcelableSpan
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.TYPEFACE_SPAN;
|
||||
}
|
||||
|
||||
@@ -50,6 +55,11 @@ public class TypefaceSpan extends MetricAffectingSpan implements ParcelableSpan
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeString(mFamily);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,11 @@ public class URLSpan extends ClickableSpan implements ParcelableSpan {
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.URL_SPAN;
|
||||
}
|
||||
|
||||
@@ -48,6 +53,11 @@ public class URLSpan extends ClickableSpan implements ParcelableSpan {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
dest.writeString(mURL);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,11 @@ public class UnderlineSpan extends CharacterStyle
|
||||
}
|
||||
|
||||
public int getSpanTypeId() {
|
||||
return getSpanTypeIdInternal();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getSpanTypeIdInternal() {
|
||||
return TextUtils.UNDERLINE_SPAN;
|
||||
}
|
||||
|
||||
@@ -38,6 +43,11 @@ public class UnderlineSpan extends CharacterStyle
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
writeToParcelInternal(dest, flags);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void writeToParcelInternal(Parcel dest, int flags) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1044,42 +1044,26 @@ class CCParser {
|
||||
}
|
||||
|
||||
/**
|
||||
* Mutable version of BackgroundSpan to facilitate text rendering with edge
|
||||
* styles.
|
||||
*
|
||||
* @hide
|
||||
*
|
||||
* MutableBackgroundColorSpan
|
||||
*
|
||||
* This is a mutable version of BackgroundSpan to facilitate text
|
||||
* rendering with edge styles.
|
||||
*
|
||||
*/
|
||||
class MutableBackgroundColorSpan extends CharacterStyle
|
||||
implements UpdateAppearance, ParcelableSpan {
|
||||
class MutableBackgroundColorSpan extends CharacterStyle implements UpdateAppearance {
|
||||
private int mColor;
|
||||
|
||||
public MutableBackgroundColorSpan(int color) {
|
||||
mColor = color;
|
||||
}
|
||||
public MutableBackgroundColorSpan(Parcel src) {
|
||||
mColor = src.readInt();
|
||||
}
|
||||
|
||||
public void setBackgroundColor(int color) {
|
||||
mColor = color;
|
||||
}
|
||||
|
||||
public int getBackgroundColor() {
|
||||
return mColor;
|
||||
}
|
||||
@Override
|
||||
public int getSpanTypeId() {
|
||||
return TextUtils.BACKGROUND_COLOR_SPAN;
|
||||
}
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDrawState(TextPaint ds) {
|
||||
ds.bgColor = mColor;
|
||||
|
||||
Reference in New Issue
Block a user