Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30983ab

Browse files
author
Elias Naur
committed
Only show success notification if response code is 2XX
1 parent db943db commit 30983ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/com/alexbbb/uploadservice/UploadService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ private void broadcastCompleted(final String uploadId, final int responseCode, f
324324
filteredMessage = responseMessage;
325325
}
326326

327-
updateNotificationCompleted();
327+
if (responseCode >= 200 && responseCode <= 299)
328+
updateNotificationCompleted();
329+
else
330+
updateNotificationError();
328331

329332
final Intent intent = new Intent(BROADCAST_ACTION);
330333
intent.putExtra(UPLOAD_ID, uploadId);

0 commit comments

Comments
 (0)