Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f436fb5f authored by Victor Chang's avatar Victor Chang
Browse files

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
parent 79ca8ccc
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
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