1 /*
2  * Copyright (C) 2021 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 package com.android.systemui.statusbar.policy.dagger
18 
19 import com.android.systemui.statusbar.RemoteInputController
20 import com.android.systemui.statusbar.policy.RemoteInputView
21 import com.android.systemui.statusbar.policy.RemoteInputViewController
22 import com.android.systemui.statusbar.policy.RemoteInputViewControllerImpl
23 import dagger.Binds
24 import dagger.BindsInstance
25 import dagger.Module
26 import dagger.Subcomponent
27 import javax.inject.Qualifier
28 
29 @Subcomponent(modules = [InternalRemoteInputViewModule::class])
30 @RemoteInputViewScope
31 interface RemoteInputViewSubcomponent {
32     val controller: RemoteInputViewController
33 
34     @Subcomponent.Factory
35     interface Factory {
createnull36         fun create(
37             @BindsInstance view: RemoteInputView,
38             @BindsInstance remoteInputController: RemoteInputController
39         ): RemoteInputViewSubcomponent
40     }
41 }
42 
43 @Module
44 interface InternalRemoteInputViewModule {
45     @Binds
46     fun bindController(impl: RemoteInputViewControllerImpl): RemoteInputViewController
47 }
48 
49 @Qualifier
50 @Retention(AnnotationRetention.BINARY)
51 internal annotation class RemoteInputViewScope
52