Loading core/java/android/content/ClipData.java +58 −47 Original line number Diff line number Diff line Loading @@ -651,45 +651,57 @@ public class ClipData implements Parcelable { StringBuilder b = new StringBuilder(128); b.append("ClipData.Item { "); toShortString(b); toShortString(b, true); b.append(" }"); return b.toString(); } /** @hide */ public void toShortString(StringBuilder b) { /** * Appends this item to the given builder. * @param redactContent If true, redacts common forms of PII; otherwise appends full * details. * @hide */ public void toShortString(StringBuilder b, boolean redactContent) { boolean first = true; if (mHtmlText != null) { b.append("H:"); b.append(mHtmlText); } else if (mText != null) { b.append("T:"); b.append(mText); } else if (mUri != null) { b.append("U:"); b.append(mUri); } else if (mIntent != null) { b.append("I:"); mIntent.toShortString(b, true, true, true, true); first = false; if (redactContent) { b.append("H(").append(mHtmlText.length()).append(')'); } else { b.append("NULL"); b.append("H:").append(mHtmlText); } } /** @hide */ public void toShortSummaryString(StringBuilder b) { if (mHtmlText != null) { b.append("HTML"); } else if (mText != null) { b.append("TEXT"); } else if (mUri != null) { b.append("U:"); b.append(mUri); } else if (mIntent != null) { b.append("I:"); mIntent.toShortString(b, true, true, true, true); if (mText != null) { if (!first) { b.append(' '); } first = false; if (redactContent) { b.append("T(").append(mText.length()).append(')'); } else { b.append("T:").append(mText); } } if (mUri != null) { if (!first) { b.append(' '); } first = false; if (redactContent) { b.append("U(").append(mUri.getScheme()).append(')'); } else { b.append("NULL"); b.append("U:").append(mUri); } } if (mIntent != null) { if (!first) { b.append(' '); } first = false; b.append("I:"); mIntent.toShortString(b, redactContent, true, true, true); } } Loading Loading @@ -1040,17 +1052,21 @@ public class ClipData implements Parcelable { StringBuilder b = new StringBuilder(128); b.append("ClipData { "); toShortString(b); toShortString(b, true); b.append(" }"); return b.toString(); } /** @hide */ public void toShortString(StringBuilder b) { /** * Appends this clip to the given builder. * @param redactContent If true, redacts common forms of PII; otherwise appends full details. * @hide */ public void toShortString(StringBuilder b, boolean redactContent) { boolean first; if (mClipDescription != null) { first = !mClipDescription.toShortString(b); first = !mClipDescription.toShortString(b, redactContent); } else { first = true; } Loading @@ -1064,26 +1080,21 @@ public class ClipData implements Parcelable { b.append('x'); b.append(mIcon.getHeight()); } for (int i=0; i<mItems.size(); i++) { if (mItems.size() != 1) { if (!first) { b.append(' '); } first = false; b.append('{'); mItems.get(i).toShortString(b); b.append('}'); b.append(mItems.size()).append(" items:"); } } /** @hide */ public void toShortStringShortItems(StringBuilder b, boolean first) { if (mItems.size() > 0) { for (int i = 0; i < mItems.size(); i++) { if (!first) { b.append(' '); } for (int i=0; i<mItems.size(); i++) { b.append("{...}"); } first = false; b.append('{'); mItems.get(i).toShortString(b, redactContent); b.append('}'); } } Loading core/java/android/content/ClipDescription.java +22 −7 Original line number Diff line number Diff line Loading @@ -330,31 +330,46 @@ public class ClipDescription implements Parcelable { StringBuilder b = new StringBuilder(128); b.append("ClipDescription { "); toShortString(b); toShortString(b, true); b.append(" }"); return b.toString(); } /** @hide */ public boolean toShortString(StringBuilder b) { /** * Appends this description to the given builder. * @param redactContent If true, redacts common forms of PII; otherwise appends full details. * @hide */ public boolean toShortString(StringBuilder b, boolean redactContent) { boolean first = !toShortStringTypesOnly(b); if (mLabel != null) { if (!first) { b.append(' '); } first = false; b.append('"'); b.append(mLabel); b.append('"'); if (redactContent) { b.append("hasLabel(").append(mLabel.length()).append(')'); } else { b.append('"').append(mLabel).append('"'); } } if (mExtras != null) { if (!first) { b.append(' '); } first = false; if (redactContent) { if (mExtras.isParcelled()) { // We don't want this toString function to trigger un-parcelling. b.append("hasExtras"); } else { b.append("hasExtras(").append(mExtras.size()).append(')'); } } else { b.append(mExtras.toString()); } } if (mTimeStamp > 0) { if (!first) { b.append(' '); Loading core/java/android/content/Intent.java +2 −26 Original line number Diff line number Diff line Loading @@ -10484,17 +10484,6 @@ public class Intent implements Parcelable, Cloneable { return b.toString(); } /** @hide */ public String toInsecureStringWithClip() { StringBuilder b = new StringBuilder(128); b.append("Intent { "); toShortString(b, false, true, true, true); b.append(" }"); return b.toString(); } /** @hide */ public String toShortString(boolean secure, boolean comp, boolean extras, boolean clip) { StringBuilder b = new StringBuilder(128); Loading Loading @@ -10581,16 +10570,7 @@ public class Intent implements Parcelable, Cloneable { b.append(' '); } b.append("clip={"); if (clip) { mClipData.toShortString(b); } else { if (mClipData.getDescription() != null) { first = !mClipData.getDescription().toShortStringTypesOnly(b); } else { first = true; } mClipData.toShortStringShortItems(b, first); } mClipData.toShortString(b, !clip || secure); first = false; b.append('}'); } Loading Loading @@ -10668,11 +10648,7 @@ public class Intent implements Parcelable, Cloneable { } if (mClipData != null) { StringBuilder b = new StringBuilder(); if (clip) { mClipData.toShortString(b); } else { mClipData.toShortStringShortItems(b, false); } mClipData.toShortString(b, !clip || secure); proto.write(IntentProto.CLIP_DATA, b.toString()); } if (extras && mExtras != null) { Loading Loading
core/java/android/content/ClipData.java +58 −47 Original line number Diff line number Diff line Loading @@ -651,45 +651,57 @@ public class ClipData implements Parcelable { StringBuilder b = new StringBuilder(128); b.append("ClipData.Item { "); toShortString(b); toShortString(b, true); b.append(" }"); return b.toString(); } /** @hide */ public void toShortString(StringBuilder b) { /** * Appends this item to the given builder. * @param redactContent If true, redacts common forms of PII; otherwise appends full * details. * @hide */ public void toShortString(StringBuilder b, boolean redactContent) { boolean first = true; if (mHtmlText != null) { b.append("H:"); b.append(mHtmlText); } else if (mText != null) { b.append("T:"); b.append(mText); } else if (mUri != null) { b.append("U:"); b.append(mUri); } else if (mIntent != null) { b.append("I:"); mIntent.toShortString(b, true, true, true, true); first = false; if (redactContent) { b.append("H(").append(mHtmlText.length()).append(')'); } else { b.append("NULL"); b.append("H:").append(mHtmlText); } } /** @hide */ public void toShortSummaryString(StringBuilder b) { if (mHtmlText != null) { b.append("HTML"); } else if (mText != null) { b.append("TEXT"); } else if (mUri != null) { b.append("U:"); b.append(mUri); } else if (mIntent != null) { b.append("I:"); mIntent.toShortString(b, true, true, true, true); if (mText != null) { if (!first) { b.append(' '); } first = false; if (redactContent) { b.append("T(").append(mText.length()).append(')'); } else { b.append("T:").append(mText); } } if (mUri != null) { if (!first) { b.append(' '); } first = false; if (redactContent) { b.append("U(").append(mUri.getScheme()).append(')'); } else { b.append("NULL"); b.append("U:").append(mUri); } } if (mIntent != null) { if (!first) { b.append(' '); } first = false; b.append("I:"); mIntent.toShortString(b, redactContent, true, true, true); } } Loading Loading @@ -1040,17 +1052,21 @@ public class ClipData implements Parcelable { StringBuilder b = new StringBuilder(128); b.append("ClipData { "); toShortString(b); toShortString(b, true); b.append(" }"); return b.toString(); } /** @hide */ public void toShortString(StringBuilder b) { /** * Appends this clip to the given builder. * @param redactContent If true, redacts common forms of PII; otherwise appends full details. * @hide */ public void toShortString(StringBuilder b, boolean redactContent) { boolean first; if (mClipDescription != null) { first = !mClipDescription.toShortString(b); first = !mClipDescription.toShortString(b, redactContent); } else { first = true; } Loading @@ -1064,26 +1080,21 @@ public class ClipData implements Parcelable { b.append('x'); b.append(mIcon.getHeight()); } for (int i=0; i<mItems.size(); i++) { if (mItems.size() != 1) { if (!first) { b.append(' '); } first = false; b.append('{'); mItems.get(i).toShortString(b); b.append('}'); b.append(mItems.size()).append(" items:"); } } /** @hide */ public void toShortStringShortItems(StringBuilder b, boolean first) { if (mItems.size() > 0) { for (int i = 0; i < mItems.size(); i++) { if (!first) { b.append(' '); } for (int i=0; i<mItems.size(); i++) { b.append("{...}"); } first = false; b.append('{'); mItems.get(i).toShortString(b, redactContent); b.append('}'); } } Loading
core/java/android/content/ClipDescription.java +22 −7 Original line number Diff line number Diff line Loading @@ -330,31 +330,46 @@ public class ClipDescription implements Parcelable { StringBuilder b = new StringBuilder(128); b.append("ClipDescription { "); toShortString(b); toShortString(b, true); b.append(" }"); return b.toString(); } /** @hide */ public boolean toShortString(StringBuilder b) { /** * Appends this description to the given builder. * @param redactContent If true, redacts common forms of PII; otherwise appends full details. * @hide */ public boolean toShortString(StringBuilder b, boolean redactContent) { boolean first = !toShortStringTypesOnly(b); if (mLabel != null) { if (!first) { b.append(' '); } first = false; b.append('"'); b.append(mLabel); b.append('"'); if (redactContent) { b.append("hasLabel(").append(mLabel.length()).append(')'); } else { b.append('"').append(mLabel).append('"'); } } if (mExtras != null) { if (!first) { b.append(' '); } first = false; if (redactContent) { if (mExtras.isParcelled()) { // We don't want this toString function to trigger un-parcelling. b.append("hasExtras"); } else { b.append("hasExtras(").append(mExtras.size()).append(')'); } } else { b.append(mExtras.toString()); } } if (mTimeStamp > 0) { if (!first) { b.append(' '); Loading
core/java/android/content/Intent.java +2 −26 Original line number Diff line number Diff line Loading @@ -10484,17 +10484,6 @@ public class Intent implements Parcelable, Cloneable { return b.toString(); } /** @hide */ public String toInsecureStringWithClip() { StringBuilder b = new StringBuilder(128); b.append("Intent { "); toShortString(b, false, true, true, true); b.append(" }"); return b.toString(); } /** @hide */ public String toShortString(boolean secure, boolean comp, boolean extras, boolean clip) { StringBuilder b = new StringBuilder(128); Loading Loading @@ -10581,16 +10570,7 @@ public class Intent implements Parcelable, Cloneable { b.append(' '); } b.append("clip={"); if (clip) { mClipData.toShortString(b); } else { if (mClipData.getDescription() != null) { first = !mClipData.getDescription().toShortStringTypesOnly(b); } else { first = true; } mClipData.toShortStringShortItems(b, first); } mClipData.toShortString(b, !clip || secure); first = false; b.append('}'); } Loading Loading @@ -10668,11 +10648,7 @@ public class Intent implements Parcelable, Cloneable { } if (mClipData != null) { StringBuilder b = new StringBuilder(); if (clip) { mClipData.toShortString(b); } else { mClipData.toShortStringShortItems(b, false); } mClipData.toShortString(b, !clip || secure); proto.write(IntentProto.CLIP_DATA, b.toString()); } if (extras && mExtras != null) { Loading