From cded3beaf28a703e1ef8f71bbc6836e6806c3736 Mon Sep 17 00:00:00 2001 From: Tobias Thierer Date: Fri, 9 Jun 2017 14:16:05 +0000 Subject: Revert "Update AOSP Dialer source from internal google3 repository at cl/158012278. am: 91ce7d2a47" This reverts commit c67d658e7daa453fe9ad9fd1a37f81eaf2048c44. Reason for revert: This CL broke the sailfish-userdebug_javac-all target on master. Change-Id: I9b54333a654c00154ca84f4ece84bea4f07cc19b --- java/com/android/incallui/ContactInfoCache.java | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'java/com/android/incallui/ContactInfoCache.java') diff --git a/java/com/android/incallui/ContactInfoCache.java b/java/com/android/incallui/ContactInfoCache.java index d7eea79bd..e45eb9746 100644 --- a/java/com/android/incallui/ContactInfoCache.java +++ b/java/com/android/incallui/ContactInfoCache.java @@ -406,7 +406,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { } else { ContactCacheEntry initialCacheEntry = updateCallerInfoInCacheOnAnyThread( - callId, call.getNumberPresentation(), callerInfo, false, queryToken); + callId, call.getNumberPresentation(), callerInfo, isIncoming, false, queryToken); sendInfoNotifications(callId, initialCacheEntry); } } @@ -416,6 +416,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { String callId, int numberPresentation, CallerInfo callerInfo, + boolean isIncoming, boolean didLocalLookup, CallerInfoQueryToken queryToken) { Log.d( @@ -442,7 +443,16 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { Log.d(TAG, "Existing cacheEntry in hashMap " + existingCacheEntry); if (didLocalLookup) { - if (cacheEntry.displayPhotoUri != null) { + // Before issuing a request for more data from other services, we only check that the + // contact wasn't found in the local DB. We don't check the if the cache entry already + // has a name because we allow overriding cnap data with data from other services. + if (!callerInfo.contactExists && mPhoneNumberService != null) { + Log.d(TAG, "Contact lookup. Local contacts miss, checking remote"); + final PhoneNumberServiceListener listener = + new PhoneNumberServiceListener(callId, queryToken.mQueryId); + cacheEntry.hasPendingQuery = true; + mPhoneNumberService.getPhoneNumberInfo(cacheEntry.number, listener, listener, isIncoming); + } else if (cacheEntry.displayPhotoUri != null) { // When the difference between 2 numbers is only the prefix (e.g. + or IDD), // we will still trigger force query so that the number can be updated on // the calling screen. We need not query the image again if the previous @@ -779,7 +789,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { maybeUpdateFromCequintCallerId(ci, cw.cnapName, mIsIncoming); long time = SystemClock.uptimeMillis() - start; Log.d(TAG, "Cequint Caller Id look up takes " + time + " ms."); - updateCallerInfoInCacheOnAnyThread(cw.callId, cw.numberPresentation, ci, true, mQueryToken); + updateCallerInfoInCacheOnAnyThread(cw.callId, cw.numberPresentation, ci, mIsIncoming, true, mQueryToken); } @Override @@ -797,16 +807,6 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { clearCallbacks(callId); return; } - // Before issuing a request for more data from other services, we only check that the - // contact wasn't found in the local DB. We don't check the if the cache entry already - // has a name because we allow overriding cnap data with data from other services. - if (!callerInfo.contactExists && mPhoneNumberService != null) { - Log.d(TAG, "Contact lookup. Local contacts miss, checking remote"); - final PhoneNumberServiceListener listener = - new PhoneNumberServiceListener(callId, mQueryToken.mQueryId); - cacheEntry.hasPendingQuery = true; - mPhoneNumberService.getPhoneNumberInfo(cacheEntry.number, listener, listener, mIsIncoming); - } sendInfoNotifications(callId, cacheEntry); if (!cacheEntry.hasPendingQuery) { if (callerInfo.contactExists) { @@ -870,7 +870,6 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { entry.shouldShowLocation = oldEntry.shouldShowLocation; // Contact specific ringtone is obtained from local lookup. entry.contactRingtoneUri = oldEntry.contactRingtoneUri; - entry.originalPhoneNumber = oldEntry.originalPhoneNumber; } // If no image and it's a business, switch to using the default business avatar. -- cgit v1.2.3