1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 @file:OptIn(ExperimentalCoroutinesApi::class)
18 
19 package com.android.systemui.shade
20 
21 import com.android.systemui.assist.AssistManager
22 import com.android.systemui.concurrency.fakeExecutor
23 import com.android.systemui.kosmos.Kosmos
24 import com.android.systemui.kosmos.applicationCoroutineScope
25 import com.android.systemui.kosmos.testDispatcher
26 import com.android.systemui.plugins.statusbar.statusBarStateController
27 import com.android.systemui.scene.domain.interactor.sceneInteractor
28 import com.android.systemui.scene.shared.flag.SceneContainerFlag
29 import com.android.systemui.shade.domain.interactor.shadeInteractor
30 import com.android.systemui.statusbar.CommandQueue
31 import com.android.systemui.statusbar.NotificationShadeWindowController
32 import com.android.systemui.statusbar.VibratorHelper
33 import com.android.systemui.statusbar.notification.row.NotificationGutsManager
34 import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
35 import com.android.systemui.statusbar.notification.stack.ui.viewmodel.windowRootViewVisibilityInteractor
36 import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
37 import com.android.systemui.statusbar.phone.statusBarKeyguardViewManager
38 import com.android.systemui.statusbar.policy.KeyguardStateController
39 import com.android.systemui.statusbar.policy.deviceProvisionedController
40 import com.android.systemui.statusbar.window.StatusBarWindowController
41 import com.android.systemui.util.mockito.mock
42 import kotlinx.coroutines.ExperimentalCoroutinesApi
43 
44 val Kosmos.shadeControllerSceneImpl by
<lambda>null45     Kosmos.Fixture {
46         ShadeControllerSceneImpl(
47             mainDispatcher = testDispatcher,
48             scope = applicationCoroutineScope,
49             shadeInteractor = shadeInteractor,
50             sceneInteractor = sceneInteractor,
51             notificationStackScrollLayout = mock<NotificationStackScrollLayout>(),
52             vibratorHelper = mock<VibratorHelper>(),
53             commandQueue = mock<CommandQueue>(),
54             statusBarKeyguardViewManager = mock<StatusBarKeyguardViewManager>(),
55             notificationShadeWindowController = mock<NotificationShadeWindowController>(),
56         ) {
57             mock<AssistManager>()
58         }
59     }
60 
61 val Kosmos.shadeControllerImpl by
<lambda>null62     Kosmos.Fixture {
63         ShadeControllerImpl(
64             mock<CommandQueue>(),
65             fakeExecutor,
66             windowRootViewVisibilityInteractor,
67             mock<KeyguardStateController>(),
68             statusBarStateController,
69             statusBarKeyguardViewManager,
70             mock<StatusBarWindowController>(),
71             deviceProvisionedController,
72             mock<NotificationShadeWindowController>(),
73             0,
74             { mock<NotificationPanelViewController>() },
75             { mock<AssistManager>() },
76             { mock<NotificationGutsManager>() },
77         )
78     }
79 var Kosmos.shadeController: ShadeController by
<lambda>null80     Kosmos.Fixture {
81         if (SceneContainerFlag.isEnabled) {
82             shadeControllerSceneImpl
83         } else {
84             shadeControllerImpl
85         }
86     }
87