• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.incallui.bindings;
18 
19 import com.android.dialer.logging.ContactLookupResult;
20 
21 /** Provides phone number lookup services. */
22 public interface PhoneNumberService {
23 
24   /**
25    * Get a phone number number asynchronously.
26    *
27    * @param phoneNumber The phone number to lookup.
28    * @param listener The listener to notify when the phone number lookup is complete.
29    */
getPhoneNumberInfo(String phoneNumber, NumberLookupListener listener)30   void getPhoneNumberInfo(String phoneNumber, NumberLookupListener listener);
31 
32   interface NumberLookupListener {
33 
34     /**
35      * Callback when a phone number has been looked up.
36      *
37      * @param info The looked up information. Or (@literal null} if there are no results.
38      */
onPhoneNumberInfoComplete(PhoneNumberInfo info)39     void onPhoneNumberInfoComplete(PhoneNumberInfo info);
40   }
41 
42   interface PhoneNumberInfo {
43 
getDisplayName()44     String getDisplayName();
45 
getNumber()46     String getNumber();
47 
getPhoneType()48     int getPhoneType();
49 
getPhoneLabel()50     String getPhoneLabel();
51 
getNormalizedNumber()52     String getNormalizedNumber();
53 
getImageUrl()54     String getImageUrl();
55 
getLookupKey()56     String getLookupKey();
57 
isBusiness()58     boolean isBusiness();
59 
getLookupSource()60     ContactLookupResult.Type getLookupSource();
61   }
62 }
63