Update AOSP Dialer source from internal google3 repository at
cl/151342913.
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/151128062 (3/24/2017) to cl/151342913 (3/27/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: I8d4855628b62e9067e71f32ed40317617a1e3b02
diff --git a/java/com/android/incallui/ContactInfoCache.java b/java/com/android/incallui/ContactInfoCache.java
index c4e25e7..4c8963a 100644
--- a/java/com/android/incallui/ContactInfoCache.java
+++ b/java/com/android/incallui/ContactInfoCache.java
@@ -25,6 +25,7 @@
import android.os.AsyncTask;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
+import android.os.SystemClock;
import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Contacts;
@@ -42,6 +43,8 @@
import com.android.contacts.common.ContactsUtils;
import com.android.dialer.common.Assert;
import com.android.dialer.logging.nano.ContactLookupResult;
+import com.android.dialer.oem.CequintCallerIdManager;
+import com.android.dialer.oem.CequintCallerIdManager.CequintCallerIdContact;
import com.android.dialer.phonenumbercache.CachedNumberLookupService;
import com.android.dialer.phonenumbercache.CachedNumberLookupService.CachedContactInfo;
import com.android.dialer.phonenumbercache.ContactInfo;
@@ -475,6 +478,25 @@
return cacheEntry;
}
+ private void maybeUpdateFromCequintCallerId(CallerInfo callerInfo, boolean isIncoming) {
+ if (!CequintCallerIdManager.isCequintCallerIdEnabled(mContext)) {
+ return;
+ }
+ CequintCallerIdContact cequintCallerIdContact =
+ CequintCallerIdManager.getCequintCallerIdContactForInCall(
+ mContext, callerInfo.phoneNumber, callerInfo.cnapName, isIncoming);
+
+ if (!TextUtils.isEmpty(cequintCallerIdContact.name)) {
+ callerInfo.name = cequintCallerIdContact.name;
+ }
+ if (!TextUtils.isEmpty(cequintCallerIdContact.geoDescription)) {
+ callerInfo.geoDescription = cequintCallerIdContact.geoDescription;
+ }
+ if (cequintCallerIdContact.imageUrl != null) {
+ callerInfo.contactDisplayPhotoUri = Uri.parse(cequintCallerIdContact.imageUrl);
+ }
+ }
+
/**
* Implemented for ContactsAsyncHelper.OnImageLoadCompleteListener interface. Update contact photo
* when image is loaded in worker thread.
@@ -669,6 +691,7 @@
int queryId;
/** The phone number without any changes to display to the user (ex: cnap...) */
String originalPhoneNumber;
+
boolean isBusiness;
@Override
@@ -738,6 +761,10 @@
if (!isWaitingForThisQuery(cw.callId, mQueryToken.mQueryId)) {
return;
}
+ long start = SystemClock.uptimeMillis();
+ maybeUpdateFromCequintCallerId(ci, 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);
}