Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55b160e5 authored by Victor Chang's avatar Victor Chang
Browse files

Don't print phone number into Android log

Use Log.pii to hash pii

BUG=26635632

Change-Id: I3c03ec2347e251696f6c0c78f8b39d6e34b6afcc
parent 88bbc3e5
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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);
    }
}