Skip to content

Commit

Permalink
[#304] Reuse 'data exported' notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Inigo Lopez de Heredia committed Jul 6, 2015
1 parent 427f0c2 commit c738b81
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/main/java/org/akvo/flow/service/DataSyncService.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ public class DataSyncService extends IntentService {
private static final String ACTION_SUBMIT = "submit";
private static final String ACTION_IMAGE = "image";

// Reuse notification for data export
private static final int NOTIFICATION_DATA_EXPORT = 1;

/**
* Number of retries to upload a file to S3
*/
Expand Down Expand Up @@ -164,7 +167,8 @@ private void exportSurveys() {
for (long id : getUnexportedSurveys()) {
ZipFileData zipFileData = formZip(id);
if (zipFileData != null) {
displayNotification(id, getString(R.string.exportcomplete), getDestName(zipFileData.filename));
displayNotification(NOTIFICATION_DATA_EXPORT, getString(R.string.exportcomplete),
getDestName(zipFileData.filename));

// Create new entries in the transmission queue
mDatabase.createTransmission(id, zipFileData.formId, zipFileData.filename);
Expand Down Expand Up @@ -466,7 +470,7 @@ private boolean syncFile(String filename, String formId, int status, String serv
break;
case HttpStatus.SC_NOT_FOUND:
// This form has been deleted in the dashboard, thus we cannot sync it
displayNotification(Integer.valueOf(formId),
displayNotification(formId(formId),
"Form " + formId + " does not exist", "It has probably been deleted");
mDatabase.updateTransmissionHistory(filename, TransmissionStatus.FORM_DELETED);
ok = false;// Consider this a failed transmission
Expand Down

0 comments on commit c738b81

Please sign in to comment.