Refactor MMS send/download to be synchronous.

1) Make the radio change a synchronous action with a timeout.

2) Move the send logic into an MmsTransport, in preparation for
   UniversalTransport composition.

3) Move the download logic into a synchronous receiver.
This commit is contained in:
Moxie Marlinspike
2013-07-16 19:52:02 -07:00
parent 53803630d4
commit fd045f2354
14 changed files with 476 additions and 532 deletions

View File

@@ -240,6 +240,11 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
notifyConversationListeners(getThreadIdForMessage(messageId));
}
public void markAsSending(long messageId) {
updateMailboxBitmask(messageId, Types.BASE_TYPE_MASK, Types.BASE_SENDING_TYPE);
notifyConversationListeners(getThreadIdForMessage(messageId));
}
public void markAsSent(long messageId, byte[] mmsId, long status) {
SQLiteDatabase database = databaseHelper.getWritableDatabase();
ContentValues contentValues = new ContentValues();

View File

@@ -349,7 +349,7 @@ public class ThreadDatabase extends Database {
}
}
public Recipients getRecipientsForThreadId(Context context, long threadId) {
public Recipients getRecipientsForThreadId(long threadId) {
SQLiteDatabase db = databaseHelper.getReadableDatabase();
Cursor cursor = null;