1 /*
2  * Copyright (C) 2022 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.car.qc;
18 
19 import com.android.car.qc.provider.BaseLocalQCProvider;
20 import com.android.systemui.car.privacy.CameraQcPanel;
21 import com.android.systemui.car.privacy.MicQcPanel;
22 import com.android.systemui.car.statusicon.ui.MobileSignalStatusIconController;
23 import com.android.systemui.car.statusicon.ui.WifiSignalStatusIconController;
24 import com.android.systemui.car.systembar.element.CarSystemBarElementController;
25 
26 import dagger.Binds;
27 import dagger.Module;
28 import dagger.multibindings.ClassKey;
29 import dagger.multibindings.IntoMap;
30 
31 /**
32  * Dagger injection module for {@link SystemUIQCViewController}
33  */
34 @Module
35 public abstract class QuickControlsModule {
36     /** Injects ProfileSwitcher. */
37     @Binds
38     @IntoMap
39     @ClassKey(ProfileSwitcher.class)
bindProfileSwitcher( ProfileSwitcher profileSwitcher)40     public abstract BaseLocalQCProvider bindProfileSwitcher(
41             ProfileSwitcher profileSwitcher);
42 
43     /** Injects MicQCPanel. */
44     @Binds
45     @IntoMap
46     @ClassKey(MicQcPanel.class)
bindMicQcPanel( MicQcPanel micQcPanel)47     public abstract BaseLocalQCProvider bindMicQcPanel(
48             MicQcPanel micQcPanel);
49 
50     /** Injects CameraQcPanel. */
51     @Binds
52     @IntoMap
53     @ClassKey(CameraQcPanel.class)
bindCameraQcPanel( CameraQcPanel micQcPanel)54     public abstract BaseLocalQCProvider bindCameraQcPanel(
55             CameraQcPanel micQcPanel);
56 
57     /** Injects DriveModeQcPanel. */
58     @Binds
59     @IntoMap
60     @ClassKey(DriveModeQcPanel.class)
bindDriveModeQcPanel( DriveModeQcPanel driveModeQcPanel)61     public abstract BaseLocalQCProvider bindDriveModeQcPanel(
62             DriveModeQcPanel driveModeQcPanel);
63 
64     /** Injects MobileSignalStatusIconController. */
65     @Binds
66     @IntoMap
67     @ClassKey(MobileSignalStatusIconController.class)
bindMobileSignalStatusIconController( MobileSignalStatusIconController.Factory mobileSignalStatusIconController)68     public abstract CarSystemBarElementController.Factory bindMobileSignalStatusIconController(
69             MobileSignalStatusIconController.Factory mobileSignalStatusIconController);
70 
71     /** Injects WifiSignalStatusIconController. */
72     @Binds
73     @IntoMap
74     @ClassKey(WifiSignalStatusIconController.class)
bindWifiSignalStatusIconController( WifiSignalStatusIconController.Factory wifiSignalStatusIconController)75     public abstract CarSystemBarElementController.Factory bindWifiSignalStatusIconController(
76             WifiSignalStatusIconController.Factory wifiSignalStatusIconController);
77 
78     /** Injects SystemUIQCViewController. */
79     @Binds
80     @IntoMap
81     @ClassKey(SystemUIQCViewController.class)
bindQCViewControllerFactory( SystemUIQCViewController.Factory factory)82     public abstract CarSystemBarElementController.Factory bindQCViewControllerFactory(
83             SystemUIQCViewController.Factory factory);
84 
85     /** Injects QCFooterButtonController. */
86     @Binds
87     @IntoMap
88     @ClassKey(QCFooterButtonController.class)
bindQCFooterButtonControllerFactory( QCFooterButtonController.Factory factory)89     public abstract CarSystemBarElementController.Factory bindQCFooterButtonControllerFactory(
90             QCFooterButtonController.Factory factory);
91 
92     /** Injects QCFooterViewController. */
93     @Binds
94     @IntoMap
95     @ClassKey(QCFooterViewController.class)
bindQCFooterViewControllerFactory( QCFooterViewController.Factory factory)96     public abstract CarSystemBarElementController.Factory bindQCFooterViewControllerFactory(
97             QCFooterViewController.Factory factory);
98 
99     /** Injects QCLogoutButtonController. */
100     @Binds
101     @IntoMap
102     @ClassKey(QCLogoutButtonController.class)
bindQCLogoutButtonControllerFactory( QCLogoutButtonController.Factory factory)103     public abstract CarSystemBarElementController.Factory bindQCLogoutButtonControllerFactory(
104             QCLogoutButtonController.Factory factory);
105 
106     /** Injects QCScreenOffButtonController. */
107     @Binds
108     @IntoMap
109     @ClassKey(QCScreenOffButtonController.class)
bindQCScreenOffButtonControllerFactory( QCScreenOffButtonController.Factory factory)110     public abstract CarSystemBarElementController.Factory bindQCScreenOffButtonControllerFactory(
111             QCScreenOffButtonController.Factory factory);
112 
113     /** Injects QCUserPickerButtonController. */
114     @Binds
115     @IntoMap
116     @ClassKey(QCUserPickerButtonController.class)
bindQCUserPickerButtonControllerFactory( QCUserPickerButtonController.Factory factory)117     public abstract CarSystemBarElementController.Factory bindQCUserPickerButtonControllerFactory(
118             QCUserPickerButtonController.Factory factory);
119 }
120