From 55b160e5375a5b9824a250c95ce8267fce9ec894 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Mon, 25 Jan 2016 18:16:08 +0000 Subject: Don't print phone number into Android log Use Log.pii to hash pii BUG=26635632 Change-Id: I3c03ec2347e251696f6c0c78f8b39d6e34b6afcc --- src/com/android/dialer/util/PhoneNumberUtil.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/com/android/dialer/util') diff --git a/src/com/android/dialer/util/PhoneNumberUtil.java b/src/com/android/dialer/util/PhoneNumberUtil.java index 26998037d..33f987359 100644 --- a/src/com/android/dialer/util/PhoneNumberUtil.java +++ b/src/com/android/dialer/util/PhoneNumberUtil.java @@ -100,7 +100,7 @@ public class PhoneNumberUtil { * @see com.android.i18n.phonenumbers.PhoneNumberOfflineGeocoder */ public static String getGeoDescription(Context context, String number) { - Log.v(TAG, "getGeoDescription('" + number + "')..."); + Log.v(TAG, "getGeoDescription('" + pii(number) + "')..."); if (TextUtils.isEmpty(number)) { return null; @@ -114,13 +114,13 @@ public class PhoneNumberUtil { String countryIso = TelephonyManagerUtils.getCurrentCountryIso(context, locale); Phonenumber.PhoneNumber pn = null; try { - Log.v(TAG, "parsing '" + number + Log.v(TAG, "parsing '" + pii(number) + "' for countryIso '" + countryIso + "'..."); pn = util.parse(number, countryIso); - Log.v(TAG, "- parsed number: " + pn); + Log.v(TAG, "- parsed number: " + pii(pn)); } catch (NumberParseException e) { Log.v(TAG, "getGeoDescription: NumberParseException for incoming number '" + - number + "'"); + pii(number) + "'"); } if (pn != null) { @@ -131,4 +131,8 @@ public class PhoneNumberUtil { return null; } + + private static String pii(Object pii) { + return com.android.incallui.Log.pii(pii); + } } -- cgit v1.2.3