Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +5 −1 Original line number Diff line number Diff line Loading @@ -322,7 +322,11 @@ constructor( } } } .distinctUntilChanged() .stateIn( scope = applicationScope, started = SharingStarted.WhileSubscribed(), initialValue = 0f, ) val clockShouldBeCentered: Flow<Boolean> = repository.clockShouldBeCentered Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt +17 −2 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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!! Loading @@ -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, ) { Loading Loading @@ -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) } } } Loading Loading @@ -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) Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerImplWithCoroutinesTest.kt +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -36,6 +37,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isFalse() coroutineContext.cancelChildren() } @Test Loading @@ -45,6 +48,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isTrue() coroutineContext.cancelChildren() } @Test Loading @@ -58,6 +63,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isFalse() coroutineContext.cancelChildren() } @Test Loading @@ -71,6 +78,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isFalse() coroutineContext.cancelChildren() } @Test Loading @@ -81,5 +90,7 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isTrue() coroutineContext.cancelChildren() } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +5 −1 Original line number Diff line number Diff line Loading @@ -322,7 +322,11 @@ constructor( } } } .distinctUntilChanged() .stateIn( scope = applicationScope, started = SharingStarted.WhileSubscribed(), initialValue = 0f, ) val clockShouldBeCentered: Flow<Boolean> = repository.clockShouldBeCentered Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt +17 −2 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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!! Loading @@ -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, ) { Loading Loading @@ -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) } } } Loading Loading @@ -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) Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/tests/src/com/android/systemui/shade/QuickSettingsControllerImplWithCoroutinesTest.kt +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -36,6 +37,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isFalse() coroutineContext.cancelChildren() } @Test Loading @@ -45,6 +48,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isTrue() coroutineContext.cancelChildren() } @Test Loading @@ -58,6 +63,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isFalse() coroutineContext.cancelChildren() } @Test Loading @@ -71,6 +78,8 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isFalse() coroutineContext.cancelChildren() } @Test Loading @@ -81,5 +90,7 @@ class QuickSettingsControllerImplWithCoroutinesTest : QuickSettingsControllerImp runCurrent() assertThat(mQsController.isExpansionEnabled).isTrue() coroutineContext.cancelChildren() } }