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.dagger 18 19 import com.android.launcher3.uioverrides.QuickstepWidgetHolder.QuickstepWidgetHolderFactory 20 import com.android.launcher3.uioverrides.SystemApiWrapper 21 import com.android.launcher3.uioverrides.plugins.PluginManagerWrapperImpl 22 import com.android.launcher3.util.ApiWrapper 23 import com.android.launcher3.util.PluginManagerWrapper 24 import com.android.launcher3.util.window.RefreshRateTracker 25 import com.android.launcher3.util.window.WindowManagerProxy 26 import com.android.launcher3.widget.LauncherWidgetHolder.WidgetHolderFactory 27 import com.android.quickstep.util.ChoreographerFrameRateTracker 28 import com.android.quickstep.util.GestureExclusionManager 29 import com.android.quickstep.util.SystemWindowManagerProxy 30 import dagger.Binds 31 import dagger.Module 32 import dagger.Provides 33 34 private object Modules {} 35 36 @Module 37 abstract class WindowManagerProxyModule { bindWindowManagerProxynull38 @Binds abstract fun bindWindowManagerProxy(proxy: SystemWindowManagerProxy): WindowManagerProxy 39 } 40 41 @Module 42 abstract class ApiWrapperModule { 43 @Binds abstract fun bindApiWrapper(systemApiWrapper: SystemApiWrapper): ApiWrapper 44 } 45 46 @Module 47 abstract class WidgetModule { 48 49 @Binds bindWidgetHolderFactorynull50 abstract fun bindWidgetHolderFactory(factor: QuickstepWidgetHolderFactory): WidgetHolderFactory 51 } 52 53 @Module 54 abstract class PluginManagerWrapperModule { 55 @Binds 56 abstract fun bindPluginManagerWrapper(impl: PluginManagerWrapperImpl): PluginManagerWrapper 57 } 58 59 @Module 60 object StaticObjectModule { 61 62 @Provides 63 @JvmStatic provideGestureExclusionManagernull64 fun provideGestureExclusionManager(): GestureExclusionManager = GestureExclusionManager.INSTANCE 65 66 @Provides 67 @JvmStatic 68 fun provideRefreshRateTracker(): RefreshRateTracker = ChoreographerFrameRateTracker 69 } 70