1 /* 2 * Copyright (C) 2017 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.dialer.phonelookup; 18 19 import com.android.dialer.phonelookup.blockednumber.DialerBlockedNumberPhoneLookup; 20 import com.android.dialer.phonelookup.blockednumber.SystemBlockedNumberPhoneLookup; 21 import com.android.dialer.phonelookup.cp2.Cp2DefaultDirectoryPhoneLookup; 22 import com.android.dialer.phonelookup.cp2.Cp2ExtendedDirectoryPhoneLookup; 23 import com.android.dialer.phonelookup.spam.SpamPhoneLookup; 24 import com.google.common.collect.ImmutableList; 25 import dagger.Module; 26 import dagger.Provides; 27 28 /** Dagger module which binds the PhoneLookup implementation. */ 29 @Module 30 public abstract class PhoneLookupModule { 31 32 @Provides 33 @SuppressWarnings({"unchecked", "rawtype"}) providePhoneLookupList( Cp2DefaultDirectoryPhoneLookup cp2DefaultDirectoryPhoneLookup, Cp2ExtendedDirectoryPhoneLookup cp2ExtendedDirectoryPhoneLookup, DialerBlockedNumberPhoneLookup dialerBlockedNumberPhoneLookup, SystemBlockedNumberPhoneLookup systemBlockedNumberPhoneLookup, SpamPhoneLookup spamPhoneLookup)34 static ImmutableList<PhoneLookup> providePhoneLookupList( 35 Cp2DefaultDirectoryPhoneLookup cp2DefaultDirectoryPhoneLookup, 36 Cp2ExtendedDirectoryPhoneLookup cp2ExtendedDirectoryPhoneLookup, 37 DialerBlockedNumberPhoneLookup dialerBlockedNumberPhoneLookup, 38 SystemBlockedNumberPhoneLookup systemBlockedNumberPhoneLookup, 39 SpamPhoneLookup spamPhoneLookup) { 40 return ImmutableList.of( 41 cp2DefaultDirectoryPhoneLookup, 42 cp2ExtendedDirectoryPhoneLookup, 43 dialerBlockedNumberPhoneLookup, 44 systemBlockedNumberPhoneLookup, 45 spamPhoneLookup); 46 } 47 } 48