aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-03-21 23:35:18 -0700
committerScott Jackson <daneren2005@gmail.com>2014-03-21 23:35:18 -0700
commitfc97be950bae9d18e98bb0a0cfa4dcff8d1737af (patch)
treeb3de44857c0a001ce6415bf2030bf6e158d3f9aa /src
parent89a25eb7653fc351c5519f35ca5e09c9ece53eea (diff)
downloaddsub-fc97be950bae9d18e98bb0a0cfa4dcff8d1737af.tar.gz
dsub-fc97be950bae9d18e98bb0a0cfa4dcff8d1737af.tar.bz2
dsub-fc97be950bae9d18e98bb0a0cfa4dcff8d1737af.zip
Just remove download speed, sucky approximation anyways
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java16
-rw-r--r--src/github/daneren2005/dsub/util/Util.java11
2 files changed, 4 insertions, 23 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index cb2fdcb2..9c7cb459 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -130,7 +130,6 @@ public class DownloadService extends Service {
private int cachedPosition = 0;
private long downloadRevision;
private boolean downloadOngoing = false;
- private DownloadFile lastDownloaded = null;
private AudioEffectsController effectsController;
private boolean showVisualization;
@@ -1592,25 +1591,12 @@ public class DownloadService extends Service {
}
if(!backgroundDownloadList.isEmpty()) {
- DownloadFile speedFile = null;
- // Updating existing notification
- if(downloadOngoing) {
- // Changing download, use speed of last DownloadFile
- if(revision != downloadRevision && lastDownloaded != null) {
- speedFile = lastDownloaded;
- } else {
- // Updated mid-download
- speedFile = currentDownloading;
- }
- }
- Util.showDownloadingNotification(this, currentDownloading, backgroundDownloadList.size(), speedFile);
+ Util.showDownloadingNotification(this, currentDownloading, backgroundDownloadList.size());
downloadRevision = revision;
- lastDownloaded = currentDownloading;
downloadOngoing = true;
} else if(backgroundDownloadList.isEmpty() && downloadOngoing) {
Util.hideDownloadingNotification(this);
downloadOngoing = false;
- lastDownloaded = null;
}
// Delete obsolete .partial and .complete files.
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java
index 72886329..4243c853 100644
--- a/src/github/daneren2005/dsub/util/Util.java
+++ b/src/github/daneren2005/dsub/util/Util.java
@@ -1113,12 +1113,12 @@ public final class Util {
DSubWidgetProvider.notifyInstances(context, downloadService, false);
}
- public static void showDownloadingNotification(final Context context, DownloadFile file, int size, DownloadFile speedFile) {
+ public static void showDownloadingNotification(final Context context, DownloadFile file, int size) {
Intent cancelIntent = new Intent(context, DownloadService.class);
cancelIntent.setAction(DownloadService.CANCEL_DOWNLOADS);
PendingIntent cancelPI = PendingIntent.getService(context, 0, cancelIntent, 0);
- String currentDownloading, currentSize, speed;
+ String currentDownloading, currentSize;
if(file != null) {
currentDownloading = file.getSong().getTitle();
currentSize = Util.formatBytes(file.getEstimatedSize());
@@ -1126,11 +1126,6 @@ public final class Util {
currentDownloading = "none";
currentSize = "0";
}
- if(speedFile != null) {
- speed = Long.toString(speedFile.getBytesPerSecond() / 1024);
- } else {
- speed = "0";
- }
NotificationCompat.Builder builder;
builder = new NotificationCompat.Builder(context)
@@ -1138,7 +1133,7 @@ public final class Util {
.setContentTitle(context.getResources().getString(R.string.download_downloading_title, size))
.setContentText(context.getResources().getString(R.string.download_downloading_summary, currentDownloading))
.setStyle(new NotificationCompat.BigTextStyle()
- .bigText(context.getResources().getString(R.string.download_downloading_summary_expanded, currentDownloading, currentSize, speed)))
+ .bigText(context.getResources().getString(R.string.download_downloading_summary_expanded, currentDownloading, currentSize)))
.setProgress(10, 5, true)
.setOngoing(true)
.addAction(R.drawable.notification_close,