mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
disconnect radio regardless of MMS exception
Fixes #2498 Closes #2544 // FREEBIE
This commit is contained in:
parent
ac312ff5d5
commit
96896bf8f1
@ -110,30 +110,31 @@ public class MmsDownloadJob extends MasterSecretJob {
|
||||
Log.w(TAG, "Changing radio to MMS mode..");
|
||||
radio.connect();
|
||||
|
||||
Log.w(TAG, "Downloading in MMS mode with proxy...");
|
||||
|
||||
try {
|
||||
retrieveAndStore(masterSecret, radio, messageId, threadId, contentLocation,
|
||||
transactionId, true, true);
|
||||
radio.disconnect();
|
||||
return;
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
Log.w(TAG, "Downloading in MMS mode with proxy...");
|
||||
|
||||
Log.w(TAG, "Downloading in MMS mode without proxy...");
|
||||
try {
|
||||
retrieveAndStore(masterSecret, radio, messageId, threadId, contentLocation,
|
||||
transactionId, true, true);
|
||||
return;
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
|
||||
try {
|
||||
retrieveAndStore(masterSecret, radio, messageId, threadId,
|
||||
contentLocation, transactionId, true, false);
|
||||
Log.w(TAG, "Downloading in MMS mode without proxy...");
|
||||
|
||||
try {
|
||||
retrieveAndStore(masterSecret, radio, messageId, threadId,
|
||||
contentLocation, transactionId, true, false);
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
handleDownloadError(masterSecret, messageId, threadId,
|
||||
MmsDatabase.Status.DOWNLOAD_SOFT_FAILURE,
|
||||
context.getString(R.string.MmsDownloader_error_connecting_to_mms_provider),
|
||||
automatic);
|
||||
}
|
||||
} finally {
|
||||
radio.disconnect();
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
radio.disconnect();
|
||||
handleDownloadError(masterSecret, messageId, threadId,
|
||||
MmsDatabase.Status.DOWNLOAD_SOFT_FAILURE,
|
||||
context.getString(R.string.MmsDownloader_error_connecting_to_mms_provider),
|
||||
automatic);
|
||||
}
|
||||
|
||||
} catch (ApnUnavailableException e) {
|
||||
|
@ -118,23 +118,22 @@ public class MmsSendJob extends SendJob {
|
||||
radio.connect();
|
||||
|
||||
try {
|
||||
MmsSendResult result = sendMms(masterSecret, radio, message, true, true);
|
||||
radio.disconnect();
|
||||
return result;
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
try {
|
||||
return sendMms(masterSecret, radio, message, true, true);
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
|
||||
Log.w(TAG, "Sending MMS with radio change and without proxy...");
|
||||
Log.w(TAG, "Sending MMS with radio change and without proxy...");
|
||||
|
||||
try {
|
||||
MmsSendResult result = sendMms(masterSecret, radio, message, true, false);
|
||||
try {
|
||||
return sendMms(masterSecret, radio, message, true, false);
|
||||
} catch (IOException ioe) {
|
||||
Log.w(TAG, ioe);
|
||||
throw new UndeliverableMessageException(ioe);
|
||||
}
|
||||
} finally {
|
||||
radio.disconnect();
|
||||
return result;
|
||||
} catch (IOException ioe) {
|
||||
Log.w(TAG, ioe);
|
||||
radio.disconnect();
|
||||
throw new UndeliverableMessageException(ioe);
|
||||
}
|
||||
|
||||
} catch (MmsRadioException mre) {
|
||||
|
Loading…
Reference in New Issue
Block a user