diff options
author | Tony Mak <tonymak@google.com> | 2016-03-11 23:51:59 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-03-11 23:51:59 +0000 |
commit | 235583df88ac91476d6e2c640f12c8b212a67c4c (patch) | |
tree | 51f9c9d31be11cb703591e41e5b12bfeb4e69f45 /InCallUI/src | |
parent | 0143b242b072b10a996994f8554f20a3e0dbb3c0 (diff) | |
parent | 769f26fe7488415cb677d4980540bbd7dcfc3ac0 (diff) |
Merge "Query lookup uri with work lookup key directly is not allowed" into nyc-dev am: ebfbfa10d9
am: 769f26fe74
* commit '769f26fe7488415cb677d4980540bbd7dcfc3ac0':
Query lookup uri with work lookup key directly is not allowed
Diffstat (limited to 'InCallUI/src')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallerInfo.java | 9 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/StatusBarNotifier.java | 9 |
2 files changed, 9 insertions, 9 deletions
diff --git a/InCallUI/src/com/android/incallui/CallerInfo.java b/InCallUI/src/com/android/incallui/CallerInfo.java index a638e114c..f270678e0 100644 --- a/InCallUI/src/com/android/incallui/CallerInfo.java +++ b/InCallUI/src/com/android/incallui/CallerInfo.java @@ -237,12 +237,6 @@ public class CallerInfo { info.name = cursor.getString(columnIndex); } - columnIndex = cursor.getColumnIndex(PhoneLookup.LOOKUP_KEY); - if (columnIndex != -1) { - info.nameAlternative = ContactInfoHelper.lookUpDisplayNameAlternative( - context, cursor.getString(columnIndex)); - } - // Look for the number columnIndex = cursor.getColumnIndex(PhoneLookup.NUMBER); if (columnIndex != -1) { @@ -326,6 +320,9 @@ public class CallerInfo { : contactRef.getQueryParameter(ContactsContract.DIRECTORY_PARAM_KEY); final Long directoryId = directory == null ? null : Longs.tryParse(directory); info.userType = ContactsUtils.determineUserType(directoryId, contactId); + + info.nameAlternative = ContactInfoHelper.lookUpDisplayNameAlternative( + context, info.lookupKeyOrNull, info.userType); } cursor.close(); } diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 173fe42ec..7d212aa8e 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -36,6 +36,7 @@ import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.media.AudioAttributes; import android.net.Uri; +import android.provider.ContactsContract.Contacts; import android.support.annotation.Nullable; import android.telecom.Call.Details; import android.telecom.PhoneAccount; @@ -229,7 +230,6 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, * Sets up the main Ui for the notification */ private void buildAndSendNotification(Call originalCall, ContactCacheEntry contactInfo) { - // This can get called to update an existing notification after contact information has come // back. However, it can happen much later. Before we continue, we need to make sure that // the call being passed in is still the one we want to show in the notification. @@ -440,11 +440,14 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, private void addPersonReference(Notification.Builder builder, ContactCacheEntry contactInfo, Call call) { - if (contactInfo.lookupUri != null) { + // Query {@link Contacts#CONTENT_LOOKUP_URI} directly with work lookup key is not allowed. + // So, do not pass {@link Contacts#CONTENT_LOOKUP_URI} to NotificationManager to avoid + // NotificationManager using it. + if (contactInfo.lookupUri != null && contactInfo.userType != ContactsUtils.USER_TYPE_WORK) { builder.addPerson(contactInfo.lookupUri.toString()); } else if (!TextUtils.isEmpty(call.getNumber())) { builder.addPerson(Uri.fromParts(PhoneAccount.SCHEME_TEL, - call.getNumber(), null).toString()); + call.getNumber(), null).toString()); } } |