diff --git a/packages/SystemUI/src/com/android/systemui/FaceScanningOverlay.kt b/packages/SystemUI/src/com/android/systemui/FaceScanningOverlay.kt index a3e7d71a92f6d..48805be50aa98 100644 --- a/packages/SystemUI/src/com/android/systemui/FaceScanningOverlay.kt +++ b/packages/SystemUI/src/com/android/systemui/FaceScanningOverlay.kt @@ -110,6 +110,10 @@ class FaceScanningOverlay( if (showScanningAnimNow == showScanningAnim) { return } + logger.cameraProtectionShownOrHidden(keyguardUpdateMonitor.isFaceDetectionRunning, + authController.isShowing, + show, + showScanningAnim) showScanningAnim = showScanningAnimNow updateProtectionBoundingPath() // Delay the relayout until the end of the animation when hiding, @@ -352,6 +356,7 @@ class FaceScanningOverlay( if (biometricSourceType == BiometricSourceType.FACE) { post { faceAuthSucceeded = true + logger.biometricEvent("biometricAuthenticated") enableShowProtection(true) } } @@ -372,6 +377,7 @@ class FaceScanningOverlay( if (biometricSourceType == BiometricSourceType.FACE) { post { faceAuthSucceeded = false + logger.biometricEvent("biometricFailed") enableShowProtection(false) } } @@ -385,6 +391,7 @@ class FaceScanningOverlay( if (biometricSourceType == BiometricSourceType.FACE) { post { faceAuthSucceeded = false + logger.biometricEvent("biometricError") enableShowProtection(false) } } diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index adc04128a93aa..ea0f343e80f45 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -90,6 +90,8 @@ import com.android.systemui.util.concurrency.DelayableExecutor; import com.android.systemui.util.concurrency.ThreadFactory; import com.android.systemui.util.settings.SecureSettings; +import kotlin.Pair; + import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; @@ -98,8 +100,6 @@ import java.util.concurrent.Executor; import javax.inject.Inject; -import kotlin.Pair; - /** * An overlay that draws screen decorations in software (e.g for rounded corners or display cutout) * for antialiasing and emulation purposes. @@ -254,11 +254,13 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable { new CameraAvailabilityListener.CameraTransitionCallback() { @Override public void onApplyCameraProtection(@NonNull Path protectionPath, @NonNull Rect bounds) { + mLogger.cameraProtectionEvent("onApplyCameraProtection"); showCameraProtection(protectionPath, bounds); } @Override public void onHideCameraProtection() { + mLogger.cameraProtectionEvent("onHideCameraProtection"); hideCameraProtection(); } }; diff --git a/packages/SystemUI/src/com/android/systemui/log/ScreenDecorationsLogger.kt b/packages/SystemUI/src/com/android/systemui/log/ScreenDecorationsLogger.kt index edc278d1ae4f8..4300f371e2e15 100644 --- a/packages/SystemUI/src/com/android/systemui/log/ScreenDecorationsLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/log/ScreenDecorationsLogger.kt @@ -25,6 +25,7 @@ import com.android.systemui.log.dagger.ScreenDecorationsLog import com.android.systemui.plugins.log.LogBuffer import com.android.systemui.plugins.log.LogLevel.DEBUG import com.android.systemui.plugins.log.LogLevel.ERROR +import com.google.errorprone.annotations.CompileTimeConstant import javax.inject.Inject private const val TAG = "ScreenDecorationsLog" @@ -131,4 +132,36 @@ constructor( fun onSensorLocationChanged() { logBuffer.log(TAG, DEBUG, "AuthControllerCallback in ScreenDecorations triggered") } + + fun cameraProtectionShownOrHidden( + faceDetectionRunning: Boolean, + biometricPromptShown: Boolean, + requestedState: Boolean, + currentlyShowing: Boolean + ) { + logBuffer.log( + TAG, + DEBUG, + { + bool1 = faceDetectionRunning + bool2 = biometricPromptShown + bool3 = requestedState + bool4 = currentlyShowing + }, + { + "isFaceDetectionRunning: $bool1, " + + "isBiometricPromptShowing: $bool2, " + + "requestedState: $bool3, " + + "currentState: $bool4" + } + ) + } + + fun biometricEvent(@CompileTimeConstant info: String) { + logBuffer.log(TAG, DEBUG, info) + } + + fun cameraProtectionEvent(@CompileTimeConstant cameraProtectionEvent: String) { + logBuffer.log(TAG, DEBUG, cameraProtectionEvent) + } }