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