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:
Gabriele M
2017-07-17 12:25:49 +02:00
parent 75befd1738
commit 1af40da839

View File

@@ -375,10 +375,10 @@ public class UpdaterController implements UpdaterControllerInt {
.setDownloadCallback(getDownloadCallback(downloadId))
.setProgressListener(getProgressListener(downloadId))
.build();
downloadClient.start();
addDownloadClient(mDownloads.get(downloadId), downloadClient);
update.setStatus(UpdateStatus.STARTING);
notifyUpdateChange(downloadId);
downloadClient.start();
mWakeLock.acquire();
return true;
}
@@ -403,10 +403,10 @@ public class UpdaterController implements UpdaterControllerInt {
.setDownloadCallback(getDownloadCallback(downloadId))
.setProgressListener(getProgressListener(downloadId))
.build();
downloadClient.resume();
addDownloadClient(mDownloads.get(downloadId), downloadClient);
update.setStatus(UpdateStatus.STARTING);
notifyUpdateChange(downloadId);
downloadClient.resume();
mWakeLock.acquire();
}
return true;