diff options
-rw-r--r-- | java/com/android/incallui/ContactInfoCache.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/java/com/android/incallui/ContactInfoCache.java b/java/com/android/incallui/ContactInfoCache.java index fdfba3b9f..d50a5c26d 100644 --- a/java/com/android/incallui/ContactInfoCache.java +++ b/java/com/android/incallui/ContactInfoCache.java @@ -266,6 +266,8 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { cce.userType = info.userType; cce.originalPhoneNumber = info.phoneNumber; cce.shouldShowLocation = info.shouldShowGeoDescription; + cce.isEmergencyNumber = info.isEmergencyNumber(); + cce.isVoicemailNumber = info.isVoiceMailNumber(); if (info.contactExists) { cce.contactLookupResult = ContactLookupResult.Type.LOCAL_CONTACT; @@ -428,6 +430,19 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { + "; didLocalLookup = " + didLocalLookup); + ContactCacheEntry existingCacheEntry = mInfoMap.get(callId); + Log.d(TAG, "Existing cacheEntry in hashMap " + existingCacheEntry); + + // Mark it as emergency/voicemail if the cache exists and was emergency/voicemail before the + // number changed. + if (existingCacheEntry != null) { + if (existingCacheEntry.isEmergencyNumber) { + callerInfo.markAsEmergency(mContext); + } else if (existingCacheEntry.isVoicemailNumber) { + callerInfo.markAsVoiceMail(mContext); + } + } + int presentationMode = numberPresentation; if (callerInfo.contactExists || callerInfo.isEmergencyNumber() @@ -439,9 +454,6 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { ContactCacheEntry cacheEntry = buildEntry(mContext, callerInfo, presentationMode); cacheEntry.queryId = queryToken.mQueryId; - ContactCacheEntry existingCacheEntry = mInfoMap.get(callId); - Log.d(TAG, "Existing cacheEntry in hashMap " + existingCacheEntry); - if (didLocalLookup) { if (cacheEntry.displayPhotoUri != null) { // When the difference between 2 numbers is only the prefix (e.g. + or IDD), @@ -704,6 +716,8 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { boolean shouldShowLocation; boolean isBusiness; + boolean isEmergencyNumber; + boolean isVoicemailNumber; @Override public String toString() { @@ -743,6 +757,10 @@ public class ContactInfoCache implements OnImageLoadCompleteListener { + originalPhoneNumber + ", shouldShowLocation=" + shouldShowLocation + + ", isEmergencyNumber=" + + isEmergencyNumber + + ", isVoicemailNumber=" + + isVoicemailNumber + '}'; } } |