Enterprise caller-id: packages/services/Telecomm

It's basically equivalent to http://ag/500455 and http://ag/499160.

Now "Send to voicemail" and the missed call notification uses the enterprise
lookup; they now work with a corp contact too.

Bug 15779911

Change-Id: I3757d76e030092ce8a9f90621459ca8f2bfae7c1
diff --git a/src/com/android/telecomm/Call.java b/src/com/android/telecomm/Call.java
index f5229cc..4055444 100644
--- a/src/com/android/telecomm/Call.java
+++ b/src/com/android/telecomm/Call.java
@@ -923,16 +923,16 @@
             mCallerInfo = callerInfo;
             Log.i(this, "CallerInfo received for %s: %s", Log.piiHandle(mHandle), callerInfo);
 
-            if (mCallerInfo.person_id != 0) {
-                Uri personUri =
-                        ContentUris.withAppendedId(Contacts.CONTENT_URI, mCallerInfo.person_id);
-                Log.d(this, "Searching person uri %s for call %s", personUri, this);
+            if (mCallerInfo.contactDisplayPhotoUri != null) {
+                Log.d(this, "Searching person uri %s for call %s",
+                        mCallerInfo.contactDisplayPhotoUri, this);
                 ContactsAsyncHelper.startObtainPhotoAsync(
                         token,
                         TelecommApp.getInstance(),
-                        personUri,
+                        mCallerInfo.contactDisplayPhotoUri,
                         sPhotoLoadListener,
                         this);
+                // Do not call onCallerInfoChanged yet in this case.  We call it in setPhoto().
             } else {
                 for (Listener l : mListeners) {
                     l.onCallerInfoChanged(this);