Loading packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -296,7 +296,7 @@ constructor( private fun listenForSchedulingWatchdog() { keyguardTransitionInteractor .transition(from = null, to = KeyguardState.GONE) .transition(to = KeyguardState.GONE) .filter { it.transitionState == TransitionState.FINISHED } .onEach { // We deliberately want to run this in background because scheduleWatchdog does Loading packages/SystemUI/src/com/android/systemui/dreams/ui/viewmodel/DreamViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ constructor( .distinctUntilChanged() val transitionEnded = keyguardTransitionInteractor.transition(from = DREAMING, to = null).filter { step -> keyguardTransitionInteractor.transition(from = DREAMING).filter { step -> step.transitionState == TransitionState.FINISHED || step.transitionState == TransitionState.CANCELED } Loading packages/SystemUI/src/com/android/systemui/keyguard/ResourceTrimmer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ constructor( applicationScope.launch(bgDispatcher) { // We drop 1 to avoid triggering on initial collect(). keyguardTransitionInteractor.transition(from = null, to = GONE).collect { transition -> keyguardTransitionInteractor.transition(to = GONE).collect { transition -> if (transition.transitionState == TransitionState.FINISHED) { onKeyguardGone() } Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionInteractor.kt +5 −6 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ constructor( * Receive all [TransitionStep] matching a filter of [from]->[to]. Allow nulls in order to match * any transition, for instance (any)->GONE. */ fun transition(from: KeyguardState?, to: KeyguardState?): Flow<TransitionStep> { fun transition(from: KeyguardState? = null, to: KeyguardState? = null): Flow<TransitionStep> { if (from == null && to == null) { throw IllegalArgumentException("from and to cannot both be null") } Loading Loading @@ -198,8 +198,7 @@ constructor( /** The last [TransitionStep] with a [TransitionState] of FINISHED */ val finishedKeyguardTransitionStep: Flow<TransitionStep> = repository.transitions .filter { step -> step.transitionState == TransitionState.FINISHED } repository.transitions.filter { step -> step.transitionState == TransitionState.FINISHED } /** The destination state of the last [TransitionState.STARTED] transition. */ val startedKeyguardState: SharedFlow<KeyguardState> = Loading Loading @@ -377,7 +376,7 @@ constructor( state: KeyguardState, ): Flow<Boolean> { return getOrCreateFlow(Edge(from = null, to = state)) .mapLatest { it.transitionState.isActive() } .mapLatest { it.transitionState.isTransitioning() } .onStart { emit(false) } .distinctUntilChanged() } Loading @@ -391,7 +390,7 @@ constructor( to: KeyguardState, ): Flow<Boolean> { return getOrCreateFlow(Edge(from = from, to = to)) .mapLatest { it.transitionState.isActive() } .mapLatest { it.transitionState.isTransitioning() } .onStart { emit(false) } .distinctUntilChanged() } Loading @@ -403,7 +402,7 @@ constructor( state: KeyguardState, ): Flow<Boolean> { return getOrCreateFlow(Edge(from = state, to = null)) .mapLatest { it.transitionState.isActive() } .mapLatest { it.transitionState.isTransitioning() } .onStart { emit(false) } .distinctUntilChanged() } Loading packages/SystemUI/src/com/android/systemui/keyguard/shared/model/TransitionState.kt +5 −5 Original line number Diff line number Diff line Loading @@ -19,20 +19,20 @@ package com.android.systemui.keyguard.shared.model enum class TransitionState { /* Transition has begun. */ STARTED { override fun isActive() = true override fun isTransitioning() = true }, /* Transition is actively running. */ RUNNING { override fun isActive() = true override fun isTransitioning() = true }, /* Transition has completed successfully. */ FINISHED { override fun isActive() = false override fun isTransitioning() = false }, /* Transition has been interrupted, and not completed successfully. */ CANCELED { override fun isActive() = false override fun isTransitioning() = false }; abstract fun isActive(): Boolean abstract fun isTransitioning(): Boolean } Loading
packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -296,7 +296,7 @@ constructor( private fun listenForSchedulingWatchdog() { keyguardTransitionInteractor .transition(from = null, to = KeyguardState.GONE) .transition(to = KeyguardState.GONE) .filter { it.transitionState == TransitionState.FINISHED } .onEach { // We deliberately want to run this in background because scheduleWatchdog does Loading
packages/SystemUI/src/com/android/systemui/dreams/ui/viewmodel/DreamViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,7 @@ constructor( .distinctUntilChanged() val transitionEnded = keyguardTransitionInteractor.transition(from = DREAMING, to = null).filter { step -> keyguardTransitionInteractor.transition(from = DREAMING).filter { step -> step.transitionState == TransitionState.FINISHED || step.transitionState == TransitionState.CANCELED } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ResourceTrimmer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ constructor( applicationScope.launch(bgDispatcher) { // We drop 1 to avoid triggering on initial collect(). keyguardTransitionInteractor.transition(from = null, to = GONE).collect { transition -> keyguardTransitionInteractor.transition(to = GONE).collect { transition -> if (transition.transitionState == TransitionState.FINISHED) { onKeyguardGone() } Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionInteractor.kt +5 −6 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ constructor( * Receive all [TransitionStep] matching a filter of [from]->[to]. Allow nulls in order to match * any transition, for instance (any)->GONE. */ fun transition(from: KeyguardState?, to: KeyguardState?): Flow<TransitionStep> { fun transition(from: KeyguardState? = null, to: KeyguardState? = null): Flow<TransitionStep> { if (from == null && to == null) { throw IllegalArgumentException("from and to cannot both be null") } Loading Loading @@ -198,8 +198,7 @@ constructor( /** The last [TransitionStep] with a [TransitionState] of FINISHED */ val finishedKeyguardTransitionStep: Flow<TransitionStep> = repository.transitions .filter { step -> step.transitionState == TransitionState.FINISHED } repository.transitions.filter { step -> step.transitionState == TransitionState.FINISHED } /** The destination state of the last [TransitionState.STARTED] transition. */ val startedKeyguardState: SharedFlow<KeyguardState> = Loading Loading @@ -377,7 +376,7 @@ constructor( state: KeyguardState, ): Flow<Boolean> { return getOrCreateFlow(Edge(from = null, to = state)) .mapLatest { it.transitionState.isActive() } .mapLatest { it.transitionState.isTransitioning() } .onStart { emit(false) } .distinctUntilChanged() } Loading @@ -391,7 +390,7 @@ constructor( to: KeyguardState, ): Flow<Boolean> { return getOrCreateFlow(Edge(from = from, to = to)) .mapLatest { it.transitionState.isActive() } .mapLatest { it.transitionState.isTransitioning() } .onStart { emit(false) } .distinctUntilChanged() } Loading @@ -403,7 +402,7 @@ constructor( state: KeyguardState, ): Flow<Boolean> { return getOrCreateFlow(Edge(from = state, to = null)) .mapLatest { it.transitionState.isActive() } .mapLatest { it.transitionState.isTransitioning() } .onStart { emit(false) } .distinctUntilChanged() } Loading
packages/SystemUI/src/com/android/systemui/keyguard/shared/model/TransitionState.kt +5 −5 Original line number Diff line number Diff line Loading @@ -19,20 +19,20 @@ package com.android.systemui.keyguard.shared.model enum class TransitionState { /* Transition has begun. */ STARTED { override fun isActive() = true override fun isTransitioning() = true }, /* Transition is actively running. */ RUNNING { override fun isActive() = true override fun isTransitioning() = true }, /* Transition has completed successfully. */ FINISHED { override fun isActive() = false override fun isTransitioning() = false }, /* Transition has been interrupted, and not completed successfully. */ CANCELED { override fun isActive() = false override fun isTransitioning() = false }; abstract fun isActive(): Boolean abstract fun isTransitioning(): Boolean }