summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Mascitelli <mascitelli.nathan@gmail.com>2020-03-12 15:56:56 -0400
committerNathan Mascitelli <mascitelli.nathan@gmail.com>2020-03-22 16:27:28 -0400
commitad54ed3ec6685ade44e0238841569e0dd3187903 (patch)
tree73ab3449723f7edefb61ec037fdb2f2367a7c3b7
parent576baf90d874834dc3c0c9d52e40a0882a5c9136 (diff)
downloadAntennaPod-ad54ed3ec6685ade44e0238841569e0dd3187903.zip
Autodownload notification opens queue
-rw-r--r--app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java3
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java2
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java10
3 files changed, 7 insertions, 8 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java
index f50b4143b..ee6e0233c 100644
--- a/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java
+++ b/app/src/main/java/de/danoeh/antennapod/config/DownloadServiceCallbacksImpl.java
@@ -12,6 +12,7 @@ import de.danoeh.antennapod.core.DownloadServiceCallbacks;
import de.danoeh.antennapod.core.feed.Feed;
import de.danoeh.antennapod.core.service.download.DownloadRequest;
import de.danoeh.antennapod.fragment.DownloadsFragment;
+import de.danoeh.antennapod.fragment.QueueFragment;
public class DownloadServiceCallbacksImpl implements DownloadServiceCallbacks {
@@ -35,7 +36,7 @@ public class DownloadServiceCallbacksImpl implements DownloadServiceCallbacks {
}
@Override
- public PendingIntent getReportNotificationContentIntent(Context context) {
+ public PendingIntent getReportNotificationContentIntent(Context context, boolean autoDownloadReport) {
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra(MainActivity.EXTRA_FRAGMENT_TAG, DownloadsFragment.TAG);
Bundle args = new Bundle();
diff --git a/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java
index e56445489..4473d3ac7 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/DownloadServiceCallbacks.java
@@ -40,7 +40,7 @@ public interface DownloadServiceCallbacks {
*
* @return A non-null PendingIntent for the notification or null if shouldCreateReport()==false
*/
- PendingIntent getReportNotificationContentIntent(Context context);
+ PendingIntent getReportNotificationContentIntent(Context context, boolean autoDownloadReport);
/**
* Called by the FeedSyncThread after a feed has been downloaded and parsed.
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java
index 7e8b53732..30c1c9773 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java
@@ -125,12 +125,10 @@ public class DownloadServiceNotification {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId);
builder.setTicker(context.getString(titleId))
.setContentTitle(context.getString(R.string.download_report_content_title))
- .setContentText(String.format(
- context.getString(R.string.download_report_content),
- successfulDownloads, failedDownloads))
- .setSmallIcon(autoDownloadReport ? R.drawable.stat_notify_sync : R.drawable.stat_notify_sync_error)
- .setContentIntent(ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(context))
- .setAutoCancel(true);
+ .setContentText(String.format(context.getString(R.string.download_report_content), successfulDownloads, failedDownloads))
+ .setSmallIcon(autoDownloadReport ? R.drawable.stat_notify_sync : R.drawable.stat_notify_sync_error)
+ .setContentIntent(ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(context, autoDownloadReport))
+ .setAutoCancel(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
}