Loading telecomm/java/android/telecom/Log.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.telecom; import android.content.Context; import android.content.Context; import android.net.Uri; import android.net.Uri; import android.os.AsyncTask; import android.os.AsyncTask; import android.os.Build; import android.telecom.Logging.EventManager; import android.telecom.Logging.EventManager; import android.telecom.Logging.Session; import android.telecom.Logging.Session; import android.telecom.Logging.SessionManager; import android.telecom.Logging.SessionManager; Loading Loading @@ -55,6 +56,7 @@ public class Log { public static boolean ERROR = isLoggable(android.util.Log.ERROR); public static boolean ERROR = isLoggable(android.util.Log.ERROR); private static final boolean FORCE_LOGGING = false; /* STOP SHIP if true */ private static final boolean FORCE_LOGGING = false; /* STOP SHIP if true */ private static final boolean USER_BUILD = Build.TYPE.equals("user"); // Used to synchronize singleton logging lazy initialization // Used to synchronize singleton logging lazy initialization private static final Object sSingletonSync = new Object(); private static final Object sSingletonSync = new Object(); Loading Loading @@ -404,7 +406,8 @@ public class Log { /** /** * Redact personally identifiable information for production users. * Redact personally identifiable information for production users. * If we are running in verbose mode, return the original string, otherwise * If we are running in verbose mode, return the original string, * and return "****" if we are running on the user build, otherwise * return a SHA-1 hash of the input string. * return a SHA-1 hash of the input string. */ */ public static String pii(Object pii) { public static String pii(Object pii) { Loading @@ -415,6 +418,11 @@ public class Log { } } private static String secureHash(byte[] input) { private static String secureHash(byte[] input) { // Refrain from logging user personal information in user build. if (USER_BUILD) { return "****"; } if (sMessageDigest != null) { if (sMessageDigest != null) { sMessageDigest.reset(); sMessageDigest.reset(); sMessageDigest.update(input); sMessageDigest.update(input); Loading telephony/java/android/telephony/Rlog.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.telephony; package android.telephony; import android.os.Build; import android.text.TextUtils; import android.text.TextUtils; import android.util.Log; import android.util.Log; Loading @@ -32,6 +33,8 @@ import java.security.NoSuchAlgorithmException; */ */ public final class Rlog { public final class Rlog { private static final boolean USER_BUILD = Build.TYPE.equals("user"); private Rlog() { private Rlog() { } } Loading Loading @@ -125,10 +128,15 @@ public final class Rlog { /** /** * Returns a secure hash (using the SHA1 algorithm) of the provided input. * Returns a secure hash (using the SHA1 algorithm) of the provided input. * * * @return the hash * @return "****" if the build type is user, otherwise the hash * @param input the bytes for which the secure hash should be computed. * @param input the bytes for which the secure hash should be computed. */ */ private static String secureHash(byte[] input) { private static String secureHash(byte[] input) { // Refrain from logging user personal information in user build. if (USER_BUILD) { return "****"; } MessageDigest messageDigest; MessageDigest messageDigest; try { try { Loading telephony/java/com/android/internal/telephony/CallerInfo.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -30,9 +30,9 @@ import android.provider.ContactsContract.Data; import android.provider.ContactsContract.PhoneLookup; import android.provider.ContactsContract.PhoneLookup; import android.provider.ContactsContract.RawContacts; import android.provider.ContactsContract.RawContacts; import android.telephony.PhoneNumberUtils; import android.telephony.PhoneNumberUtils; import android.telephony.Rlog; import android.telephony.TelephonyManager; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.text.TextUtils; import android.telephony.Rlog; import android.util.Log; import android.util.Log; import com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder; import com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder; Loading Loading @@ -595,7 +595,8 @@ public class CallerInfo { pn = util.parse(number, countryIso); pn = util.parse(number, countryIso); if (VDBG) Rlog.v(TAG, "- parsed number: " + pn); if (VDBG) Rlog.v(TAG, "- parsed number: " + pn); } catch (NumberParseException e) { } catch (NumberParseException e) { Rlog.w(TAG, "getGeoDescription: NumberParseException for incoming number '" + number + "'"); Rlog.w(TAG, "getGeoDescription: NumberParseException for incoming number '" + Rlog.pii(TAG, number) + "'"); } } if (pn != null) { if (pn != null) { Loading Loading
telecomm/java/android/telecom/Log.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.telecom; import android.content.Context; import android.content.Context; import android.net.Uri; import android.net.Uri; import android.os.AsyncTask; import android.os.AsyncTask; import android.os.Build; import android.telecom.Logging.EventManager; import android.telecom.Logging.EventManager; import android.telecom.Logging.Session; import android.telecom.Logging.Session; import android.telecom.Logging.SessionManager; import android.telecom.Logging.SessionManager; Loading Loading @@ -55,6 +56,7 @@ public class Log { public static boolean ERROR = isLoggable(android.util.Log.ERROR); public static boolean ERROR = isLoggable(android.util.Log.ERROR); private static final boolean FORCE_LOGGING = false; /* STOP SHIP if true */ private static final boolean FORCE_LOGGING = false; /* STOP SHIP if true */ private static final boolean USER_BUILD = Build.TYPE.equals("user"); // Used to synchronize singleton logging lazy initialization // Used to synchronize singleton logging lazy initialization private static final Object sSingletonSync = new Object(); private static final Object sSingletonSync = new Object(); Loading Loading @@ -404,7 +406,8 @@ public class Log { /** /** * Redact personally identifiable information for production users. * Redact personally identifiable information for production users. * If we are running in verbose mode, return the original string, otherwise * If we are running in verbose mode, return the original string, * and return "****" if we are running on the user build, otherwise * return a SHA-1 hash of the input string. * return a SHA-1 hash of the input string. */ */ public static String pii(Object pii) { public static String pii(Object pii) { Loading @@ -415,6 +418,11 @@ public class Log { } } private static String secureHash(byte[] input) { private static String secureHash(byte[] input) { // Refrain from logging user personal information in user build. if (USER_BUILD) { return "****"; } if (sMessageDigest != null) { if (sMessageDigest != null) { sMessageDigest.reset(); sMessageDigest.reset(); sMessageDigest.update(input); sMessageDigest.update(input); Loading
telephony/java/android/telephony/Rlog.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.telephony; package android.telephony; import android.os.Build; import android.text.TextUtils; import android.text.TextUtils; import android.util.Log; import android.util.Log; Loading @@ -32,6 +33,8 @@ import java.security.NoSuchAlgorithmException; */ */ public final class Rlog { public final class Rlog { private static final boolean USER_BUILD = Build.TYPE.equals("user"); private Rlog() { private Rlog() { } } Loading Loading @@ -125,10 +128,15 @@ public final class Rlog { /** /** * Returns a secure hash (using the SHA1 algorithm) of the provided input. * Returns a secure hash (using the SHA1 algorithm) of the provided input. * * * @return the hash * @return "****" if the build type is user, otherwise the hash * @param input the bytes for which the secure hash should be computed. * @param input the bytes for which the secure hash should be computed. */ */ private static String secureHash(byte[] input) { private static String secureHash(byte[] input) { // Refrain from logging user personal information in user build. if (USER_BUILD) { return "****"; } MessageDigest messageDigest; MessageDigest messageDigest; try { try { Loading
telephony/java/com/android/internal/telephony/CallerInfo.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -30,9 +30,9 @@ import android.provider.ContactsContract.Data; import android.provider.ContactsContract.PhoneLookup; import android.provider.ContactsContract.PhoneLookup; import android.provider.ContactsContract.RawContacts; import android.provider.ContactsContract.RawContacts; import android.telephony.PhoneNumberUtils; import android.telephony.PhoneNumberUtils; import android.telephony.Rlog; import android.telephony.TelephonyManager; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.text.TextUtils; import android.telephony.Rlog; import android.util.Log; import android.util.Log; import com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder; import com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder; Loading Loading @@ -595,7 +595,8 @@ public class CallerInfo { pn = util.parse(number, countryIso); pn = util.parse(number, countryIso); if (VDBG) Rlog.v(TAG, "- parsed number: " + pn); if (VDBG) Rlog.v(TAG, "- parsed number: " + pn); } catch (NumberParseException e) { } catch (NumberParseException e) { Rlog.w(TAG, "getGeoDescription: NumberParseException for incoming number '" + number + "'"); Rlog.w(TAG, "getGeoDescription: NumberParseException for incoming number '" + Rlog.pii(TAG, number) + "'"); } } if (pn != null) { if (pn != null) { Loading