Home | History | Annotate | Download | only in service
      1 package com.android.dialer.service;
      2 
      3 import android.content.ContentValues;
      4 import android.content.Context;
      5 
      6 import com.android.dialer.calllog.ContactInfo;
      7 
      8 public interface CachedNumberLookupService {
      9 
     10     public interface CachedContactInfo {
     11         public ContactInfo getContactInfo();
     12 
     13         public void setDirectorySource(String name, long directoryId);
     14         public void setExtendedSource(String name, long directoryId);
     15         public void setLookupKey(String lookupKey);
     16     }
     17 
     18     public CachedContactInfo buildCachedContactInfo(ContactInfo info);
     19 
     20     /**
     21      * Perform a lookup using the cached number lookup service to return contact
     22      * information stored in the cache that corresponds to the given number.
     23      *
     24      * @param context Valid context
     25      * @param number Phone number to lookup the cache for
     26      * @return A {@link CachedContactInfo} containing the contact information if the phone
     27      * number is found in the cache, {@link ContactInfo#EMPTY} if the phone number was
     28      * not found in the cache, and null if there was an error when querying the cache.
     29      */
     30     public CachedContactInfo lookupCachedContactFromNumber(Context context, String number);
     31 
     32     public void addContact(Context context, CachedContactInfo info);
     33 
     34     public boolean isCacheUri(String uri);
     35 
     36     public boolean addPhoto(Context context, String number, byte[] photo);
     37 
     38     /**
     39      * Remove all cached phone number entries from the cache, regardless of how old they
     40      * are.
     41      *
     42      * @param context Valid context
     43      */
     44     public void clearAllCacheEntries(Context context);
     45 }
     46