Rescheduling pending messages after outside window failure
No more rescheduling for pending messages after DownloadMmsAction is failed caused by outside window. Any pending download messages will be remained as the DOWNLOADING state without actual downloading operations and sending a DEFERRED M-NotifyResp.ind even. It will reschedule pending messages whenever sending or downloading is failed including outside window failure case. And it also removes dup scheduling and fix some typo. Test: Manual Change-Id: Ie37088347c69f25d838875830fc65ce7727fefe6 Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
@@ -83,7 +83,7 @@ public class ProcessDownloadedMmsAction extends Action {
|
||||
// Set when message downloaded by us (legacy)
|
||||
private static final String KEY_STATUS = "status";
|
||||
private static final String KEY_RAW_STATUS = "raw_status";
|
||||
private static final String KEY_MMS_URI = "mms_uri";
|
||||
private static final String KEY_MMS_URI = "mms_uri";
|
||||
|
||||
// Used to send a deferred response in response to auto-download failure
|
||||
private static final String KEY_SEND_DEFERRED_RESP_STATUS = "send_deferred_resp_status";
|
||||
@@ -329,6 +329,8 @@ public class ProcessDownloadedMmsAction extends Action {
|
||||
if (response == null) {
|
||||
// No message download to process; doBackgroundWork sent a notify deferred response
|
||||
Assert.isTrue(actionParameters.getBoolean(KEY_SEND_DEFERRED_RESP_STATUS));
|
||||
ProcessPendingMessagesAction.scheduleProcessPendingMessagesAction(
|
||||
true /* failed */, this);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -343,7 +345,9 @@ public class ProcessDownloadedMmsAction extends Action {
|
||||
|
||||
final int subId = actionParameters.getInt(KEY_SUB_ID, ParticipantData.DEFAULT_SELF_SUB_ID);
|
||||
// If we were trying to auto-download but have failed need to send the deferred response
|
||||
if (autoDownload && message == null && status == MmsUtils.MMS_REQUEST_MANUAL_RETRY) {
|
||||
final boolean needToSendDeferredResp =
|
||||
autoDownload && (status == MmsUtils.MMS_REQUEST_MANUAL_RETRY);
|
||||
if (needToSendDeferredResp) {
|
||||
final String transactionId = actionParameters.getString(KEY_TRANSACTION_ID);
|
||||
final String contentLocation = actionParameters.getString(KEY_CONTENT_LOCATION);
|
||||
sendDeferredRespStatus(messageId, transactionId, contentLocation, subId);
|
||||
@@ -373,7 +377,11 @@ public class ProcessDownloadedMmsAction extends Action {
|
||||
}
|
||||
|
||||
final boolean failed = (messageUri == null);
|
||||
ProcessPendingMessagesAction.scheduleProcessPendingMessagesAction(failed, this);
|
||||
// Scheduling pending messages. If auto downloading is failed and it needs to send the
|
||||
// deferred response, Skip it here and it will be scheduled after sending the response.
|
||||
if (!needToSendDeferredResp) {
|
||||
ProcessPendingMessagesAction.scheduleProcessPendingMessagesAction(failed, this);
|
||||
}
|
||||
if (failed) {
|
||||
BugleNotifications.update(false, BugleNotifications.UPDATE_ERRORS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user