Merge "Auto re-sending MMS for all the transient failures" am: 0e0bf43d46 am: c38bc2ec1b am: e15fdc0502 am: a4e196219c

Change-Id: I95eb0f877adb5f643b669e415659219158f75010
This commit is contained in:
Treehugger Robot
2020-05-25 21:51:53 +00:00
committed by Automerger Merge Worker

View File

@@ -2134,7 +2134,7 @@ public class MmsUtils {
public static StatusPlusUri updateSentMmsMessageStatus(final Context context, public static StatusPlusUri updateSentMmsMessageStatus(final Context context,
final Uri messageUri, final SendConf sendConf) { final Uri messageUri, final SendConf sendConf) {
int status = MMS_REQUEST_MANUAL_RETRY; final int status;
final int respStatus = sendConf.getResponseStatus(); final int respStatus = sendConf.getResponseStatus();
final ContentValues values = new ContentValues(2); final ContentValues values = new ContentValues(2);
@@ -2147,12 +2147,16 @@ public class MmsUtils {
messageUri, values, null, null); messageUri, values, null, null);
if (respStatus == PduHeaders.RESPONSE_STATUS_OK) { if (respStatus == PduHeaders.RESPONSE_STATUS_OK) {
status = MMS_REQUEST_SUCCEEDED; status = MMS_REQUEST_SUCCEEDED;
} else if (respStatus == PduHeaders.RESPONSE_STATUS_ERROR_TRANSIENT_FAILURE || } else if (respStatus >= PduHeaders.RESPONSE_STATUS_ERROR_TRANSIENT_FAILURE
respStatus == PduHeaders.RESPONSE_STATUS_ERROR_TRANSIENT_NETWORK_PROBLEM || && respStatus < PduHeaders.RESPONSE_STATUS_ERROR_PERMANENT_FAILURE) {
respStatus == PduHeaders.RESPONSE_STATUS_ERROR_TRANSIENT_PARTIAL_SUCCESS) { // Only RESPONSE_STATUS_ERROR_TRANSIENT_FAILURE and RESPONSE_STATUS_ERROR_TRANSIENT
// _NETWORK_PROBLEM are used in the M-Send.conf. But for others transient failures
// including reserved values for future purposes, it should work same as transient
// failure always. (OMA-MMS-ENC-V1_2, 7.2.37. X-Mms-Response-Status field)
status = MMS_REQUEST_AUTO_RETRY; status = MMS_REQUEST_AUTO_RETRY;
} else { } else {
// else permanent failure // else permanent failure
status = MMS_REQUEST_MANUAL_RETRY;
LogUtil.e(TAG, "MmsUtils: failed to send message; respStatus = " LogUtil.e(TAG, "MmsUtils: failed to send message; respStatus = "
+ String.format("0x%X", respStatus)); + String.format("0x%X", respStatus));
} }