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

Commit c645174d authored by David Saff's avatar David Saff Committed by Android (Google) Code Review
Browse files

Merge "Move most SceneFrameworkIntegrationTest state to Kosmos" into main

parents ef70eecf d619a7ad
Loading
Loading
Loading
Loading
+168 −248

File changed.

Preview size limit exceeded, changes collapsed.

+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.keyguard.ui.viewmodel

import com.android.systemui.communal.domain.interactor.communalInteractor
import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.shade.domain.interactor.shadeInteractor

val Kosmos.lockscreenUserActionsViewModel by Fixture {
    LockscreenUserActionsViewModel(
        deviceEntryInteractor = deviceEntryInteractor,
        communalInteractor = communalInteractor,
        shadeInteractor = shadeInteractor,
    )
}
+24 −0
Original line number Diff line number Diff line
package com.android.systemui.scene

import com.android.compose.animation.scene.ObservableTransitionState
import com.android.systemui.classifier.domain.interactor.falsingInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.power.domain.interactor.powerInteractor
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.scene.shared.logger.sceneLogger
import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.SceneContainerConfig
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.ui.FakeOverlay
import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel
import kotlinx.coroutines.flow.MutableStateFlow

var Kosmos.sceneKeys by Fixture {
    listOf(
@@ -51,3 +58,20 @@ var Kosmos.sceneContainerConfig by Fixture {
        navigationDistances = navigationDistances,
    )
}

val Kosmos.transitionState by Fixture {
    MutableStateFlow<ObservableTransitionState>(
        ObservableTransitionState.Idle(sceneContainerConfig.initialSceneKey)
    )
}

val Kosmos.sceneContainerViewModel by Fixture {
    SceneContainerViewModel(
            sceneInteractor = sceneInteractor,
            falsingInteractor = falsingInteractor,
            powerInteractor = powerInteractor,
            motionEventHandlerReceiver = {},
            logger = sceneLogger
        )
        .apply { setTransitionState(transitionState) }
}
+2 −1
Original line number Diff line number Diff line
@@ -21,4 +21,5 @@ import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.util.mockito.mock

var Kosmos.telecomManager by Fixture<TelecomManager?> { mock() }
val Kosmos.mockTelecomManager by Fixture<TelecomManager> { mock() }
var Kosmos.telecomManager by Fixture<TelecomManager?> { mockTelecomManager }