From 7c8a5c2c00ba8be7d9c836c6379efb4fc38d1010 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 29 Mar 2018 22:00:55 +0100 Subject: [PATCH] update download manager module setOngoing calls for notifications --- src/main/assets/index.android.bundle | 3 +++ src/main/assets/index.android.bundle.meta | 2 +- .../io/lbry/lbrynet/reactmodules/DownloadManagerModule.java | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/assets/index.android.bundle b/src/main/assets/index.android.bundle index 9d748464..1bb0de43 100644 --- a/src/main/assets/index.android.bundle +++ b/src/main/assets/index.android.bundle @@ -75189,6 +75189,8 @@ __d(function (global, require, module, exports, _dependencyMap) { }); _reactNative.NativeModules.LbryDownloadManager.stopDownload(uri, fileInfo.file_name); + + dispatch(doDeleteFile(fileInfo.outpoint, uri)); }; } @@ -75390,6 +75392,7 @@ __d(function (global, require, module, exports, _dependencyMap) { }); }, _this.onStopDownloadPressed = function () { var _this$props2 = _this.props, + deleteFile = _this$props2.deleteFile, stopDownload = _this$props2.stopDownload, fileInfo = _this$props2.fileInfo, navigation = _this$props2.navigation; diff --git a/src/main/assets/index.android.bundle.meta b/src/main/assets/index.android.bundle.meta index f8790b4e..1c0acb36 100644 --- a/src/main/assets/index.android.bundle.meta +++ b/src/main/assets/index.android.bundle.meta @@ -1 +1 @@ -”;9¯V•0Ï\3yQoßø‹Îs \ No newline at end of file ++]ç~wÃäù|ãá/Ýá²€/Í \ No newline at end of file diff --git a/src/main/java/io/lbry/lbrynet/reactmodules/DownloadManagerModule.java b/src/main/java/io/lbry/lbrynet/reactmodules/DownloadManagerModule.java index 23d3f08f..41c4a60e 100644 --- a/src/main/java/io/lbry/lbrynet/reactmodules/DownloadManagerModule.java +++ b/src/main/java/io/lbry/lbrynet/reactmodules/DownloadManagerModule.java @@ -49,8 +49,7 @@ public class DownloadManagerModule extends ReactContextBaseJavaModule { NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setContentTitle(String.format("Downloading %s...", fileName)) .setSmallIcon(R.drawable.ic_file_download_black_24dp) - .setPriority(NotificationCompat.PRIORITY_LOW) - .setOngoing(true); + .setPriority(NotificationCompat.PRIORITY_LOW); builder.setProgress(MAX_PROGRESS, 0, false); @@ -99,6 +98,8 @@ public class DownloadManagerModule extends ReactContextBaseJavaModule { } NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); + NotificationCompat.Builder builder = builders.get(notificationId); + builder.setOngoing(false); notificationManager.cancel(notificationId); downloadIdNotificationIdMap.remove(id);