summaryrefslogtreecommitdiff
path: root/core/src/main/java/de/danoeh/antennapod
diff options
context:
space:
mode:
authorSimon Danner <danner.simon@gmail.com>2015-06-21 12:46:42 +0200
committerSimon Danner <danner.simon@gmail.com>2015-06-21 12:46:42 +0200
commit7c944cbe65098ea46ee7e85166ada2cdb4b2a20b (patch)
tree36b49d1db69c0d3198ed75e27ae915748d9aa7bd /core/src/main/java/de/danoeh/antennapod
parente1b494ba0577ce2cb60e6b3120e3534fb1f3211c (diff)
downloadAntennaPod-7c944cbe65098ea46ee7e85166ada2cdb4b2a20b.zip
Download Report: introduce setting to disable
Give the use the option to disable the download report. While it is useful to see the failed downloads, if a user is subscribed to many podcasts, most of the times a few fail, which makes the notifications rather annonying.
Diffstat (limited to 'core/src/main/java/de/danoeh/antennapod')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java16
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java3
2 files changed, 18 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
index 594241573..6ef91a22a 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
@@ -44,6 +44,7 @@ public class UserPreferences implements
public static final String PREF_HIDDEN_DRAWER_ITEMS = "prefHiddenDrawerItems";
public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify";
public static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify";
+ public static final String PREF_SHOW_DOWNLOAD_REPORT = "prefShowDownloadReport";
// Queue
public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront";
@@ -94,6 +95,7 @@ public class UserPreferences implements
private List<String> hiddenDrawerItems;
private int notifyPriority;
private boolean persistNotify;
+ private boolean showDownloadReport;
// Queue
private boolean enqueueAtFront;
@@ -164,6 +166,7 @@ public class UserPreferences implements
}
hiddenDrawerItems = Arrays.asList(StringUtils.split(sp.getString(PREF_HIDDEN_DRAWER_ITEMS, ""), ','));
persistNotify = sp.getBoolean(PREF_PERSISTENT_NOTIFICATION, false);
+ showDownloadReport = sp.getBoolean(PREF_SHOW_DOWNLOAD_REPORT, true);
// Queue
enqueueAtFront = sp.getBoolean(PREF_QUEUE_ADD_TO_FRONT, false);
@@ -308,6 +311,16 @@ public class UserPreferences implements
}
/**
+ * Returns true if download reports are shown
+ *
+ * @return {@code true} if download reports are shown, {@code false} otherwise
+ */
+ public static boolean showDownloadReport() {
+ instanceAvailable();
+ return instance.showDownloadReport;
+ }
+
+ /**
* Returns {@code true} if new queue elements are added to the front
*
* @return {@code true} if new queue elements are added to the front; {@code false} otherwise
@@ -463,6 +476,9 @@ public class UserPreferences implements
case PREF_PERSISTENT_NOTIFICATION:
persistNotify = sp.getBoolean(PREF_PERSISTENT_NOTIFICATION, false);
break;
+ case PREF_SHOW_DOWNLOAD_REPORT:
+ showDownloadReport = sp.getBoolean(PREF_SHOW_DOWNLOAD_REPORT, true);
+ break;
// Queue
case PREF_QUEUE_ADD_TO_FRONT:
enqueueAtFront = sp.getBoolean(PREF_QUEUE_ADD_TO_FRONT, false);
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java
index e7b226eca..fae6dee1d 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java
@@ -309,7 +309,8 @@ public class DownloadService extends Service {
Log.d(TAG, "Service shutting down");
isRunning = false;
- if (ClientConfig.downloadServiceCallbacks.shouldCreateReport()) {
+ if (ClientConfig.downloadServiceCallbacks.shouldCreateReport() &&
+ UserPreferences.showDownloadReport()) {
updateReport();
}