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

Commit ea69e895 authored by William Xiao's avatar William Xiao
Browse files

Apply new ktfmt formatting

Bug: N/A
Flag: NONE just auto-formatting changes
Test: N/A
Change-Id: Id50499d0363220a4f79ed45cc483dbcd88085ef5
parent 005ad540
Loading
Loading
Loading
Loading
+8 −29
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT
            transitionRepository.sendTransitionSteps(
                from = KeyguardState.LOCKSCREEN,
                to = KeyguardState.DOZING,
                testScope
                testScope,
            )
            kosmos.fakeKeyguardRepository.setBiometricUnlockState(BiometricUnlockMode.NONE)
            reset(transitionRepository)
@@ -145,10 +145,7 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT

            // Under default conditions, we should transition to LOCKSCREEN when waking up.
            assertThat(transitionRepository)
                .startedTransition(
                    from = KeyguardState.DOZING,
                    to = KeyguardState.LOCKSCREEN,
                )
                .startedTransition(from = KeyguardState.DOZING, to = KeyguardState.LOCKSCREEN)
        }

    @Test
@@ -166,10 +163,7 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT
            // If dreaming is possible and communal is available, then we should transition to
            // GLANCEABLE_HUB when waking up due to power button press.
            assertThat(transitionRepository)
                .startedTransition(
                    from = KeyguardState.DOZING,
                    to = KeyguardState.GLANCEABLE_HUB,
                )
                .startedTransition(from = KeyguardState.DOZING, to = KeyguardState.GLANCEABLE_HUB)
        }

    @Test
@@ -204,10 +198,7 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT
            // If dreaming is NOT possible but communal is available, then we should transition to
            // LOCKSCREEN when waking up due to power button press.
            assertThat(transitionRepository)
                .startedTransition(
                    from = KeyguardState.DOZING,
                    to = KeyguardState.LOCKSCREEN,
                )
                .startedTransition(from = KeyguardState.DOZING, to = KeyguardState.LOCKSCREEN)
        }

    @Test
@@ -224,10 +215,7 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT
            // If dreaming is possible but communal is NOT available, then we should transition to
            // LOCKSCREEN when waking up due to power button press.
            assertThat(transitionRepository)
                .startedTransition(
                    from = KeyguardState.DOZING,
                    to = KeyguardState.LOCKSCREEN,
                )
                .startedTransition(from = KeyguardState.DOZING, to = KeyguardState.LOCKSCREEN)
        }

    @Test
@@ -245,10 +233,7 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT

            // Under default conditions, we should transition to LOCKSCREEN when waking up.
            assertThat(transitionRepository)
                .startedTransition(
                    from = KeyguardState.DOZING,
                    to = KeyguardState.GLANCEABLE_HUB,
                )
                .startedTransition(from = KeyguardState.DOZING, to = KeyguardState.GLANCEABLE_HUB)
        }

    @Test
@@ -261,10 +246,7 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT

            // Waking with a SHOW_WHEN_LOCKED activity on top should transition to OCCLUDED.
            assertThat(transitionRepository)
                .startedTransition(
                    from = KeyguardState.DOZING,
                    to = KeyguardState.OCCLUDED,
                )
                .startedTransition(from = KeyguardState.DOZING, to = KeyguardState.OCCLUDED)
        }

    @Test
@@ -282,10 +264,7 @@ class FromDozingTransitionInteractorTest(flags: FlagsParameterization?) : SysuiT

            // Waking with a SHOW_WHEN_LOCKED activity on top should transition to OCCLUDED.
            assertThat(transitionRepository)
                .startedTransition(
                    from = KeyguardState.DOZING,
                    to = KeyguardState.OCCLUDED,
                )
                .startedTransition(from = KeyguardState.DOZING, to = KeyguardState.OCCLUDED)
        }

    @Test
+3 −3
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ constructor(
                screenTimeout =
                    systemSettings.getInt(
                        Settings.System.SCREEN_OFF_TIMEOUT,
                        DEFAULT_SCREEN_TIMEOUT
                        DEFAULT_SCREEN_TIMEOUT,
                    )
            }
            .launchIn(bgScope)
@@ -160,7 +160,7 @@ constructor(
            combine(
                    communalSceneInteractor.currentScene,
                    // Emit a value on start so the combine starts.
                    communalInteractor.userActivity.emitOnStart()
                    communalInteractor.userActivity.emitOnStart(),
                ) { scene, _ ->
                    // Only timeout if we're on the hub is open.
                    scene == CommunalScenes.Communal
@@ -219,7 +219,7 @@ constructor(
    }

    private suspend fun determineSceneAfterTransition(
        lastStartedTransition: TransitionStep,
        lastStartedTransition: TransitionStep
    ): Pair<SceneKey, TransitionKey>? {
        val to = lastStartedTransition.to
        val from = lastStartedTransition.from
+5 −8
Original line number Diff line number Diff line
@@ -95,10 +95,7 @@ constructor(
        scope.launch {
            powerInteractor.isAwake
                .filterRelevantKeyguardStateAnd { isAwake -> isAwake }
                .sample(
                    keyguardInteractor.biometricUnlockState,
                    ::Pair,
                )
                .sample(keyguardInteractor.biometricUnlockState, ::Pair)
                .collect {
                    (
                        _,
@@ -203,21 +200,21 @@ constructor(
                            if (!SceneContainerFlag.isEnabled) {
                                startTransitionTo(
                                    KeyguardState.GONE,
                                    ownerReason = "waking from dozing"
                                    ownerReason = "waking from dozing",
                                )
                            }
                        } else if (primaryBouncerShowing) {
                            if (!SceneContainerFlag.isEnabled) {
                                startTransitionTo(
                                    KeyguardState.PRIMARY_BOUNCER,
                                    ownerReason = "waking from dozing"
                                    ownerReason = "waking from dozing",
                                )
                            }
                        } else if (isIdleOnCommunal && !communalSceneKtfRefactor()) {
                            if (!SceneContainerFlag.isEnabled) {
                                startTransitionTo(
                                    KeyguardState.GLANCEABLE_HUB,
                                    ownerReason = "waking from dozing"
                                    ownerReason = "waking from dozing",
                                )
                            }
                        } else if (isCommunalAvailable && dreamManager.canStartDreaming(true)) {
@@ -227,7 +224,7 @@ constructor(
                        } else {
                            startTransitionTo(
                                KeyguardState.LOCKSCREEN,
                                ownerReason = "waking from dozing"
                                ownerReason = "waking from dozing",
                            )
                        }
                    }
+4 −4
Original line number Diff line number Diff line
@@ -210,12 +210,12 @@ constructor(
                            // ends, to avoid transitioning to OCCLUDED erroneously when exiting
                            // the dream.
                            .debounce(100.milliseconds),
                        ::Pair
                        ::Pair,
                    )
                    .sampleFilter(
                        // When launching activities from widgets on the hub, we have a
                        // custom occlusion animation.
                        communalSceneInteractor.isLaunchingWidget,
                        communalSceneInteractor.isLaunchingWidget
                    ) { launchingWidget ->
                        !launchingWidget
                    }
@@ -253,7 +253,7 @@ constructor(
                        noneOf(
                            // When launching activities from widgets on the hub, we wait to change
                            // scenes until the activity launch is complete.
                            communalSceneInteractor.isLaunchingWidget,
                            communalSceneInteractor.isLaunchingWidget
                        ),
                    )
                    .filterRelevantKeyguardStateAnd { isKeyguardGoingAway -> isKeyguardGoingAway }
@@ -270,7 +270,7 @@ constructor(
                                newScene = CommunalScenes.Blank,
                                loggingReason = "hub to gone",
                                transitionKey = CommunalTransitionKeys.SimpleFade,
                                keyguardState = KeyguardState.GONE
                                keyguardState = KeyguardState.GONE,
                            )
                        }
                    }