1 /* 2 * Copyright (C) 2025 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.launcher3.util 18 19 import com.android.launcher3.FakeLauncherPrefs 20 import com.android.launcher3.LauncherPrefs 21 import com.android.launcher3.dagger.ApiWrapperModule 22 import com.android.launcher3.dagger.AppModule 23 import com.android.launcher3.dagger.StaticObjectModule 24 import com.android.launcher3.dagger.WidgetModule 25 import com.android.launcher3.dagger.WindowManagerProxyModule 26 import dagger.Binds 27 import dagger.Module 28 29 private class DaggerGraphs {} 30 31 @Module 32 abstract class FakePrefsModule { bindLauncherPrefsnull33 @Binds abstract fun bindLauncherPrefs(prefs: FakeLauncherPrefs): LauncherPrefs 34 } 35 36 /** All modules. We also exclude the plugin module from tests */ 37 @Module( 38 includes = 39 [ 40 ApiWrapperModule::class, 41 WindowManagerProxyModule::class, 42 StaticObjectModule::class, 43 WidgetModule::class, 44 AppModule::class, 45 ] 46 ) 47 class AllModulesForTest 48 49 /** All modules except the WMProxy */ 50 @Module( 51 includes = 52 [ApiWrapperModule::class, StaticObjectModule::class, AppModule::class, WidgetModule::class] 53 ) 54 class AllModulesMinusWMProxy 55 56 /** All modules except the ApiWrapper */ 57 @Module( 58 includes = 59 [ 60 WindowManagerProxyModule::class, 61 StaticObjectModule::class, 62 AppModule::class, 63 WidgetModule::class, 64 ] 65 ) 66 class AllModulesMinusApiWrapper 67