mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-20 08:08:04 -05:00
Merge branch '2723-concurrent-downloads' into 'master'
Cancel download when DownloadService is told to stop Closes #2723 See merge request fdroid/fdroidclient!1340
This commit is contained in:
@@ -91,7 +91,7 @@ import javax.net.ssl.SSLProtocolException;
|
||||
*/
|
||||
public class DownloaderService extends JobIntentService {
|
||||
private static final String TAG = "DownloaderService";
|
||||
private static final int JOB_ID = TAG.hashCode();
|
||||
private static final int JOB_ID = TAG.hashCode(); // 1964029344
|
||||
|
||||
private static final String ACTION_QUEUE = "org.fdroid.fdroid.net.DownloaderService.action.QUEUE";
|
||||
|
||||
@@ -147,6 +147,13 @@ public class DownloaderService extends JobIntentService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStopCurrentWork() {
|
||||
Log.i(TAG, "onStopCurrentWork - activeCanonicalUrl: " + activeCanonicalUrl);
|
||||
cancel(activeCanonicalUrl);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
Utils.debugLog(TAG, "Destroying downloader service.");
|
||||
|
||||
Reference in New Issue
Block a user