Respect threadId when sending MMS

This commit is contained in:
Moez Bhatti
2019-12-26 18:20:14 -05:00
parent af2f694b1a
commit 0dadcfb3dc
6 changed files with 16 additions and 16 deletions
@@ -169,7 +169,7 @@ public class DownloadRequest extends MmsRequest {
// }
// Store the downloaded message
final PduPersister persister = PduPersister.getPduPersister(context);
final Uri messageUri = persister.persist(pdu, Telephony.Mms.Inbox.CONTENT_URI, true, true, null);
final Uri messageUri = persister.persist(pdu, Telephony.Mms.Inbox.CONTENT_URI, PduPersister.DUMMY_THREAD_ID, true, true, null);
if (messageUri == null) {
Timber.e("DownloadRequest.persistIfRequired: can not persist message");
return null;
@@ -110,9 +110,8 @@ public class NotificationTransaction extends Transaction implements Runnable {
try {
// Save the pdu. If we can start downloading the real pdu immediately, don't allow
// persist() to create a thread for the notificationInd because it causes UI jank.
mUri = PduPersister.getPduPersister(context).persist(
ind, Inbox.CONTENT_URI, !allowAutoDownload(mContext),
true, null);
mUri = PduPersister.getPduPersister(context).persist(ind, Inbox.CONTENT_URI,
PduPersister.DUMMY_THREAD_ID, !allowAutoDownload(mContext), true, null);
} catch (MmsException e) {
Timber.e(e, "Failed to save NotificationInd in constructor.");
throw new IllegalArgumentException();
@@ -185,8 +184,8 @@ public class NotificationTransaction extends Transaction implements Runnable {
} else {
// Save the received PDU (must be a M-RETRIEVE.CONF).
PduPersister p = PduPersister.getPduPersister(mContext);
Uri uri = p.persist(pdu, Inbox.CONTENT_URI, true,
true, null);
Uri uri = p.persist(pdu, Inbox.CONTENT_URI, PduPersister.DUMMY_THREAD_ID,
true, true, null);
RetrieveConf retrieveConf = (RetrieveConf) pdu;
@@ -107,8 +107,8 @@ public class PushReceiver extends BroadcastReceiver {
break;
}
Uri uri = p.persist(pdu, Uri.parse("content://mms/inbox"), true,
true, null);
Uri uri = p.persist(pdu, Uri.parse("content://mms/inbox"),
PduPersister.DUMMY_THREAD_ID, true, true, null);
// Update thread ID for ReadOrigInd & DeliveryInd.
ContentValues values = new ContentValues(1);
values.put(Mms.THREAD_ID, threadId);
@@ -136,7 +136,8 @@ public class PushReceiver extends BroadcastReceiver {
// Save the pdu. If we can start downloading the real pdu immediately,
// don't allow persist() to create a thread for the notificationInd
// because it causes UI jank.
Uri uri = p.persist(pdu, Inbox.CONTENT_URI, true, true, null);
Uri uri = p.persist(pdu, Inbox.CONTENT_URI,
PduPersister.DUMMY_THREAD_ID, true, true, null);
String location = getContentLocation(mContext, uri);
if (downloadedUrls.contains(location)) {
@@ -153,8 +153,8 @@ public class RetrieveTransaction extends Transaction implements Runnable {
} else {
// Store M-Retrieve.conf into Inbox
PduPersister persister = PduPersister.getPduPersister(mContext);
msgUri = persister.persist(retrieveConf, Inbox.CONTENT_URI, true,
true, null);
msgUri = persister.persist(retrieveConf, Inbox.CONTENT_URI,
PduPersister.DUMMY_THREAD_ID, true, true, null);
// Use local time instead of PDU time
ContentValues values = new ContentValues(3);