summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ivan Chiang <chiangi@google.com> 2018-12-10 07:00:06 -0800
committer android-build-merger <android-build-merger@google.com> 2018-12-10 07:00:06 -0800
commit1be68938ebde810d65f30ca8e61557602c7f8907 (patch)
treecb6063fce4097b6298cf78fd3de161dacea8505f
parent9867b60f39fd25479d6ad6f8ce0763d1551efe6f (diff)
parent17f9b9bfb66be366e874ed98d52a622e0b97df2a (diff)
Merge "Expose Uri toSafeString api"
am: 17f9b9bfb6 Change-Id: I26873145668dc451ff1324d7664c386d9223a6c4
-rwxr-xr-xapi/current.txt1
-rw-r--r--core/java/android/net/Uri.java9
2 files changed, 6 insertions, 4 deletions
diff --git a/api/current.txt b/api/current.txt
index 236288ccb82e..0eb6985de2d9 100755
--- a/api/current.txt
+++ b/api/current.txt
@@ -27783,6 +27783,7 @@ package android.net {
method public abstract boolean isRelative();
method public android.net.Uri normalizeScheme();
method public static android.net.Uri parse(java.lang.String);
+ method public java.lang.String toSafeString();
method public abstract java.lang.String toString();
method public static android.net.Uri withAppendedPath(android.net.Uri, java.lang.String);
method public static void writeToParcel(android.os.Parcel, android.net.Uri);
diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java
index d09f33bcb755..af3ee0911d2f 100644
--- a/core/java/android/net/Uri.java
+++ b/core/java/android/net/Uri.java
@@ -374,11 +374,12 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
public abstract String toString();
/**
- * Return a string representation of the URI that is safe to print
- * to logs and other places where PII should be avoided.
- * @hide
+ * Return a string representation of this URI that has common forms of PII redacted,
+ * making it safer to use for logging purposes. For example, {@code tel:800-466-4411} is
+ * returned as {@code tel:xxx-xxx-xxxx} and {@code http://example.com/path/to/item/} is
+ * returned as {@code http://example.com/...}.
+ * @return the common forms PII redacted string of this URI
*/
- @UnsupportedAppUsage
public String toSafeString() {
String scheme = getScheme();
String ssp = getSchemeSpecificPart();