Loading src/com/android/documentsui/Metrics.java +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.documentsui; import static android.content.ContentResolver.wrap; import static com.android.documentsui.DocumentsApplication.acquireUnstableProviderOrThrow; import static com.android.documentsui.base.SharedMinimal.redact; import android.content.ContentProviderClient; import android.content.Context; Loading Loading @@ -640,7 +641,7 @@ public final class Metrics { try { return DocumentsContract.getRootId(uri); } catch (IllegalArgumentException iae) { Log.w(TAG, "Invalid root Uri " + uri.toSafeString()); Log.w(TAG, "Invalid root Uri " + redact(uri)); } return null; } Loading src/com/android/documentsui/base/DocumentInfo.java +3 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.documentsui.base; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.SharedMinimal.redact; import static com.android.documentsui.util.FlagUtils.isZipNgFlagEnabled; import android.content.ContentProviderClient; Loading Loading @@ -446,10 +447,8 @@ public class DocumentInfo implements Durable, Parcelable { final String type = resolver.getType(uri); if (type != null) { mimeTypes.add(type); } else { if (DEBUG) { Log.d(TAG, "resolver.getType(uri) return null, url:" + uri.toSafeString()); } } else if (DEBUG) { Log.d(TAG, "resolver.getType(" + redact(uri) + ") returned null"); } final String[] streamTypes = resolver.getStreamTypes(uri, "*/*"); if (streamTypes != null) { Loading src/com/android/documentsui/base/SharedMinimal.java +17 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.documentsui.base; import android.net.Uri; import android.os.Build; import android.util.Log; Loading @@ -36,4 +37,20 @@ public final class SharedMinimal { private SharedMinimal() { throw new UnsupportedOperationException("provides static fields only"); } /** * Gets a redacted string representation of the given object. Can be used to redact file names, * file paths or URIs in log messages. */ public static String redact(Object o) { if (o == null) return "(null)"; if (DEBUG) { if (o instanceof Uri) return o.toString(); return "'" + o.toString() + "'"; } if (o instanceof Uri) return ((Uri) o).toSafeString(); return "(redacted)"; } } src/com/android/documentsui/dirlist/DirectoryFragment.java +2 −11 Original line number Diff line number Diff line Loading @@ -1439,9 +1439,7 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On public static void showDirectory( FragmentManager fm, RootInfo root, DocumentInfo doc, int anim) { if (DEBUG) { Log.d(TAG, "Showing directory: " + DocumentInfo.debugString(doc)); } if (DEBUG) Log.d(TAG, "Showing dir " + doc); create(fm, root, doc, anim); } Loading @@ -1454,14 +1452,7 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On RootInfo root, @Nullable DocumentInfo doc, @AnimationType int anim) { if (DEBUG) { if (doc == null) { Log.d(TAG, "Creating new fragment null directory"); } else { Log.d(TAG, "Creating new fragment for directory: " + DocumentInfo.debugString(doc)); } } if (DEBUG) Log.d(TAG, "Creating new fragment for dir " + doc); final Bundle args = new Bundle(); args.putParcelable(Shared.EXTRA_ROOT, root); Loading Loading
src/com/android/documentsui/Metrics.java +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.documentsui; import static android.content.ContentResolver.wrap; import static com.android.documentsui.DocumentsApplication.acquireUnstableProviderOrThrow; import static com.android.documentsui.base.SharedMinimal.redact; import android.content.ContentProviderClient; import android.content.Context; Loading Loading @@ -640,7 +641,7 @@ public final class Metrics { try { return DocumentsContract.getRootId(uri); } catch (IllegalArgumentException iae) { Log.w(TAG, "Invalid root Uri " + uri.toSafeString()); Log.w(TAG, "Invalid root Uri " + redact(uri)); } return null; } Loading
src/com/android/documentsui/base/DocumentInfo.java +3 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.documentsui.base; import static com.android.documentsui.base.SharedMinimal.DEBUG; import static com.android.documentsui.base.SharedMinimal.redact; import static com.android.documentsui.util.FlagUtils.isZipNgFlagEnabled; import android.content.ContentProviderClient; Loading Loading @@ -446,10 +447,8 @@ public class DocumentInfo implements Durable, Parcelable { final String type = resolver.getType(uri); if (type != null) { mimeTypes.add(type); } else { if (DEBUG) { Log.d(TAG, "resolver.getType(uri) return null, url:" + uri.toSafeString()); } } else if (DEBUG) { Log.d(TAG, "resolver.getType(" + redact(uri) + ") returned null"); } final String[] streamTypes = resolver.getStreamTypes(uri, "*/*"); if (streamTypes != null) { Loading
src/com/android/documentsui/base/SharedMinimal.java +17 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.documentsui.base; import android.net.Uri; import android.os.Build; import android.util.Log; Loading @@ -36,4 +37,20 @@ public final class SharedMinimal { private SharedMinimal() { throw new UnsupportedOperationException("provides static fields only"); } /** * Gets a redacted string representation of the given object. Can be used to redact file names, * file paths or URIs in log messages. */ public static String redact(Object o) { if (o == null) return "(null)"; if (DEBUG) { if (o instanceof Uri) return o.toString(); return "'" + o.toString() + "'"; } if (o instanceof Uri) return ((Uri) o).toSafeString(); return "(redacted)"; } }
src/com/android/documentsui/dirlist/DirectoryFragment.java +2 −11 Original line number Diff line number Diff line Loading @@ -1439,9 +1439,7 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On public static void showDirectory( FragmentManager fm, RootInfo root, DocumentInfo doc, int anim) { if (DEBUG) { Log.d(TAG, "Showing directory: " + DocumentInfo.debugString(doc)); } if (DEBUG) Log.d(TAG, "Showing dir " + doc); create(fm, root, doc, anim); } Loading @@ -1454,14 +1452,7 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On RootInfo root, @Nullable DocumentInfo doc, @AnimationType int anim) { if (DEBUG) { if (doc == null) { Log.d(TAG, "Creating new fragment null directory"); } else { Log.d(TAG, "Creating new fragment for directory: " + DocumentInfo.debugString(doc)); } } if (DEBUG) Log.d(TAG, "Creating new fragment for dir " + doc); final Bundle args = new Bundle(); args.putParcelable(Shared.EXTRA_ROOT, root); Loading