more fixes

* use bold style in status (mission_item_linear.xml)
* fix download attemps not begin updated
* dont stop the queue if a download fails
* implement partial wake-lock & wifi-lock
* show notifications for failed downloads
* ¿proper bitmap dispose? (DownloadManagerService.java)
* improve buffer filling (CircularFile.java)
* [Mp4Dash] increment reserved space from 2MiB to 15MiB. This is expensive but useful for devices with low ram
* [WebM] use 2MiB of reserved space
* fix debug warning if one thread is used
* fix wrong download speed when the activity is suspended
* Fix "Queue" menu item that appears in post-processing errors
* fix mission length dont being updated (missing commit)
This commit is contained in:
kapodamy 2018-11-20 19:10:50 -03:00
parent fef9d541ed
commit d647555e3a
19 changed files with 400 additions and 150 deletions

View file

@ -103,6 +103,11 @@ public class DownloadMission extends Mission {
*/
public int maxRetry;
/**
* Approximated final length, this represent the sum of all resources sizes
*/
public long nearLength;
public int threadCount = 3;
boolean fallback;
private int finishCount;
@ -432,7 +437,7 @@ public class DownloadMission extends Mission {
return;
}
if (DEBUG && blocks < 1) {
if (DEBUG && blocks == 0) {
Log.w(TAG, "pausing a download that can not be resumed.");
}
@ -507,6 +512,13 @@ public class DownloadMission extends Mission {
return current >= urls.length && postprocessingName == null;
}
public long getLength() {
long near = offsets[current < offsets.length ? current : (offsets.length - 1)] + length;
near -= offsets[0];// don't count reserved space
return near > nearLength ? near : nearLength;
}
private boolean doPostprocessing() {
if (postprocessingName == null) return true;