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

Commit cd192e93 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Add more audit logging for burn in" into main

parents 7c577cfa 619d1e18
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -322,7 +322,11 @@ constructor(
                    }
                }
            }
            .distinctUntilChanged()
            .stateIn(
                scope = applicationScope,
                started = SharingStarted.WhileSubscribed(),
                initialValue = 0f,
            )

    val clockShouldBeCentered: Flow<Boolean> = repository.clockShouldBeCentered

+17 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.keyguard.domain.interactor
import com.android.keyguard.logging.KeyguardLogger
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.keyguard.ui.viewmodel.KeyguardRootViewModel
import com.android.systemui.log.core.LogLevel.VERBOSE
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.scene.shared.flag.SceneContainerFlag
@@ -26,6 +27,7 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.SharedNotificationContainerViewModel
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.debounce
import kotlinx.coroutines.launch

private val TAG = KeyguardTransitionAuditLogger::class.simpleName!!
@@ -41,6 +43,7 @@ constructor(
    private val logger: KeyguardLogger,
    private val powerInteractor: PowerInteractor,
    private val sharedNotificationContainerViewModel: SharedNotificationContainerViewModel,
    private val keyguardRootViewModel: KeyguardRootViewModel,
    private val shadeInteractor: ShadeInteractor,
    private val keyguardOcclusionInteractor: KeyguardOcclusionInteractor,
) {
@@ -72,8 +75,8 @@ constructor(

        if (!SceneContainerFlag.isEnabled) {
            scope.launch {
                sharedNotificationContainerViewModel.bounds.collect {
                    logger.log(TAG, VERBOSE, "Notif: bounds", it)
                sharedNotificationContainerViewModel.bounds.debounce(20L).collect {
                    logger.log(TAG, VERBOSE, "Notif: bounds (debounced)", it)
                }
            }
        }
@@ -112,6 +115,18 @@ constructor(
            }
        }

        scope.launch {
            keyguardInteractor.keyguardTranslationY.collect {
                logger.log(TAG, VERBOSE, "keyguardTranslationY", it)
            }
        }

        scope.launch {
            keyguardRootViewModel.burnInModel.debounce(20L).collect {
                logger.log(TAG, VERBOSE, "BurnInModel (debounced)", it)
            }
        }

        scope.launch {
            keyguardInteractor.isKeyguardDismissible.collect {
                logger.log(TAG, VERBOSE, "isDismissible", it)
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ constructor(
    private val shadeInteractor: ShadeInteractor,
) {
    private var burnInJob: Job? = null
    private val burnInModel = MutableStateFlow(BurnInModel())
    internal val burnInModel = MutableStateFlow(BurnInModel())

    val burnInLayerVisibility: Flow<Int> =
        keyguardTransitionInteractor.startedKeyguardState
+11 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import androidx.test.filters.SmallTest
import com.android.systemui.statusbar.disableflags.data.model.DisableFlagsModel
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.cancelChildren
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.Test
@@ -36,6 +37,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp
            runCurrent()

            assertThat(mQsController.isExpansionEnabled).isFalse()

            coroutineContext.cancelChildren()
        }

    @Test
@@ -45,6 +48,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp
            runCurrent()

            assertThat(mQsController.isExpansionEnabled).isTrue()

            coroutineContext.cancelChildren()
        }

    @Test
@@ -58,6 +63,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp
            runCurrent()

            assertThat(mQsController.isExpansionEnabled).isFalse()

            coroutineContext.cancelChildren()
        }

    @Test
@@ -71,6 +78,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp
            runCurrent()

            assertThat(mQsController.isExpansionEnabled).isFalse()

            coroutineContext.cancelChildren()
        }

    @Test
@@ -81,5 +90,7 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp
            runCurrent()

            assertThat(mQsController.isExpansionEnabled).isTrue()

            coroutineContext.cancelChildren()
        }
}