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.ImageWallpaper; 22 import com.android.systemui.SystemUIService; 23 import com.android.systemui.doze.DozeService; 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.screenshot.TakeScreenshotService; 28 29 import dagger.Binds; 30 import dagger.Module; 31 import dagger.multibindings.ClassKey; 32 import dagger.multibindings.IntoMap; 33 34 /** 35 * Services that are injectable should go here. 36 */ 37 @Module 38 public abstract class DefaultServiceBinder { 39 /** */ 40 @Binds 41 @IntoMap 42 @ClassKey(DozeService.class) bindDozeService(DozeService service)43 public abstract Service bindDozeService(DozeService service); 44 45 /** */ 46 @Binds 47 @IntoMap 48 @ClassKey(ImageWallpaper.class) bindImageWallpaper(ImageWallpaper service)49 public abstract Service bindImageWallpaper(ImageWallpaper service); 50 51 /** */ 52 @Binds 53 @IntoMap 54 @ClassKey(KeyguardService.class) bindKeyguardService(KeyguardService service)55 public abstract Service bindKeyguardService(KeyguardService service); 56 57 /** */ 58 @Binds 59 @IntoMap 60 @ClassKey(SystemUIService.class) bindSystemUIService(SystemUIService service)61 public abstract Service bindSystemUIService(SystemUIService service); 62 63 /** */ 64 @Binds 65 @IntoMap 66 @ClassKey(SystemUIAuxiliaryDumpService.class) bindSystemUIAuxiliaryDumpService(SystemUIAuxiliaryDumpService service)67 public abstract Service bindSystemUIAuxiliaryDumpService(SystemUIAuxiliaryDumpService service); 68 69 /** Inject into RecordingService */ 70 @Binds 71 @IntoMap 72 @ClassKey(RecordingService.class) bindRecordingService(RecordingService service)73 public abstract Service bindRecordingService(RecordingService service); 74 } 75