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
diff --git a/src/com/android/dialer/service/CachedNumberLookupService.java b/src/com/android/dialer/service/CachedNumberLookupService.java
index e91d458..018ada9 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 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