• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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 android.content.Context;
20 
21 import androidx.annotation.Nullable;
22 
23 import com.android.launcher3.InvariantDeviceProfile;
24 import com.android.launcher3.LauncherAppState;
25 import com.android.launcher3.LauncherPrefs;
26 import com.android.launcher3.RemoveAnimationSettingsTracker;
27 import com.android.launcher3.graphics.GridCustomizationsProxy;
28 import com.android.launcher3.graphics.ThemeManager;
29 import com.android.launcher3.icons.LauncherIcons.IconPool;
30 import com.android.launcher3.model.ItemInstallQueue;
31 import com.android.launcher3.model.LoaderCursor.LoaderCursorFactory;
32 import com.android.launcher3.model.WidgetsFilterDataProvider;
33 import com.android.launcher3.pm.InstallSessionHelper;
34 import com.android.launcher3.pm.UserCache;
35 import com.android.launcher3.util.ApiWrapper;
36 import com.android.launcher3.util.DaggerSingletonTracker;
37 import com.android.launcher3.util.DisplayController;
38 import com.android.launcher3.util.DynamicResource;
39 import com.android.launcher3.util.LockedUserState;
40 import com.android.launcher3.util.MSDLPlayerWrapper;
41 import com.android.launcher3.util.PackageManagerHelper;
42 import com.android.launcher3.util.PluginManagerWrapper;
43 import com.android.launcher3.util.ScreenOnTracker;
44 import com.android.launcher3.util.SettingsCache;
45 import com.android.launcher3.util.VibratorWrapper;
46 import com.android.launcher3.util.WallpaperColorHints;
47 import com.android.launcher3.util.window.RefreshRateTracker;
48 import com.android.launcher3.util.window.WindowManagerProxy;
49 import com.android.launcher3.widget.LauncherWidgetHolder.WidgetHolderFactory;
50 import com.android.launcher3.widget.custom.CustomWidgetManager;
51 
52 import dagger.BindsInstance;
53 
54 import javax.inject.Named;
55 
56 /**
57  * Launcher base component for Dagger injection.
58  *
59  * This class is not actually annotated as a Dagger component, since it is not used directly as one.
60  * Doing so generates unnecessary code bloat.
61  *
62  * See {@link LauncherAppComponent} for the one actually used by AOSP.
63  */
64 public interface LauncherBaseAppComponent {
getDaggerSingletonTracker()65     DaggerSingletonTracker getDaggerSingletonTracker();
getApiWrapper()66     ApiWrapper getApiWrapper();
getCustomWidgetManager()67     CustomWidgetManager getCustomWidgetManager();
getDynamicResource()68     DynamicResource getDynamicResource();
getInstallSessionHelper()69     InstallSessionHelper getInstallSessionHelper();
getItemInstallQueue()70     ItemInstallQueue getItemInstallQueue();
getRefreshRateTracker()71     RefreshRateTracker getRefreshRateTracker();
getScreenOnTracker()72     ScreenOnTracker getScreenOnTracker();
getSettingsCache()73     SettingsCache getSettingsCache();
getPackageManagerHelper()74     PackageManagerHelper getPackageManagerHelper();
getPluginManagerWrapper()75     PluginManagerWrapper getPluginManagerWrapper();
getVibratorWrapper()76     VibratorWrapper getVibratorWrapper();
getMSDLPlayerWrapper()77     MSDLPlayerWrapper getMSDLPlayerWrapper();
getWmProxy()78     WindowManagerProxy getWmProxy();
getLauncherPrefs()79     LauncherPrefs getLauncherPrefs();
getThemeManager()80     ThemeManager getThemeManager();
getUserCache()81     UserCache getUserCache();
getDisplayController()82     DisplayController getDisplayController();
getWallpaperColorHints()83     WallpaperColorHints getWallpaperColorHints();
getLockedUserState()84     LockedUserState getLockedUserState();
getIDP()85     InvariantDeviceProfile getIDP();
getIconPool()86     IconPool getIconPool();
getRemoveAnimationSettingsTracker()87     RemoveAnimationSettingsTracker getRemoveAnimationSettingsTracker();
getLauncherAppState()88     LauncherAppState getLauncherAppState();
getGridCustomizationsProxy()89     GridCustomizationsProxy getGridCustomizationsProxy();
getWidgetsFilterDataProvider()90     WidgetsFilterDataProvider getWidgetsFilterDataProvider();
91 
getLoaderCursorFactory()92     LoaderCursorFactory getLoaderCursorFactory();
getWidgetHolderFactory()93     WidgetHolderFactory getWidgetHolderFactory();
getFrameRateProvider()94     RefreshRateTracker getFrameRateProvider();
95 
96     /** Builder for LauncherBaseAppComponent. */
97     interface Builder {
appContext(@pplicationContext Context context)98         @BindsInstance Builder appContext(@ApplicationContext Context context);
iconsDbName(@ullable @amed"ICONS_DB") String dbFileName)99         @BindsInstance Builder iconsDbName(@Nullable @Named("ICONS_DB") String dbFileName);
setSafeModeEnabled(@amed"SAFE_MODE") boolean safeModeEnabled)100         @BindsInstance Builder setSafeModeEnabled(@Named("SAFE_MODE") boolean safeModeEnabled);
build()101         LauncherBaseAppComponent build();
102     }
103 }
104