Sleep timer pauses playback after ~1s when accelerometer access is unavailable/denied (e.g. GrapheneOS Sensors permission)
Checklist
- I have used the search function for OPEN issues to see if someone else has already submitted the same bug report.
- I have also used the search function for CLOSED issues to see if the problem is already solved and just waiting to be released.
- I will describe the problem with as much detail as possible.
- If the bug only to occurs with a certain podcast, I will include the URL of that podcast.
App version
3.12.1
Android version
17 (Graphene OS)
Device model
Pixel 8
First occurred
4 days ago but didn't use it in the two weeks before
Steps to reproduce
- Pixel 8, GrapheneOS (Android 17), AntennaPod with Sensors permission not granted to the app
- Enable "shake to reset sleep timer" in settings
- Start any episode
- Playback pauses after ~1s
The issue does not appear all the time but seems to be somehow related to the time of the day. It feels like the issue only happens if the playback was stopped by the sleep timer somewhat recently.
Expected behaviour
Episode playback continues normally after pressing play, without any unexpected pausing.
Current behaviour
Playback pauses itself about 1 second after starting, on every episode.
I fed the logs into a local AI which speculates:
The sleep timer's "shake to reset" feature throws an UnsupportedOperationException when it tries to register for accelerometer events, because access to the sensor is unavailable or denied (for example, > GrapheneOS's per-app "Sensors" permission). This incorrectly causes the sleep timer to expire and pause playback immediately, instead of just failing silently.
Workaround: grant the "Sensors" permission to AntennaPod, or disable "shake to reset sleep timer".
Crash logs
probably related lines from the logs (I don't want to post the whole file due to privacy concerns but I'm happy to provide more context if that helps)
D ClockSleepTimer: Sleep timer is about to expire
E EventBus: Could not dispatch event: class de.danoeh.antennapod.event.playback.PlaybackPositionEvent to subscribing class class
de.danoeh.antennapod.playback.service.internal.ClockSleepTimer
E EventBus: java.lang.UnsupportedOperationException: Accelerometer not supported
E EventBus: at de.danoeh.antennapod.playback.service.internal.ShakeListener.resume(SourceFile:38)
E EventBus: at de.danoeh.antennapod.playback.service.internal.ShakeListener.<init>(SourceFile:25)
E EventBus: at de.danoeh.antennapod.playback.service.internal.ClockSleepTimer.notifyAboutExpiry(SourceFile:85)
E EventBus: at de.danoeh.antennapod.playback.service.internal.ClockSleepTimer.playbackPositionUpdate(SourceFile:49)
D M3PlaybackService: Sleep timer expired, pausing playbackSource: AntennaPod/AntennaPod