mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 08:28:57 +00:00
Enhanced MMS configuration prompts and processing.
1) Added a new message status to MmsDatabase to signify a pending MMS download which requires APN settings. 2) Added a database method to query MMS messages based on status. 3) Added login to SendReceiveService for processing of MMS pending APN information. 4) Moved all APN/MMS settings into ApnPreferencesActivity and transformed PromptApnActivity into a simple informational activity. 5) Added logic to check for APN settings on send and receive of all MMS (media, group, email) and direct user to PromptApnActivity then ApnPreferencesActivity if necessary. 6) Vocab/grammar adjustments.
This commit is contained in:
committed by
Moxie Marlinspike
parent
f3fdde6040
commit
2c2a03e5e2
@@ -345,6 +345,15 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
|
||||
}
|
||||
}
|
||||
|
||||
public Reader getNotificationsWithDownloadState(MasterSecret masterSecret, long state) {
|
||||
SQLiteDatabase database = databaseHelper.getReadableDatabase();
|
||||
String selection = STATUS + " = ?";
|
||||
String[] selectionArgs = new String[]{state + ""};
|
||||
|
||||
Cursor cursor = database.query(TABLE_NAME, MMS_PROJECTION, selection, selectionArgs, null, null, null);
|
||||
return new Reader(masterSecret, cursor);
|
||||
}
|
||||
|
||||
private Pair<Long, Long> insertMessageInbox(MasterSecret masterSecret, RetrieveConf retrieved,
|
||||
String contentLocation, long threadId, long mailbox)
|
||||
throws MmsException
|
||||
@@ -679,6 +688,7 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
|
||||
public static final int DOWNLOAD_CONNECTING = 3;
|
||||
public static final int DOWNLOAD_SOFT_FAILURE = 4;
|
||||
public static final int DOWNLOAD_HARD_FAILURE = 5;
|
||||
public static final int DOWNLOAD_APN_UNAVAILABLE = 6;
|
||||
|
||||
public static boolean isDisplayDownloadButton(int status) {
|
||||
return
|
||||
@@ -689,9 +699,10 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
|
||||
|
||||
public static String getLabelForStatus(Context context, int status) {
|
||||
switch (status) {
|
||||
case DOWNLOAD_CONNECTING: return context.getString(R.string.MmsDatabase_connecting_to_mms_server);
|
||||
case DOWNLOAD_INITIALIZED: return context.getString(R.string.MmsDatabase_downloading_mms);
|
||||
case DOWNLOAD_HARD_FAILURE: return context.getString(R.string.MmsDatabase_mms_download_failed);
|
||||
case DOWNLOAD_CONNECTING: return context.getString(R.string.MmsDatabase_connecting_to_mms_server);
|
||||
case DOWNLOAD_INITIALIZED: return context.getString(R.string.MmsDatabase_downloading_mms);
|
||||
case DOWNLOAD_HARD_FAILURE: return context.getString(R.string.MmsDatabase_mms_download_failed);
|
||||
case DOWNLOAD_APN_UNAVAILABLE: return context.getString(R.string.MmsDatabase_mms_pending_download);
|
||||
}
|
||||
|
||||
return context.getString(R.string.MmsDatabase_downloading);
|
||||
|
||||
Reference in New Issue
Block a user