summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Taylor <tomtaylor@google.com>2012-09-06 12:51:55 -0700
committerTom Taylor <tomtaylor@google.com>2012-09-06 12:51:55 -0700
commita67e3955994a976ab5fafceb86055d98a100bcc0 (patch)
tree5d59fc7a71d4104a7c5f94a9387b3a27ebe3b045
parent1ed1a2641e07daf80d7a9dda693b4384ad8d0b37 (diff)
downloadmms-a67e3955994a976ab5fafceb86055d98a100bcc0.tar.gz
Optionally create threadid
Bug 7081327 Change-Id: I072d62196f8147d235173fd9abf99e322aacfdd8
-rw-r--r--src/java/com/google/android/mms/pdu/PduPersister.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/java/com/google/android/mms/pdu/PduPersister.java b/src/java/com/google/android/mms/pdu/PduPersister.java
index 8dbc90c..a2780e6 100644
--- a/src/java/com/google/android/mms/pdu/PduPersister.java
+++ b/src/java/com/google/android/mms/pdu/PduPersister.java
@@ -1213,6 +1213,19 @@ public class PduPersister {
* @return A Uri which can be used to access the stored PDU.
*/
public Uri persist(GenericPdu pdu, Uri uri) throws MmsException {
+ return persist(pdu, uri, true);
+ }
+
+ /**
+ * Persist a PDU object to specific location in the storage.
+ *
+ * @param pdu The PDU object to be stored.
+ * @param uri Where to store the given PDU object.
+ * @param createThreadId if true, this function may create a thread id for the recipients
+ * @return A Uri which can be used to access the stored PDU.
+ */
+
+ public Uri persist(GenericPdu pdu, Uri uri, boolean createThreadId) throws MmsException {
if (uri == null) {
throw new MmsException("Uri may not be null.");
}
@@ -1328,7 +1341,7 @@ public class PduPersister {
break;
}
- if (!recipients.isEmpty()) {
+ if (createThreadId && !recipients.isEmpty()) {
// Given all the recipients associated with this message, find (or create) the
// correct thread.
long threadId = Threads.getOrCreateThreadId(mContext, recipients);