Android 17 background audio hardening
Short answer: on Android 17, audio playback, audio focus requests and volume changes from the background work only if the app has a visible activity or runs a foreground service that is not SHORT_SERVICE. This applies to every app on Android 17, whatever its target SDK. Apps that target API level 37 also need that foreground service to have while-in-use capability. Otherwise playback and volume calls fail silently.
Is your app affected?
From Android Developers’ Background audio hardening page, read 1 October 2026.
| How your app uses audio | Affected | What to do |
|---|---|---|
| Only while an activity is visible, including Picture in Picture | No | Nothing |
| VoIP or video calls through the telecom APIs | Unlikely | Check that you already meet the recording rules |
| Keeps playing with the screen off: music, podcasts | Yes | MediaSessionService or a mediaPlayback foreground service started while visible |
| Starts audio from BOOT_COMPLETED or without a user trigger | Yes, suppressed | Start audio only from a user action |
| Alarm sounds with the exact alarm permission | While-in-use rule waived | Use USAGE_ALARM streams |
How failures show up
Nothing crashes by default. Playback and volume change calls fail silently, and audio focus requests return AUDIOFOCUS_REQUEST_FAILED. To find them, look in adb dumpsys audio or logcat for entries prefixed AudioHardening with your package name: level: full means you run a foreground service without while-in-use capability, level: partial means no foreground service at all.
Fixing it
Google’s recommended path is the media3 Jetpack MediaSessionService, which manages the playback lifecycle so you are unlikely to be affected. Without media3, start a mediaPlayback foreground service while the app is still in the foreground, for example at the moment a video app’s user taps “keep playing with screen off”, so it gets while-in-use capability. Keep it running through short interruptions under 10 minutes, such as buffering or AUDIOFOCUS_LOSS_TRANSIENT, and stop it, with the media session, when playback really ends; restart only when the user resumes.
Testing
On Android 17 devices from Beta 3, Google provides an adb command with three modes: enable applies all restrictions to all apps, including the while-in-use rule regardless of target SDK; disable turns them off; throw enables them with loud failures, throwing IllegalStateException for volume and focus calls, so bugs surface in testing. See the Background audio hardening page on Android Developers for the exact command.
Other Android 17 changes
The full list is in Android 17 behavior changes. Plan these together: app memory limits, the local network permission and Google Play target API level.
Where Censuus fits
Reliable playback keeps listeners; being found brings them. Censuus ranks apps by the visits they draw, and adding your app is free on the List my app form. Placement comes from traffic and sponsorship: apps climb on the visits they draw, and a sponsor can pay to rise higher.
Frequently asked questions
Does Android 17 restrict background audio?
Yes. Background playback, audio focus requests and volume changes need a visible activity or a foreground service other than SHORT_SERVICE, for all apps running on Android 17.
Does it matter if my app targets API level 37?
Yes. Apps targeting Android 17 also need the foreground service to have while-in-use capability when in the background, which it gets if started from a user action or while the app is visible.
Why does my audio stop without an error on Android 17?
Playback and volume calls outside a valid lifecycle fail silently. Look for AudioHardening entries in adb dumpsys audio or logcat.
Is a music app with MediaSessionService affected?
Google says apps using the media3 MediaSessionService are not likely to be impacted, because the library manages the playback lifecycle.
Guides for app developers
- Android 17: lock-free MessageQueue and static final fields
- The Android 17 local network permission
- Cleartext HTTP and certificate transparency on Android 17
- Android 17 app memory limits: detect, test and stay under them
- Android 17 behavior changes: a checklist for target SDK 37
- Android Live Updates: how to qualify for a promoted notification
Put your app in the ranking
Censuus ranks apps by the visits they draw and by sponsorship, no bots. Listing is free; sponsorship raises placement.