Merge pull request #3666 from ByteHamster/fix-cancellation-exception

Ignore cancellationException
This commit is contained in:
H. Lehmann 2019-12-02 13:13:33 +01:00 committed by GitHub
commit a99a41e3bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -218,6 +218,11 @@ public class DownloadService extends Service {
nm.cancel(NOTIFICATION_ID);
downloadCompletionThread.interrupt();
try {
downloadCompletionThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
syncExecutor.shutdown();
schedExecutor.shutdown();
cancelNotificationUpdater();

View File

@ -11,6 +11,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.List;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledFuture;
@ -140,7 +141,7 @@ public class PlaybackServiceTaskManager {
if (queueFuture.isDone()) {
try {
return queueFuture.get();
} catch (InterruptedException | ExecutionException e) {
} catch (InterruptedException | ExecutionException | CancellationException e) {
e.printStackTrace();
}
}