summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/ContactInfoCache.java
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-06-19 11:26:01 -0700
committerEric Erfanian <erfanian@google.com>2017-06-19 11:30:45 -0700
commit2f1c7586bcce334ca69022eb8dc6d8965ceb6a05 (patch)
treebf00ada449ee3de31ec983a14e84159200aa18c2 /java/com/android/incallui/ContactInfoCache.java
parent3d0ca68e466482971a4cf46576c50cb2bd42bcb5 (diff)
Update AOSP Dialer source from internal google3 repository at
cl/159428781. Test: make, treehugger This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/152373142 (4/06/2017) to cl/159428781 (6/19/2017). This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Change-Id: Ie60a84b3936efd0ea3d95d7c86bf96d2b1663030
Diffstat (limited to 'java/com/android/incallui/ContactInfoCache.java')
-rw-r--r--java/com/android/incallui/ContactInfoCache.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/java/com/android/incallui/ContactInfoCache.java b/java/com/android/incallui/ContactInfoCache.java
index e45eb9746..fdfba3b9f 100644
--- a/java/com/android/incallui/ContactInfoCache.java
+++ b/java/com/android/incallui/ContactInfoCache.java
@@ -33,6 +33,7 @@ import android.support.annotation.MainThread;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.WorkerThread;
+import android.support.v4.content.ContextCompat;
import android.support.v4.os.UserManagerCompat;
import android.telecom.TelecomManager;
import android.telephony.PhoneNumberUtils;
@@ -406,7 +407,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener {
} else {
ContactCacheEntry initialCacheEntry =
updateCallerInfoInCacheOnAnyThread(
- callId, call.getNumberPresentation(), callerInfo, isIncoming, false, queryToken);
+ callId, call.getNumberPresentation(), callerInfo, false, queryToken);
sendInfoNotifications(callId, initialCacheEntry);
}
}
@@ -416,7 +417,6 @@ public class ContactInfoCache implements OnImageLoadCompleteListener {
String callId,
int numberPresentation,
CallerInfo callerInfo,
- boolean isIncoming,
boolean didLocalLookup,
CallerInfoQueryToken queryToken) {
Log.d(
@@ -443,16 +443,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener {
Log.d(TAG, "Existing cacheEntry in hashMap " + existingCacheEntry);
if (didLocalLookup) {
- // 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) {
+ 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
@@ -606,7 +597,7 @@ public class ContactInfoCache implements OnImageLoadCompleteListener {
// This will only be true for emergency numbers
if (info.photoResource != 0) {
- cce.photo = context.getResources().getDrawable(info.photoResource);
+ cce.photo = ContextCompat.getDrawable(context, info.photoResource);
} else if (info.isCachedPhotoCurrent) {
if (info.cachedPhoto != null) {
cce.photo = info.cachedPhoto;
@@ -789,7 +780,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, mIsIncoming, true, mQueryToken);
+ updateCallerInfoInCacheOnAnyThread(cw.callId, cw.numberPresentation, ci, true, mQueryToken);
}
@Override
@@ -807,6 +798,16 @@ 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,6 +871,7 @@ 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.