Loading telecomm/java/android/telecom/Log.java +2 −51 Original line number Original line Diff line number Diff line Loading @@ -340,24 +340,6 @@ public class Log { return sSessionManager; return sSessionManager; } } private static MessageDigest sMessageDigest; public static void initMd5Sum() { new AsyncTask<Void, Void, Void>() { @Override public Void doInBackground(Void... args) { MessageDigest md; try { md = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException e) { md = null; } sMessageDigest = md; return null; } }.execute(); } public static void setTag(String tag) { public static void setTag(String tag) { TAG = tag; TAG = tag; DEBUG = isLoggable(android.util.Log.DEBUG); DEBUG = isLoggable(android.util.Log.DEBUG); Loading Loading @@ -425,44 +407,13 @@ 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, * If we are running in verbose mode, return the original string, * and return "****" if we are running on the user build, otherwise * and return "***" otherwise. * return a SHA-1 hash of the input string. */ */ public static String pii(Object pii) { public static String pii(Object pii) { if (pii == null || VERBOSE) { if (pii == null || VERBOSE) { return String.valueOf(pii); return String.valueOf(pii); } } return "[" + secureHash(String.valueOf(pii).getBytes()) + "]"; return "***"; } private static String secureHash(byte[] input) { // Refrain from logging user personal information in user build. if (USER_BUILD) { return "****"; } if (sMessageDigest != null) { sMessageDigest.reset(); sMessageDigest.update(input); byte[] result = sMessageDigest.digest(); return encodeHex(result); } else { return "Uninitialized SHA1"; } } private static String encodeHex(byte[] bytes) { StringBuffer hex = new StringBuffer(bytes.length * 2); for (int i = 0; i < bytes.length; i++) { int byteIntValue = bytes[i] & 0xff; if (byteIntValue < 0x10) { hex.append("0"); } hex.append(Integer.toString(byteIntValue, 16)); } return hex.toString(); } } private static String getPrefixFromObject(Object obj) { private static String getPrefixFromObject(Object obj) { Loading telecomm/java/android/telecom/TelecomManager.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -645,7 +645,6 @@ public class TelecomManager { mContext = context; mContext = context; } } mTelecomServiceOverride = telecomServiceImpl; mTelecomServiceOverride = telecomServiceImpl; android.telecom.Log.initMd5Sum(); } } /** /** Loading Loading
telecomm/java/android/telecom/Log.java +2 −51 Original line number Original line Diff line number Diff line Loading @@ -340,24 +340,6 @@ public class Log { return sSessionManager; return sSessionManager; } } private static MessageDigest sMessageDigest; public static void initMd5Sum() { new AsyncTask<Void, Void, Void>() { @Override public Void doInBackground(Void... args) { MessageDigest md; try { md = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException e) { md = null; } sMessageDigest = md; return null; } }.execute(); } public static void setTag(String tag) { public static void setTag(String tag) { TAG = tag; TAG = tag; DEBUG = isLoggable(android.util.Log.DEBUG); DEBUG = isLoggable(android.util.Log.DEBUG); Loading Loading @@ -425,44 +407,13 @@ 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, * If we are running in verbose mode, return the original string, * and return "****" if we are running on the user build, otherwise * and return "***" otherwise. * return a SHA-1 hash of the input string. */ */ public static String pii(Object pii) { public static String pii(Object pii) { if (pii == null || VERBOSE) { if (pii == null || VERBOSE) { return String.valueOf(pii); return String.valueOf(pii); } } return "[" + secureHash(String.valueOf(pii).getBytes()) + "]"; return "***"; } private static String secureHash(byte[] input) { // Refrain from logging user personal information in user build. if (USER_BUILD) { return "****"; } if (sMessageDigest != null) { sMessageDigest.reset(); sMessageDigest.update(input); byte[] result = sMessageDigest.digest(); return encodeHex(result); } else { return "Uninitialized SHA1"; } } private static String encodeHex(byte[] bytes) { StringBuffer hex = new StringBuffer(bytes.length * 2); for (int i = 0; i < bytes.length; i++) { int byteIntValue = bytes[i] & 0xff; if (byteIntValue < 0x10) { hex.append("0"); } hex.append(Integer.toString(byteIntValue, 16)); } return hex.toString(); } } private static String getPrefixFromObject(Object obj) { private static String getPrefixFromObject(Object obj) { Loading
telecomm/java/android/telecom/TelecomManager.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -645,7 +645,6 @@ public class TelecomManager { mContext = context; mContext = context; } } mTelecomServiceOverride = telecomServiceImpl; mTelecomServiceOverride = telecomServiceImpl; android.telecom.Log.initMd5Sum(); } } /** /** Loading