
9.77 MB
Android 7.0+
7
Universal
Verified safeScanned with ClamAV, APKiD, and Quark-Engine. No threats detected.
What's New
https://github.com/JKPR0D/media-button-blocker/compare/v1.12...v1.13/
Description
A small Android app that intercepts media-button presses (play / pause / headset hook) on wired and Bluetooth headphones, so that other apps (for example TeamTalk, which uses that button to mute/unmute the mic) don't react to them.
How it works
The app starts a foreground service that registers a MediaSessionCompat with FLAG_HANDLES_MEDIA_BUTTONS and FLAG_HANDLES_TRANSPORT_CONTROLS, keeps it active, and plays a short silent audio file in a loop (volume 0) so Android treats our session as "live" and routes media-button events to it.
The onMediaButtonEvent callback returns true — the event is swallowed and never reaches TeamTalk / Discord / Telegram / etc.
Every 3 seconds the playback state is re-asserted as STATE_PLAYING so our app stays the "freshest" active media session and doesn't lose priority to other messengers that re-create their session mid-call.
Usage
1. Open the app.
2. Flip the "Block media button" switch on.
3. On Android 13+ grant the notification permission (required by the system for foreground services).
4. A persistent "Media button blocked" notification will appear in the shade — this is required by Android, you can't hide it.
5. Open TeamTalk and use it normally. Pressing the headset button will no longer toggle the microphone.
6. To turn blocking off — open the app and flip the switch back, or tap "Stop" in the notification.
Known limitations
- If another app registers its media session after ours, it will temporarily steal routing until the next refresh cycle (≤ 3 s).
- The persistent notification cannot be hidden — Android requires it for any foreground service.
- The silent audio loop consumes a tiny bit of battery (minimal).
License
MIT
Rate this app
Ratings & reviews
No reviews yet.