• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015 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.tv;
18 
19 import android.content.Context;
20 import com.android.tv.analytics.Analytics;
21 import com.android.tv.analytics.Tracker;
22 import com.android.tv.common.BaseApplication;
23 import com.android.tv.common.BaseSingletons;
24 import com.android.tv.common.experiments.ExperimentLoader;
25 import com.android.tv.common.flags.has.HasUiFlags;
26 import com.android.tv.data.ChannelDataManager;
27 import com.android.tv.data.PreviewDataManager;
28 import com.android.tv.data.ProgramDataManager;
29 import com.android.tv.data.epg.EpgFetcher;
30 import com.android.tv.data.epg.EpgReader;
31 import com.android.tv.dvr.DvrDataManager;
32 import com.android.tv.dvr.DvrManager;
33 import com.android.tv.dvr.DvrScheduleManager;
34 import com.android.tv.dvr.DvrWatchedPositionManager;
35 import com.android.tv.dvr.recorder.RecordingScheduler;
36 import com.android.tv.perf.PerformanceMonitor;
37 import com.android.tv.tunerinputcontroller.HasBuiltInTunerManager;
38 import com.android.tv.util.SetupUtils;
39 import com.android.tv.util.TvInputManagerHelper;
40 import com.android.tv.util.account.AccountHelper;
41 import com.android.tv.common.flags.BackendKnobsFlags;
42 import java.util.concurrent.Executor;
43 import javax.inject.Provider;
44 
45 /** Interface with getters for application scoped singletons. */
46 public interface TvSingletons extends BaseSingletons, HasBuiltInTunerManager, HasUiFlags {
47 
48     /**
49      * Returns the @{@link TvSingletons} using the application context.
50      *
51      * @deprecated use injection instead.
52      */
53     @Deprecated
getSingletons(Context context)54     static TvSingletons getSingletons(Context context) {
55         return (TvSingletons) BaseApplication.getSingletons(context);
56     }
57 
getAnalytics()58     Analytics getAnalytics();
59 
handleInputCountChanged()60     void handleInputCountChanged();
61 
62     @Deprecated
getChannelDataManager()63     ChannelDataManager getChannelDataManager();
64 
65     /**
66      * Checks if the {@link ChannelDataManager} instance has been created and all the channels has
67      * been loaded.
68      */
isChannelDataManagerLoadFinished()69     boolean isChannelDataManagerLoadFinished();
70 
71     /** @deprecated use injection instead. */
72     @Deprecated
getProgramDataManager()73     ProgramDataManager getProgramDataManager();
74 
75     /**
76      * Checks if the {@link ProgramDataManager} instance has been created and the current programs
77      * for all the channels has been loaded.
78      */
isProgramDataManagerCurrentProgramsLoadFinished()79     boolean isProgramDataManagerCurrentProgramsLoadFinished();
80 
getPreviewDataManager()81     PreviewDataManager getPreviewDataManager();
82 
getDvrDataManager()83     DvrDataManager getDvrDataManager();
84 
getDvrScheduleManager()85     DvrScheduleManager getDvrScheduleManager();
86 
getDvrManager()87     DvrManager getDvrManager();
88 
getRecordingScheduler()89     RecordingScheduler getRecordingScheduler();
90 
getDvrWatchedPositionManager()91     DvrWatchedPositionManager getDvrWatchedPositionManager();
92 
getInputSessionManager()93     InputSessionManager getInputSessionManager();
94 
getTracker()95     Tracker getTracker();
96 
getMainActivityWrapper()97     MainActivityWrapper getMainActivityWrapper();
98 
getAccountHelper()99     AccountHelper getAccountHelper();
100 
isRunningInMainProcess()101     boolean isRunningInMainProcess();
102 
getPerformanceMonitor()103     PerformanceMonitor getPerformanceMonitor();
104 
105     /** @deprecated use injection instead. */
106     @Deprecated
getTvInputManagerHelper()107     TvInputManagerHelper getTvInputManagerHelper();
108 
providesEpgReader()109     Provider<EpgReader> providesEpgReader();
110 
getEpgFetcher()111     EpgFetcher getEpgFetcher();
112 
113     /** @deprecated use injection instead. */
114     @Deprecated
getSetupUtils()115     SetupUtils getSetupUtils();
116 
getExperimentLoader()117     ExperimentLoader getExperimentLoader();
118 
119     /** @deprecated use injection instead. */
120     @Deprecated
getDbExecutor()121     Executor getDbExecutor();
122 
getBackendKnobs()123     BackendKnobsFlags getBackendKnobs();
124 }
125