Skip to content

Commit 5c4eea3

Browse files
authored
swipe away failed notification (commons-app#3598)
1 parent 38635d0 commit 5c4eea3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/src/main/java/fr/free/nrw/commons/upload/UploadService.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ private void uploadContribution(Contribution contribution) {
217217
Timber.d("Before execution!");
218218
curNotification.setContentTitle(getString(R.string.upload_progress_notification_title_start, contribution.getDisplayTitle()))
219219
.setContentText(getResources().getQuantityString(R.plurals.uploads_pending_notification_indicator, toUpload, toUpload))
220-
.setTicker(getString(R.string.upload_progress_notification_title_in_progress, contribution.getDisplayTitle()));
220+
.setTicker(getString(R.string.upload_progress_notification_title_in_progress, contribution.getDisplayTitle()))
221+
.setOngoing(true);
221222
notificationManager
222223
.notify(notificationTag, NOTIFICATION_UPLOAD_IN_PROGRESS, curNotification.build());
223224

@@ -306,7 +307,8 @@ private void showFailedNotification(Contribution contribution) {
306307
curNotification.setTicker(getString(R.string.upload_failed_notification_title, contribution.getDisplayTitle()))
307308
.setContentTitle(getString(R.string.upload_failed_notification_title, contribution.getDisplayTitle()))
308309
.setContentText(getString(R.string.upload_failed_notification_subtitle))
309-
.setProgress(0, 0, false);
310+
.setProgress(0, 0, false)
311+
.setOngoing(false);
310312
notificationManager.notify(contribution.getLocalUri().toString(), NOTIFICATION_UPLOAD_FAILED, curNotification.build());
311313

312314
contribution.setState(Contribution.STATE_FAILED);

0 commit comments

Comments
 (0)