mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-25 20:37:20 +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 java.io.IOException;
|
||||||
|
|
||||||
import ws.com.google.android.mms.MmsException;
|
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.RetrieveConf;
|
||||||
import ws.com.google.android.mms.pdu.SendConf;
|
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) {
|
if (subscriptionId == -1 || VERSION.SDK_INT < 22) {
|
||||||
Log.w(TAG, "Sending via legacy connection");
|
Log.w(TAG, "Sending via legacy connection");
|
||||||
try {
|
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) {
|
} catch (UndeliverableMessageException | ApnUnavailableException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user