diff options
author | Victor Chang <vichang@google.com> | 2016-02-10 18:41:50 +0000 |
---|---|---|
committer | Victor Chang <vichang@google.com> | 2016-02-10 20:23:58 +0000 |
commit | 4bac67ae73258fe866feef5b76d6a06e797bf982 (patch) | |
tree | 335886c3f6592894864cb707f58bd57b69747b2e | |
parent | 886b123ecb1f991c8c82800b71de30532b1a2872 (diff) |
Cache directory photo in app storage through CachedNumberLookupService
To avoid OOM, take InputStream instead byte[] as argument.
BUG=26111304
Change-Id: Ia985e58eea90c2acfd988494ea153955daa3c272
-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 |