From ae498721001c6cdcdb6cce1b2f3ba5abbce36f8a Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 14 Aug 2015 13:29:47 -0700 Subject: Add debugging for issue #23190084: [APPComm][Dev Test] {Unable to share photo... ...from Camera360 to Hangouts } In the short URI toString, include a small summary of the ClipData (instead of just saying it has a clip data). This makes it a lot easier to understand what is happening when you look at the log of activity starts. Also separate out the activity manager dump of URI permission grants from its dump of providers, so it is easy to just look at that state. Change-Id: I68093d9f279944e1aa9a29347075f237f4f55ed3 --- core/java/android/content/ClipData.java | 30 ++++++++++++++++++++++++++ core/java/android/content/ClipDescription.java | 20 +++++++++++------ core/java/android/content/Intent.java | 13 +++++++---- 3 files changed, 52 insertions(+), 11 deletions(-) (limited to 'core') diff --git a/core/java/android/content/ClipData.java b/core/java/android/content/ClipData.java index 0cafff8..c934e8d 100644 --- a/core/java/android/content/ClipData.java +++ b/core/java/android/content/ClipData.java @@ -609,6 +609,23 @@ public class ClipData implements Parcelable { b.append("NULL"); } } + + /** @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); + } else { + b.append("NULL"); + } + } } /** @@ -884,6 +901,19 @@ public class ClipData implements Parcelable { } } + /** @hide */ + public void toShortStringShortItems(StringBuilder b, boolean first) { + if (mItems.size() > 0) { + if (!first) { + b.append(' '); + } + mItems.get(0).toShortString(b); + if (mItems.size() > 1) { + b.append(" ..."); + } + } + } + @Override public int describeContents() { return 0; diff --git a/core/java/android/content/ClipDescription.java b/core/java/android/content/ClipDescription.java index be35f08..e988516 100644 --- a/core/java/android/content/ClipDescription.java +++ b/core/java/android/content/ClipDescription.java @@ -201,22 +201,28 @@ public class ClipDescription implements Parcelable { /** @hide */ public boolean toShortString(StringBuilder b) { - boolean first = true; - for (int i=0; i