am 4c99d707: Tag message notifications with people
* commit '4c99d70732d5bf20d34da3ce76753e00c7ae7c39':
Tag message notifications with people
diff --git a/src/com/android/mms/data/Contact.java b/src/com/android/mms/data/Contact.java
index 3a75b7c..e1aa906 100644
--- a/src/com/android/mms/data/Contact.java
+++ b/src/com/android/mms/data/Contact.java
@@ -92,6 +92,7 @@
private boolean mQueryPending;
private boolean mIsMe; // true if this contact is me!
private boolean mSendToVoicemail; // true if this contact should not put up notification
+ private Uri mPeopleReferenceUri;
public interface UpdateListener {
public void onUpdate(Contact updated);
@@ -329,6 +330,10 @@
return mContactMethodType;
}
+ public Uri getPeopleReferenceUri() {
+ return mPeopleReferenceUri;
+ }
+
public long getContactMethodId() {
return mContactMethodId;
}
@@ -745,6 +750,7 @@
c.mNumberE164 = entry.mNumberE164;
c.mName = entry.mName;
c.mSendToVoicemail = entry.mSendToVoicemail;
+ c.mPeopleReferenceUri = entry.mPeopleReferenceUri;
c.notSynchronizedUpdateNameAndNumber();
@@ -842,6 +848,7 @@
private Contact getContactInfoForPhoneNumber(String number) {
Contact entry = new Contact(number);
entry.mContactMethodType = CONTACT_METHOD_TYPE_PHONE;
+ entry.mPeopleReferenceUri = Uri.fromParts("tel", number, null);
if (Log.isLoggable(LogTag.CONTACT, Log.DEBUG)) {
log("queryContactInfoByNumber: number=" + number);
@@ -1014,6 +1021,7 @@
private Contact getContactInfoForEmailAddress(String email) {
Contact entry = new Contact(email);
entry.mContactMethodType = CONTACT_METHOD_TYPE_EMAIL;
+ entry.mPeopleReferenceUri = Uri.fromParts("mailto", email, null);
Cursor cursor = SqliteWrapper.query(mContext, mContext.getContentResolver(),
EMAIL_WITH_PRESENCE_URI,
diff --git a/src/com/android/mms/transaction/MessagingNotification.java b/src/com/android/mms/transaction/MessagingNotification.java
index 39623d4..d925cf7 100644
--- a/src/com/android/mms/transaction/MessagingNotification.java
+++ b/src/com/android/mms/transaction/MessagingNotification.java
@@ -912,6 +912,14 @@
.setPriority(Notification.PRIORITY_DEFAULT); // TODO: set based on contact coming
// from a favorite.
+ // Tag notification with all senders.
+ for (NotificationInfo info : notificationSet) {
+ Uri peopleReferenceUri = info.mSender.getPeopleReferenceUri();
+ if (peopleReferenceUri != null) {
+ noti.addPerson(peopleReferenceUri.toString());
+ }
+ }
+
int defaults = 0;
if (isNew) {