Home | History | Annotate | Download | only in dialerbind
      1 /*
      2  * Copyright (C) 2013 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.dialerbind;
     18 
     19 import static com.android.dialer.calllog.CallLogAdapter.CallFetcher;
     20 
     21 import android.content.Context;
     22 import android.support.annotation.Nullable;
     23 
     24 import com.android.dialer.calllog.CallLogAdapter;
     25 import com.android.dialer.calllog.ContactInfoHelper;
     26 import com.android.dialer.list.RegularSearchFragment;
     27 import com.android.dialer.logging.Logger;
     28 import com.android.dialer.service.CachedNumberLookupService;
     29 import com.android.dialer.service.ExtendedBlockingButtonRenderer;
     30 import com.android.dialer.voicemail.VoicemailPlaybackPresenter;
     31 
     32 /**
     33  * Default static binding for various objects.
     34  */
     35 public class ObjectFactory {
     36 
     37     public static CachedNumberLookupService newCachedNumberLookupService() {
     38         // no-op
     39         return null;
     40     }
     41 
     42     public static String getFilteredNumberProviderAuthority() {
     43         return "com.android.dialer.database.filterednumberprovider";
     44     }
     45 
     46     public static String getVoicemailArchiveProviderAuthority() {
     47         return "com.android.dialer.database.voicemailarchiveprovider";
     48     }
     49 
     50     public static boolean isVoicemailArchiveEnabled(Context context) {
     51         return false;
     52     }
     53 
     54     public static boolean isVoicemailShareEnabled(Context context) {
     55         return false;
     56     }
     57 
     58     public static boolean isNewBlockingEnabled(Context context) {
     59         return true;
     60     }
     61 
     62     @Nullable
     63     public static ExtendedBlockingButtonRenderer newExtendedBlockingButtonRenderer(
     64             Context context, ExtendedBlockingButtonRenderer.Listener listener) {
     65         return null;
     66     }
     67 
     68     /**
     69      * Create a new instance of the call log adapter.
     70      * @param context The context to use.
     71      * @param callFetcher Instance of call fetcher to use.
     72      * @param contactInfoHelper Instance of contact info helper class to use.
     73      * @return Instance of CallLogAdapter.
     74      */
     75     public static CallLogAdapter newCallLogAdapter(
     76             Context context,
     77             CallFetcher callFetcher,
     78             ContactInfoHelper contactInfoHelper,
     79             VoicemailPlaybackPresenter voicemailPlaybackPresenter,
     80             int activityType) {
     81         return new CallLogAdapter(
     82                 context,
     83                 callFetcher,
     84                 contactInfoHelper,
     85                 voicemailPlaybackPresenter,
     86                 activityType);
     87     }
     88 
     89     public static Logger getLoggerInstance() {
     90         // no-op
     91         return null;
     92     }
     93 
     94     public static RegularSearchFragment newRegularSearchFragment() {
     95         return new RegularSearchFragment();
     96     }
     97 }
     98