Send the notification and then start the download
In this way if the download fails immediately, it will fail after the notification.
This commit is contained in:
@@ -375,10 +375,10 @@ public class UpdaterController implements UpdaterControllerInt {
|
|||||||
.setDownloadCallback(getDownloadCallback(downloadId))
|
.setDownloadCallback(getDownloadCallback(downloadId))
|
||||||
.setProgressListener(getProgressListener(downloadId))
|
.setProgressListener(getProgressListener(downloadId))
|
||||||
.build();
|
.build();
|
||||||
downloadClient.start();
|
|
||||||
addDownloadClient(mDownloads.get(downloadId), downloadClient);
|
addDownloadClient(mDownloads.get(downloadId), downloadClient);
|
||||||
update.setStatus(UpdateStatus.STARTING);
|
update.setStatus(UpdateStatus.STARTING);
|
||||||
notifyUpdateChange(downloadId);
|
notifyUpdateChange(downloadId);
|
||||||
|
downloadClient.start();
|
||||||
mWakeLock.acquire();
|
mWakeLock.acquire();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -403,10 +403,10 @@ public class UpdaterController implements UpdaterControllerInt {
|
|||||||
.setDownloadCallback(getDownloadCallback(downloadId))
|
.setDownloadCallback(getDownloadCallback(downloadId))
|
||||||
.setProgressListener(getProgressListener(downloadId))
|
.setProgressListener(getProgressListener(downloadId))
|
||||||
.build();
|
.build();
|
||||||
downloadClient.resume();
|
|
||||||
addDownloadClient(mDownloads.get(downloadId), downloadClient);
|
addDownloadClient(mDownloads.get(downloadId), downloadClient);
|
||||||
update.setStatus(UpdateStatus.STARTING);
|
update.setStatus(UpdateStatus.STARTING);
|
||||||
notifyUpdateChange(downloadId);
|
notifyUpdateChange(downloadId);
|
||||||
|
downloadClient.resume();
|
||||||
mWakeLock.acquire();
|
mWakeLock.acquire();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user