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 package com.android.systemui.power.domain.interactor
17 
18 import com.android.systemui.classifier.FalsingCollector
19 import com.android.systemui.classifier.FalsingCollectorFake
20 import com.android.systemui.plugins.statusbar.StatusBarStateController
21 import com.android.systemui.power.data.repository.FakePowerRepository
22 import com.android.systemui.statusbar.phone.ScreenOffAnimationController
23 import com.android.systemui.util.mockito.mock
24 
25 object PowerInteractorFactory {
26     @JvmOverloads
27     @JvmStatic
createnull28     fun create(
29         repository: FakePowerRepository = FakePowerRepository(),
30         falsingCollector: FalsingCollector = FalsingCollectorFake(),
31         screenOffAnimationController: ScreenOffAnimationController = mock(),
32         statusBarStateController: StatusBarStateController = mock(),
33     ): WithDependencies {
34         return WithDependencies(
35             repository = repository,
36             falsingCollector = falsingCollector,
37             screenOffAnimationController = screenOffAnimationController,
38             statusBarStateController = statusBarStateController,
39             powerInteractor =
40                 PowerInteractor(
41                     repository,
42                     falsingCollector,
43                     screenOffAnimationController,
44                     statusBarStateController,
45                 )
46         )
47     }
48 
49     data class WithDependencies(
50         val repository: FakePowerRepository,
51         val falsingCollector: FalsingCollector,
52         val screenOffAnimationController: ScreenOffAnimationController,
53         val statusBarStateController: StatusBarStateController,
54         val powerInteractor: PowerInteractor,
55     )
56 }
57