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

Commit a40a9ef5 authored by twyen's avatar twyen Committed by Copybara-Service
Browse files

Remove photo support in PhoneNumberService

Also cleaned up unused parameters.

TEST=TAP
Bug: 78654933
Test: TAP
PiperOrigin-RevId: 197652430
Change-Id: I1820e8c8de83fcda17f38e92d4ab1c28f519cdce
parent c5c42189
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@ message ContactSource {
  // number's status at the time they made or received the call.
  // Type definitions are from the CachedContactInfo interface in
  // CachedNumberLookupService.java
  // When adding new sources here, consider updating the isPeopleApiSource() and
  // isBusiness() methods in LookupSourceUtils.java if needed.
  enum Type {
    UNKNOWN_SOURCE_TYPE = 0;

+0 −4
Original line number Diff line number Diff line
@@ -43,8 +43,6 @@ public interface CachedNumberLookupService {

  void addContact(Context context, CachedContactInfo info);

  boolean isCacheUri(String uri);

  boolean isBusiness(ContactSource.Type sourceType);

  boolean canReportAsInvalid(ContactSource.Type sourceType, String objectId);
@@ -71,8 +69,6 @@ public interface CachedNumberLookupService {

    void setDirectorySource(String name, long directoryId);

    void setExtendedSource(String name, long directoryId);

    void setLookupKey(String lookupKey);
  }
}
+2 −6
Original line number Diff line number Diff line
@@ -321,9 +321,7 @@ public class CallCardPresenter
      }
      this.primary.addListener(this);

      primaryContactInfo =
          ContactInfoCache.buildCacheEntryFromCall(
              context, this.primary, this.primary.getState() == DialerCallState.INCOMING);
      primaryContactInfo = ContactInfoCache.buildCacheEntryFromCall(context, this.primary);
      updatePrimaryDisplayInfo();
      maybeStartSearch(this.primary, true);
    }
@@ -339,9 +337,7 @@ public class CallCardPresenter
        updateSecondaryDisplayInfo();
      } else {
        // secondary call has changed
        secondaryContactInfo =
            ContactInfoCache.buildCacheEntryFromCall(
                context, this.secondary, this.secondary.getState() == DialerCallState.INCOMING);
        secondaryContactInfo = ContactInfoCache.buildCacheEntryFromCall(context, this.secondary);
        updateSecondaryDisplayInfo();
        maybeStartSearch(this.secondary, false);
      }
+1 −3
Original line number Diff line number Diff line
@@ -397,9 +397,7 @@ public class ConferenceParticipantListAdapter extends BaseAdapter {
      newCallIds.add(callId);
      ContactCacheEntry contactCache = cache.getInfo(callId);
      if (contactCache == null) {
        contactCache =
            ContactInfoCache.buildCacheEntryFromCall(
                getContext(), call, call.getState() == DialerCallState.INCOMING);
        contactCache = ContactInfoCache.buildCacheEntryFromCall(getContext(), call);
      }

      if (participantsByCallId.containsKey(callId)) {
+3 −16
Original line number Diff line number Diff line
@@ -138,8 +138,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener {
    return cache;
  }

  static ContactCacheEntry buildCacheEntryFromCall(
      Context context, DialerCall call, boolean isIncoming) {
  static ContactCacheEntry buildCacheEntryFromCall(Context context, DialerCall call) {
    final ContactCacheEntry entry = new ContactCacheEntry();

    // TODO: get rid of caller info.
@@ -837,7 +836,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener {
        final PhoneNumberServiceListener listener =
            new PhoneNumberServiceListener(callId, queryToken.queryId);
        cacheEntry.hasPendingQuery = true;
        phoneNumberService.getPhoneNumberInfo(cacheEntry.number, listener, listener, isIncoming);
        phoneNumberService.getPhoneNumberInfo(cacheEntry.number, listener);
      }
      sendInfoNotifications(callId, cacheEntry);
      if (!cacheEntry.hasPendingQuery) {
@@ -855,8 +854,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener {
    }
  }

  class PhoneNumberServiceListener
      implements PhoneNumberService.NumberLookupListener, PhoneNumberService.ImageLookupListener {
  class PhoneNumberServiceListener implements PhoneNumberService.NumberLookupListener {

    private final String callId;
    private final int queryIdOfRemoteLookup;
@@ -924,17 +922,6 @@ public class ContactInfoCache implements OnImageLoadCompleteListener {
        clearCallbacks(callId);
      }
    }

    @Override
    public void onImageFetchComplete(Bitmap bitmap) {
      Log.d(TAG, "PhoneNumberServiceListener.onImageFetchComplete");
      if (!isWaitingForThisQuery(callId, queryIdOfRemoteLookup)) {
        return;
      }
      CallerInfoQueryToken queryToken = new CallerInfoQueryToken(queryIdOfRemoteLookup, callId);
      loadImage(null, bitmap, queryToken);
      onImageLoadComplete(TOKEN_UPDATE_PHOTO_FOR_CALL_STATE, null, bitmap, queryToken);
    }
  }

  private boolean needForceQuery(DialerCall call, ContactCacheEntry cacheEntry) {
Loading