mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-12-01 12:31:45 +00:00
Reset interrupted state on InterruptedException (#8120)
This resets the interrupted state for the thread, because it is checked in the calling method. If you catch a InterruptedException and do not call Thread.currentThread().interrupt(), the interrupt state of the thread is not set anymore and the calling method has no information about it. Without the correction the if (!Thread.currentThread().isInterrupted()) will always be true. Neither Thread.currentThread().interrupt() is called nor the exception is rethrown which can result in unexpected behavior.
This commit is contained in:
@ -88,11 +88,13 @@ public class PlaybackServiceNotificationBuilder {
|
||||
.submit(iconSize, iconSize)
|
||||
.get();
|
||||
} catch (InterruptedException ignore) {
|
||||
Thread.currentThread().interrupt();
|
||||
Log.e(TAG, "Media icon loader was interrupted");
|
||||
} catch (Throwable tr) {
|
||||
Log.e(TAG, "Error loading the media icon for the notification", tr);
|
||||
}
|
||||
} catch (InterruptedException ignore) {
|
||||
Thread.currentThread().interrupt();
|
||||
Log.e(TAG, "Media icon loader was interrupted");
|
||||
} catch (Throwable tr) {
|
||||
Log.e(TAG, "Error loading the media icon for the notification", tr);
|
||||
|
||||
Reference in New Issue
Block a user