From 9b78c586df1c0d6f481cefb3fcd1876918406e92 Mon Sep 17 00:00:00 2001 From: schwarzspecht Date: Sun, 30 Nov 2025 15:31:05 +0100 Subject: [PATCH] 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. --- .../service/internal/PlaybackServiceNotificationBuilder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/PlaybackServiceNotificationBuilder.java b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/PlaybackServiceNotificationBuilder.java index 75673bbed..c614ae404 100644 --- a/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/PlaybackServiceNotificationBuilder.java +++ b/playback/service/src/main/java/de/danoeh/antennapod/playback/service/internal/PlaybackServiceNotificationBuilder.java @@ -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);