1 /* 2 * Copyright (C) 2019 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.dagger; 18 19 import android.app.Service; 20 21 import com.android.systemui.SystemUIService; 22 import com.android.systemui.doze.DozeService; 23 import com.android.systemui.dreams.DreamOverlayService; 24 import com.android.systemui.dump.SystemUIAuxiliaryDumpService; 25 import com.android.systemui.keyguard.KeyguardService; 26 import com.android.systemui.screenrecord.RecordingService; 27 import com.android.systemui.statusbar.phone.NotificationListenerWithPlugins; 28 import com.android.systemui.wallpapers.ImageWallpaper; 29 30 import dagger.Binds; 31 import dagger.Module; 32 import dagger.multibindings.ClassKey; 33 import dagger.multibindings.IntoMap; 34 35 /** 36 * Services that are injectable should go here. 37 */ 38 @Module 39 public abstract class DefaultServiceBinder { 40 /** */ 41 @Binds 42 @IntoMap 43 @ClassKey(DozeService.class) bindDozeService(DozeService service)44 public abstract Service bindDozeService(DozeService service); 45 46 /** */ 47 @Binds 48 @IntoMap 49 @ClassKey(ImageWallpaper.class) bindImageWallpaper(ImageWallpaper service)50 public abstract Service bindImageWallpaper(ImageWallpaper service); 51 52 /** */ 53 @Binds 54 @IntoMap 55 @ClassKey(KeyguardService.class) bindKeyguardService(KeyguardService service)56 public abstract Service bindKeyguardService(KeyguardService service); 57 58 /** */ 59 @Binds 60 @IntoMap 61 @ClassKey(DreamOverlayService.class) bindDreamOverlayService(DreamOverlayService service)62 public abstract Service bindDreamOverlayService(DreamOverlayService service); 63 64 /** */ 65 @Binds 66 @IntoMap 67 @ClassKey(NotificationListenerWithPlugins.class) bindNotificationListenerWithPlugins( NotificationListenerWithPlugins service)68 public abstract Service bindNotificationListenerWithPlugins( 69 NotificationListenerWithPlugins service); 70 71 /** */ 72 @Binds 73 @IntoMap 74 @ClassKey(SystemUIService.class) bindSystemUIService(SystemUIService service)75 public abstract Service bindSystemUIService(SystemUIService service); 76 77 /** */ 78 @Binds 79 @IntoMap 80 @ClassKey(SystemUIAuxiliaryDumpService.class) bindSystemUIAuxiliaryDumpService(SystemUIAuxiliaryDumpService service)81 public abstract Service bindSystemUIAuxiliaryDumpService(SystemUIAuxiliaryDumpService service); 82 83 /** Inject into RecordingService */ 84 @Binds 85 @IntoMap 86 @ClassKey(RecordingService.class) bindRecordingService(RecordingService service)87 public abstract Service bindRecordingService(RecordingService service); 88 } 89