diff options
author | Victor Chang <vichang@google.com> | 2016-02-10 18:41:50 +0000 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2016-02-11 21:16:34 +0000 |
commit | f436fb5f5f6fd08a21beb5fb1b27478526ba1e9c (patch) | |
tree | 49605ab65954510c2afa2c3791e799b343dd395e /src | |
parent | 79ca8cccf1af9c803e77378992bc011676c185d5 (diff) |
Cache directory photo in app storage through CachedNumberLookupService
[cherry-pick from ag/864087]
To avoid OOM, take InputStream instead byte[] as argument.
BUG=26111304
Change-Id: Ia985e58eea90c2acfd988494ea153955daa3c272
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/service/CachedNumberLookupService.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/dialer/service/CachedNumberLookupService.java b/src/com/android/dialer/service/CachedNumberLookupService.java index e91d458ce..018ada93f 100644 --- a/src/com/android/dialer/service/CachedNumberLookupService.java +++ b/src/com/android/dialer/service/CachedNumberLookupService.java @@ -1,9 +1,13 @@ package com.android.dialer.service; import android.content.Context; +import android.net.Uri; +import android.support.annotation.Nullable; import com.android.dialer.calllog.ContactInfo; +import java.io.InputStream; + public interface CachedNumberLookupService { public interface CachedContactInfo { @@ -42,7 +46,10 @@ public interface CachedNumberLookupService { public boolean isBusiness(int sourceType); public boolean canReportAsInvalid(int sourceType, String objectId); - public boolean addPhoto(Context context, String number, byte[] photo); + /** + * @return return {@link Uri} to the photo or return {@code null} when failing to add photo + */ + public @Nullable Uri addPhoto(Context context, String number, InputStream in); /** * Remove all cached phone number entries from the cache, regardless of how old they |