### Description
Set user agent in new playback service
Contributes to #6608
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Implements mobile data streaming confirmation (allow once/always
notification) in Media3PlaybackService, matching the legacy
PlaybackService behavior. Includes pre-Oreo PendingIntent compatibility,
stale notification cleanup on new media load, and a streaming guard for
queue auto-advance.
Fixes#8301
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
---------
Co-authored-by: ByteHamster <info@bytehamster.com>
### Description
Build media item stub in main thread and full item in background thread.
We later plan to add more things to load to the main item creation code,
which should not run on the main thread.
Contributes to #8261
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Fix crash when device does not support loudness enhancer. This fixes the
old playback service, which is mostly non-functional by now. This still
documents how to fix the loudness enhancer in case it is ported to the
new service at some point.
Closes#8294
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Restores full sleep timer functionality that was removed during the
Media3 migration (#8232).
The existing timer classes (`ClockSleepTimer`, `EpisodeSleepTimer`,
`ShakeListener`) were already
implemented but not wired into `Media3PlaybackService`. This PR
integrates them via `SessionCommand`
and adds the necessary plumbing between `SleepTimerDialog` →
`PlaybackController` → `Media3PlaybackService`.
**Changes:**
- **`MediaLibrarySessionCallback`**: Added `SessionCommand`s for
set/disable/extend sleep timer with
`Bundle` helpers for passing long values
- **`Media3PlaybackService`**: Integrated sleep timer lifecycle (create,
start, stop),
`SleepTimerUpdatedEvent` handler with volume fade and restore on
cancel/reset, auto-enable support
based on time range preferences, and episode transition check in
`startNextInQueue()`
- **`PlaybackController`**: Routed `setSleepTimer()`,
`disableSleepTimer()`, and `extendSleepTimer()`
through `sendCustomCommand` when using Media3. Fixed
`getMedia()`/`getPosition()`/`getDuration()`
to avoid I/O on main thread crash
- **`SleepTimerDialog`**: Added null safety in `onStart()` for Media3
compatibility, fixed playback
status check for the "Set timer" button
**Supported features:**
- Time-based sleep timer (minutes countdown)
- Episode-based sleep timer (stop after N episodes)
- Shake-to-reset via accelerometer
- Vibration notification before expiry
- Gradual volume fade in last 10 seconds, with volume restore on
cancel/reset/extend
- Timer extend/disable controls
- Auto-enable within configured time range
**Tested manually on a physical device:**
- Set time-based timer → playback pauses when timer expires
- Set episode-based timer → stops after N episodes
- Volume fades in last ~10 seconds
- Cancel timer while volume is fading → volume restores immediately
- Shake to reset while volume is fading → volume restores, timer resets
- Extend timer while volume is fading → volume restores
- Auto-enable enabled → timer starts automatically on playback
- Sleep timer dialog opens without crash
- Changed settings mid-playback → values picked up immediately
Closes#8264
### Checklist
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [ ] If it is a core feature, I have added automated tests
---------
Co-authored-by: ByteHamster <info@bytehamster.com>
After the migration to media3 (#8232), the headphone button multi-tap
stopped working — double/triple pressing the headset button no longer
fast-forwards or rewinds.
I found that media3 already handles HEADSETHOOK multi-tap internally
and translates it before reaching the callback:
- double-tap → KEYCODE_MEDIA_NEXT
- triple-tap → KEYCODE_MEDIA_PREVIOUS
So instead of reimplementing the click-counting logic from the old
PlaybackService, I override `onMediaButtonEvent` in
`MediaLibrarySessionCallback` to catch these translated keycodes
and redirect them to seek operations using the user-configured
duration from `UserPreferences`.
I also updated `onCustomCommand` for REWIND/FAST_FORWARD to read
from `UserPreferences` at each press rather than relying on the
fixed seek intervals set at player creation. Without this, changing
the skip duration in settings had no effect until the app was
restarted.
While testing with a 60s fast-forward setting, I also hit a crash
in `ExoPlayerUtils.buildPlayer()`: the `minBufferMs` is set to
`FastForwardSecs * 1000` (to ensure enough audio is buffered for
instant seeking), but `maxBufferMs` was hardcoded to
`DEFAULT_MAX_BUFFER_MS` (50000ms). When fast-forward exceeds 50s,
`minBufferMs > maxBufferMs` and `DefaultLoadControl` throws an
`IllegalArgumentException`. Fixed by wrapping `maxBufferMs` in
`Math.max(DEFAULT_MAX_BUFFER_MS, minBufferMs)`.
Tested manually on a physical device with bluetooth headphones:
- Single tap: play/pause works as before
- Double tap: seeks forward by the configured amount
- Triple tap: seeks back by the configured amount
- Changed skip duration in settings mid-playback: new values
are picked up immediately without restarting
- Set fast-forward to 60s: no more crash on playback start
Closes: #8260
### Checklist
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [ ] If it is a core feature, I have added automated tests
### Description
Re-add skip silence setting to new playback service
Closes#8266
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Small ExoPlayer tweaks:
- Cache backwards and forwards
- Fix getting stuck when dragging playback speed bar
- Exact seeking
- Code cleanup
- +/- speed buttons increment by 0.05 like the seekbar
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Re-implement delete after playback in the new playback service. To avoid
a race condition (that we already had in the old playback service), we
have to replace `setMedia` in `deleteFeedMediaSynchronous` with a new
`setMediaDownloadInformation`. Otherwise, we might reset the position
but then it gets overwritten again by deletion setting all attributes.
Closes#8285
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Closes: #8284
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [X] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [X] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [X] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [X] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [X] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [X] If it is a core feature, I have added automated tests
### Description
Add widget update sender again.
Closes#8263
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Add back Chromecast support. This is so easy with media3 now :)
Closes#8265
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Tell the cast options provider that we manage the notification
ourselves.
Closes#5728
Contributes to #8265
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
While an episode is buffering, ExoPlayer does not consider it playing.
However, we still want to show it as playing so that the user (1) sees a
reaction when pressing the play button and (2) does not see it toggling
back to paused when the wifi is unstable. Media3 already has a utility
function for that.
Closes#8259
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
### Description
Remove Android 5 support. For supporting Chromecast playback via media3,
we need to upgrade the media3 library. This library no longer supports
Android 5, so we need to bump our minimum version as well. Only 0.13% of
our Google Play users are still on this ancient Android version released
in 2014. Dropping support seems okay now, especially considering that no
one should expose such an old device to the internet anymore. The app
will continue to work on Android 5 but will not receive updates anymore.
### Checklist
<!--
To help us keep the issue tracker clean and work as efficient as
possible,
please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code
- [x] I have run the automated code checks using `./gradlew checkstyle
spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
Fix media session browsing:
- Show only subscribed feeds
- Fix crash when image is null or cannot be loaded
- Re-add "current" section to main screen
- Fix trying to show items without media
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.
The patch allows to restart AntennaPod after being removed by the battery saver from the Media Control. It doesn't start the media, but restores the interface in Media Control to then to start playing.
Reworked sleep timer to no longer use threads, instead uses PlaybackService PlaybackPositionEvent which is fired while media is playing. We use this to calculate how much time is left of the sleep timer and send the proper events.
When service is quickly stopped again due to a playback error,
background tasks might not have delivered their result yet.
In this case, the service objects already get cleaned up.
Now, if the result gets delivered, the service is in an invalid state.
We already added the queue to the auto-download candidates.
Now that auto-download was rewritten to not be a "master switch",
the code is called even if auto-download is turned off for all subscriptions.
This lead to queued episodes being downloaded for users who had auto-download disabled.
Convert the feature to an explicit setting to avoid behavior changes for users.
Also, this implements a setting to auto-download the queue,
which users have requested because they did not know that AntennaPod already does this.
Finally, it should solve user confusion where they automatically add episodes to the queue
but set the auto-download filter to ignore specific episodes.