OSDN Git Service

Add additional system properties that can disable the face debugging codepath
authorJoe Onorato <joeo@google.com>
Thu, 4 Apr 2019 01:20:52 +0000 (18:20 -0700)
committerJoe Onorato <joeo@google.com>
Fri, 5 Apr 2019 04:43:58 +0000 (21:43 -0700)
Test: treehugger
Bug: 123543706
Change-Id: I3fe2dea3a44a789d86dc9beb1bb319b0552011ec

services/core/java/com/android/server/biometrics/face/FaceService.java

index c573bbb..14ba70a 100644 (file)
@@ -44,6 +44,7 @@ import android.os.Environment;
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.os.SELinux;
+import android.os.SystemProperties;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.service.restricted_image.RestrictedImageProto;
@@ -1091,6 +1092,13 @@ public class FaceService extends BiometricServiceBase {
             return;
         }
 
+        // Additionally, this flag allows turning off face for a device
+        // (either permanently through the build or on an individual device).
+        if (SystemProperties.getBoolean("ro.face.disable_debug_data", false)
+                || SystemProperties.getBoolean("persist.face.disable_debug_data", false)) {
+            return;
+        }
+
         final ProtoOutputStream proto = new ProtoOutputStream(fd);
 
         final long setToken = proto.start(RestrictedImagesDumpProto.SETS);