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 package com.android.systemui.smartspace.dagger 17 18 import com.android.systemui.plugins.BcSmartspaceDataPlugin 19 import com.android.systemui.smartspace.SmartspacePrecondition 20 import com.android.systemui.smartspace.SmartspaceTargetFilter 21 import com.android.systemui.smartspace.data.repository.SmartspaceRepositoryModule 22 import com.android.systemui.smartspace.preconditions.LockscreenPrecondition 23 import dagger.Binds 24 import dagger.BindsOptionalOf 25 import dagger.Module 26 import javax.inject.Named 27 28 @Module(subcomponents = [SmartspaceViewComponent::class], 29 includes = [SmartspaceRepositoryModule::class]) 30 abstract class SmartspaceModule { 31 @Module 32 companion object { 33 /** 34 * The BcSmartspaceDataProvider for dreams. 35 */ 36 const val DREAM_SMARTSPACE_DATA_PLUGIN = "dreams_smartspace_data_plugin" 37 38 /** 39 * The BcSmartspaceDataPlugin for the standalone weather on dream. 40 */ 41 const val DREAM_WEATHER_SMARTSPACE_DATA_PLUGIN = "dream_weather_smartspace_data_plugin" 42 43 /** 44 * The target filter for smartspace over lockscreen. 45 */ 46 const val LOCKSCREEN_SMARTSPACE_TARGET_FILTER = "lockscreen_smartspace_target_filter" 47 48 /** 49 * The precondition for smartspace over lockscreen 50 */ 51 const val LOCKSCREEN_SMARTSPACE_PRECONDITION = "lockscreen_smartspace_precondition" 52 53 /** 54 * The BcSmartspaceDataPlugin for the standalone date (+alarm+dnd). 55 */ 56 const val DATE_SMARTSPACE_DATA_PLUGIN = "date_smartspace_data_plugin" 57 58 /** 59 * The BcSmartspaceDataPlugin for the standalone weather. 60 */ 61 const val WEATHER_SMARTSPACE_DATA_PLUGIN = "weather_smartspace_data_plugin" 62 63 /** 64 * The BcSmartspaceDataProvider for the glanceable hub. 65 */ 66 const val GLANCEABLE_HUB_SMARTSPACE_DATA_PLUGIN = "glanceable_hub_smartspace_data_plugin" 67 } 68 69 @BindsOptionalOf 70 @Named(LOCKSCREEN_SMARTSPACE_TARGET_FILTER) optionalDreamSmartspaceTargetFilternull71 abstract fun optionalDreamSmartspaceTargetFilter(): SmartspaceTargetFilter? 72 73 @BindsOptionalOf 74 @Named(DREAM_SMARTSPACE_DATA_PLUGIN) 75 abstract fun optionalDreamsBcSmartspaceDataPlugin(): BcSmartspaceDataPlugin? 76 77 @BindsOptionalOf 78 @Named(DREAM_WEATHER_SMARTSPACE_DATA_PLUGIN) 79 abstract fun optionalDreamWeatherSmartspaceDataPlugin(): BcSmartspaceDataPlugin? 80 81 @Binds 82 @Named(LOCKSCREEN_SMARTSPACE_PRECONDITION) 83 abstract fun bindSmartspacePrecondition( 84 lockscreenPrecondition: LockscreenPrecondition? 85 ): SmartspacePrecondition? 86 87 @BindsOptionalOf 88 @Named(GLANCEABLE_HUB_SMARTSPACE_DATA_PLUGIN) 89 abstract fun optionalBcSmartspaceDataPlugin(): BcSmartspaceDataPlugin? 90 } 91