mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Fall back to lollipop MMS API if PDU response isn't success
Fixes #4131 // FREEBIE
This commit is contained in:
parent
aa3aa70c6c
commit
dd986dbc4b
@ -13,6 +13,7 @@ import org.thoughtcrime.securesms.transport.UndeliverableMessageException;
|
||||
import java.io.IOException;
|
||||
|
||||
import ws.com.google.android.mms.MmsException;
|
||||
import ws.com.google.android.mms.pdu.PduHeaders;
|
||||
import ws.com.google.android.mms.pdu.RetrieveConf;
|
||||
import ws.com.google.android.mms.pdu.SendConf;
|
||||
|
||||
@ -33,7 +34,13 @@ public class CompatMmsConnection implements OutgoingMmsConnection, IncomingMmsCo
|
||||
if (subscriptionId == -1 || VERSION.SDK_INT < 22) {
|
||||
Log.w(TAG, "Sending via legacy connection");
|
||||
try {
|
||||
return new OutgoingLegacyMmsConnection(context).send(pduBytes, subscriptionId);
|
||||
SendConf result = new OutgoingLegacyMmsConnection(context).send(pduBytes, subscriptionId);
|
||||
|
||||
if (result != null && result.getResponseStatus() == PduHeaders.RESPONSE_STATUS_OK) {
|
||||
return result;
|
||||
} else {
|
||||
Log.w(TAG, "Got bad legacy response: " + (result != null ? result.getResponseStatus() : null));
|
||||
}
|
||||
} catch (UndeliverableMessageException | ApnUnavailableException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user