summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/ConnectionRequest.java
diff options
context:
space:
mode:
authorShi Yuanjie <yuanjie.shi@sony.com>2018-07-19 20:30:10 +0900
committerTyler Gunn <tgunn@google.com>2019-01-31 18:23:37 +0000
commitafea7de9b95d81c4c2be4343fdf0e3bf8af06c3e (patch)
treec62ea9a92e3ccb8905f1691b6d71646bdefac929 /telecomm/java/android/telecom/ConnectionRequest.java
parenta5a7af11d7023fdd19b9dec9b5c42cccda0c3157 (diff)
Fix to hide phone number printed in the log
The ConnectionRequest and ImsConferenceState fields may include phone numbers and it is output to the log. Since PII should not be printed in the log, mask it using Log.pii(). Bug: 111812270 Test: manual - Checked that phone number is not printed in the log when receive an incoming call and make an IMS conference call. Change-Id: I462ae7f923128a2d06d0415bcde0c779e932139f
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionRequest.java')
-rw-r--r--telecomm/java/android/telecom/ConnectionRequest.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/telecomm/java/android/telecom/ConnectionRequest.java b/telecomm/java/android/telecom/ConnectionRequest.java
index b6e6b0ed8270..d69d2cd756dc 100644
--- a/telecomm/java/android/telecom/ConnectionRequest.java
+++ b/telecomm/java/android/telecom/ConnectionRequest.java
@@ -337,7 +337,31 @@ public final class ConnectionRequest implements Parcelable {
mAddress == null
? Uri.EMPTY
: Connection.toLogSafePhoneNumber(mAddress.toString()),
- mExtras == null ? "" : mExtras);
+ bundleToString(mExtras));
+ }
+
+ private static String bundleToString(Bundle extras){
+ if (extras == null) {
+ return "";
+ }
+ StringBuilder sb = new StringBuilder();
+ sb.append("Bundle[");
+ for (String key : extras.keySet()) {
+ sb.append(key);
+ sb.append("=");
+ switch (key) {
+ case TelecomManager.EXTRA_INCOMING_CALL_ADDRESS:
+ case TelecomManager.EXTRA_UNKNOWN_CALL_HANDLE:
+ sb.append(Log.pii(extras.get(key)));
+ break;
+ default:
+ sb.append(extras.get(key));
+ break;
+ }
+ sb.append(", ");
+ }
+ sb.append("]");
+ return sb.toString();
}
public static final Creator<ConnectionRequest> CREATOR = new Creator<ConnectionRequest> () {