Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3be3ede0 authored by Chandru S's avatar Chandru S Committed by Automerger Merge Worker
Browse files

Merge "Additional logging to debug face scanning animation issues" into...

Merge "Additional logging to debug face scanning animation issues" into udc-dev am: c822edf8 am: 1de837fd

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22901187



Change-Id: I06acde06d74615fbd8ad9af1560f96bb17835e48
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6189d556 1de837fd
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -110,6 +110,10 @@ class FaceScanningOverlay(
        if (showScanningAnimNow == showScanningAnim) {
        if (showScanningAnimNow == showScanningAnim) {
            return
            return
        }
        }
        logger.cameraProtectionShownOrHidden(keyguardUpdateMonitor.isFaceDetectionRunning,
                authController.isShowing,
                show,
                showScanningAnim)
        showScanningAnim = showScanningAnimNow
        showScanningAnim = showScanningAnimNow
        updateProtectionBoundingPath()
        updateProtectionBoundingPath()
        // Delay the relayout until the end of the animation when hiding,
        // Delay the relayout until the end of the animation when hiding,
@@ -352,6 +356,7 @@ class FaceScanningOverlay(
            if (biometricSourceType == BiometricSourceType.FACE) {
            if (biometricSourceType == BiometricSourceType.FACE) {
                post {
                post {
                    faceAuthSucceeded = true
                    faceAuthSucceeded = true
                    logger.biometricEvent("biometricAuthenticated")
                    enableShowProtection(true)
                    enableShowProtection(true)
                }
                }
            }
            }
@@ -372,6 +377,7 @@ class FaceScanningOverlay(
            if (biometricSourceType == BiometricSourceType.FACE) {
            if (biometricSourceType == BiometricSourceType.FACE) {
                post {
                post {
                    faceAuthSucceeded = false
                    faceAuthSucceeded = false
                    logger.biometricEvent("biometricFailed")
                    enableShowProtection(false)
                    enableShowProtection(false)
                }
                }
            }
            }
@@ -385,6 +391,7 @@ class FaceScanningOverlay(
            if (biometricSourceType == BiometricSourceType.FACE) {
            if (biometricSourceType == BiometricSourceType.FACE) {
                post {
                post {
                    faceAuthSucceeded = false
                    faceAuthSucceeded = false
                    logger.biometricEvent("biometricError")
                    enableShowProtection(false)
                    enableShowProtection(false)
                }
                }
            }
            }
+4 −2
Original line number Original line Diff line number Diff line
@@ -90,6 +90,8 @@ import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.concurrency.ThreadFactory;
import com.android.systemui.util.concurrency.ThreadFactory;
import com.android.systemui.util.settings.SecureSettings;
import com.android.systemui.util.settings.SecureSettings;


import kotlin.Pair;

import java.io.PrintWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
@@ -98,8 +100,6 @@ import java.util.concurrent.Executor;


import javax.inject.Inject;
import javax.inject.Inject;


import kotlin.Pair;

/**
/**
 * An overlay that draws screen decorations in software (e.g for rounded corners or display cutout)
 * An overlay that draws screen decorations in software (e.g for rounded corners or display cutout)
 * for antialiasing and emulation purposes.
 * for antialiasing and emulation purposes.
@@ -254,11 +254,13 @@ public class ScreenDecorations implements CoreStartable, Tunable , Dumpable {
            new CameraAvailabilityListener.CameraTransitionCallback() {
            new CameraAvailabilityListener.CameraTransitionCallback() {
        @Override
        @Override
        public void onApplyCameraProtection(@NonNull Path protectionPath, @NonNull Rect bounds) {
        public void onApplyCameraProtection(@NonNull Path protectionPath, @NonNull Rect bounds) {
            mLogger.cameraProtectionEvent("onApplyCameraProtection");
            showCameraProtection(protectionPath, bounds);
            showCameraProtection(protectionPath, bounds);
        }
        }


        @Override
        @Override
        public void onHideCameraProtection() {
        public void onHideCameraProtection() {
            mLogger.cameraProtectionEvent("onHideCameraProtection");
            hideCameraProtection();
            hideCameraProtection();
        }
        }
    };
    };
+33 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ import com.android.systemui.log.dagger.ScreenDecorationsLog
import com.android.systemui.plugins.log.LogBuffer
import com.android.systemui.plugins.log.LogBuffer
import com.android.systemui.plugins.log.LogLevel.DEBUG
import com.android.systemui.plugins.log.LogLevel.DEBUG
import com.android.systemui.plugins.log.LogLevel.ERROR
import com.android.systemui.plugins.log.LogLevel.ERROR
import com.google.errorprone.annotations.CompileTimeConstant
import javax.inject.Inject
import javax.inject.Inject


private const val TAG = "ScreenDecorationsLog"
private const val TAG = "ScreenDecorationsLog"
@@ -131,4 +132,36 @@ constructor(
    fun onSensorLocationChanged() {
    fun onSensorLocationChanged() {
        logBuffer.log(TAG, DEBUG, "AuthControllerCallback in ScreenDecorations triggered")
        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)
    }
}
}