diff options
author | Tom Taylor <tomtaylor@google.com> | 2012-10-12 11:03:23 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-12 11:03:23 -0700 |
commit | ee2a5e9d14a0f1d02037c18a7c07f87b308b2cae (patch) | |
tree | 7a6fcde317da44077cff3d763f6b2114549e34fa | |
parent | 15480409f3b085b3292af0ec894d2bed2bc147a2 (diff) | |
parent | e1f17ce8cd1f968b1273938a05ef9237862827d4 (diff) | |
download | mms-ee2a5e9d14a0f1d02037c18a7c07f87b308b2cae.tar.gz |
am e1f17ce8: MMS creates a new thread when receiver is not in the Message thread
* commit 'e1f17ce8cd1f968b1273938a05ef9237862827d4':
MMS creates a new thread when receiver is not in the Message thread
-rw-r--r-- | src/java/com/google/android/mms/pdu/PduPersister.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/java/com/google/android/mms/pdu/PduPersister.java b/src/java/com/google/android/mms/pdu/PduPersister.java index 7178c6c..7e68b21 100644 --- a/src/java/com/google/android/mms/pdu/PduPersister.java +++ b/src/java/com/google/android/mms/pdu/PduPersister.java @@ -1323,11 +1323,14 @@ public class PduPersister { switch (msgType) { case PduHeaders.MESSAGE_TYPE_NOTIFICATION_IND: case PduHeaders.MESSAGE_TYPE_RETRIEVE_CONF: - // For received messages, we want to associate this message with the thread - // composed of all the recipients. This includes the person who sent the - // message or the FROM field in addition to the other people the message - // was addressed to or the TO field. loadRecipients(PduHeaders.FROM, recipients, addressMap, false); + + // For received messages when group MMS is enabled, we want to associate this + // message with the thread composed of all the recipients -- all but our own + // number, that is. This includes the person who sent the + // message or the FROM field (above) in addition to the other people the message + // was addressed to or the TO field. Our own number is in that TO field and + // we have to ignore it in loadRecipients. if (groupMmsEnabled) { loadRecipients(PduHeaders.TO, recipients, addressMap, true); } @@ -1436,6 +1439,11 @@ public class PduPersister { if (array == null) { return; } + // If the TO recipients is only a single address, then we can skip loadRecipients when + // we're excluding our own number because we know that address is our own. + if (excludeMyNumber && array.length == 1) { + return; + } String myNumber = excludeMyNumber ? mTelephonyManager.getLine1Number() : null; for (EncodedStringValue v : array) { if (v != null) { |