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

Commit 137d739b authored by Jernej Virag's avatar Jernej Virag Committed by Android (Google) Code Review
Browse files

Merge "Issue scheduleWatchdog command on background thread" into udc-qpr-dev

parents f5d09a50 cc75da70
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -4543,7 +4543,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
     * Cancels all operations in the scheduler if it is hung for 10 seconds.
     */
    public void startBiometricWatchdog() {
        if (mFaceManager != null && !isFaceAuthInteractorEnabled()) {
        final boolean isFaceAuthInteractorEnabled = isFaceAuthInteractorEnabled();
        mBackgroundExecutor.execute(() -> {
            Trace.beginSection("#startBiometricWatchdog");
            if (mFaceManager != null && !isFaceAuthInteractorEnabled) {
                mLogger.scheduleWatchdog("face");
                mFaceManager.scheduleWatchdog();
            }
@@ -4551,5 +4554,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                mLogger.scheduleWatchdog("fingerprint");
                mFpm.scheduleWatchdog();
            }
            Trace.endSection();
        });
    }
}
+8 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLoggin
import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.FeatureFlags
@@ -126,6 +127,7 @@ constructor(
    private val keyguardBypassController: KeyguardBypassController? = null,
    @Application private val applicationScope: CoroutineScope,
    @Main private val mainDispatcher: CoroutineDispatcher,
    @Background private val backgroundDispatcher: CoroutineDispatcher,
    private val sessionTracker: SessionTracker,
    private val uiEventsLogger: UiEventLogger,
    private val faceAuthLogger: FaceAuthenticationLogger,
@@ -228,9 +230,13 @@ constructor(
        keyguardTransitionInteractor.anyStateToGoneTransition
            .filter { it.transitionState == TransitionState.FINISHED }
            .onEach {
                // We deliberately want to run this in background because scheduleWatchdog does
                // a Binder IPC.
                withContext(backgroundDispatcher) {
                    faceAuthLogger.watchdogScheduled()
                    faceManager?.scheduleWatchdog()
                }
            }
            .launchIn(applicationScope)
    }

+1 −0
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
            bypassControllerOverride,
            testScope.backgroundScope,
            testDispatcher,
            testDispatcher,
            sessionTracker,
            uiEventLogger,
            FaceAuthenticationLogger(logcatLogBuffer("DeviceEntryFaceAuthRepositoryLog")),