summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/Log.java
diff options
context:
space:
mode:
authoryouhei.x.miyoshi <youhei.x.miyoshi@sonymobile.com>2016-12-12 21:10:54 +0900
committertakeshi tanigawa <takeshi.tanigawa@sonymobile.com>2017-03-06 14:53:10 +0900
commitb3cd7b51d330caa1f54710741b73a63043515b82 (patch)
treec1268d99b6b480ad3b923e010d3fce49c59b5fe8 /telecomm/java/android/telecom/Log.java
parentc337e32bb0a7ae53a11bf2178eec34062c1b1595 (diff)
Disable a phone number log for user build
A phone number is privacy data. Therefore, it should be prevented from logging in user build. Test: manual - checked log Bug: 34582911 Change-Id: Id040653dbfd236250e7eb07c9c2e9587ded3d63f
Diffstat (limited to 'telecomm/java/android/telecom/Log.java')
-rw-r--r--telecomm/java/android/telecom/Log.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/telecomm/java/android/telecom/Log.java b/telecomm/java/android/telecom/Log.java
index ced6627e8d34..610789586830 100644
--- a/telecomm/java/android/telecom/Log.java
+++ b/telecomm/java/android/telecom/Log.java
@@ -19,6 +19,7 @@ package android.telecom;
import android.content.Context;
import android.net.Uri;
import android.os.AsyncTask;
+import android.os.Build;
import android.telecom.Logging.EventManager;
import android.telecom.Logging.Session;
import android.telecom.Logging.SessionManager;
@@ -55,6 +56,7 @@ public class Log {
public static boolean ERROR = isLoggable(android.util.Log.ERROR);
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
private static final Object sSingletonSync = new Object();
@@ -404,7 +406,8 @@ public class Log {
/**
* 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.
*/
public static String pii(Object pii) {
@@ -415,6 +418,11 @@ public class Log {
}
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);