A lightweight Vector / libxposed (API 101–102) module for Android that fixes the Bluetooth Multipoint + Spotify Connect pause/resume loop when Spotify is open on both your Android phone and another device (such as a laptop).
When multipoint Bluetooth headphones are connected to both your phone and your laptop with Spotify open on both:
- Even while your laptop is playing, Spotify on Android publishes
PlaybackState.STATE_PLAYINGto Android'sMediaSession. - Android's Bluetooth AVRCP / LE Audio stack (
AvrcpTargetService&MediaControlGattService) seesSTATE_PLAYINGand tells your headphones "Phone is now playing". - Your multipoint headphones immediately send
PAUSEto your laptop (or inject dedicatedKEYCODE_MEDIA_PAUSEinto your phone during A2DP handoffs). - Spotify Connect syncs the pause/play state back and forth between devices, causing an endless pause/resume loop whenever you lock your phone or receive notifications.
- Framework-Level Hooks (Update-Resilient): Scoped exclusively to
com.spotify.musicand hooks standard Android framework APIs (MediaSession,MediaSession.Callback,AudioTrack,AudioManager,AudioFocusRequest.Builder, and dynamically queriedACTION_MEDIA_BUTTON/ACTION_AUDIO_BECOMING_NOISYreceivers)—no reliance on obfuscated Spotify class names. - Remote Playback (Spotify Connect) Protection:
- Hide Remote
STATE_PLAYINGfrom Bluetooth: ClampsMediaSession.setPlaybackState(STATE_PLAYING / STATE_BUFFERING)toSTATE_PAUSEDwhile Spotify is playing on another device, so Bluetooth AVRCP never tricks your headphones into pausing your laptop. - Block Remote Media Keys, Transport Callbacks & Broadcasts: Swallows external Play/Pause/Stop commands arriving on your phone during remote playback while keeping in-app Spotify controls and local phone playback working normally.
- Hide Remote
- Local Playback Protection (Safe by Default):
- Pause/Resume Oscillation Loop Breaker: Detects rapid opposing Play/Pause ping-ponging (
< 2.5 s) and dampens commands for a3 scooldown without blocking normal single pauses or earbud disconnect pausing. - Opt-In Advanced Overrides (OFF by default): Optional toggles to ignore dedicated local
KEYCODE_MEDIA_PAUSEor transient/permanent audio focus losses if you specifically need them, with clear UI warnings. - Normal
ACTION_AUDIO_BECOMING_NOISYand audio focus handoffs (YouTube, Instagram, putting earbuds in the case) are left completely untouched by default.
- Pause/Resume Oscillation Loop Breaker: Detects rapid opposing Play/Pause ping-ponging (
- Modern Miuix Compose UI:
- Built with Miuix (
0.9.4), edge-to-edge layout, collapsingTopAppBar, spring overscroll, Light/Dark theme, and tactile haptics. - Live Vector API 102 status hero card (
service.runningTargets), quick presets (Recommended, Strict, Custom), and live-synced preferences viaXposedService.getRemotePreferences(no Spotify restart required when toggling settings). - 3-Tier Seamless Restart: Zero-root in-process Spotify restart once hooked,
suforce-stop on first setup if granted, or a clean dialog fallback.
- Built with Miuix (
- Rooted Android 8.1+ (API 27+) device
- Vector (or any Xposed framework supporting
libxposedAPI 101+ — legacy LSPosed v1.9.x API 93 is not supported) - Official Spotify Android app (
com.spotify.music)
Package ID: io.github.realmoai.multipointguard
- Download or build
app-release.apkand install it on your device. - Open Vector Manager → Modules and enable Spotify Multipoint Guard.
- Confirm
com.spotify.musicis checked in the module scope (auto-configured viaMETA-INF/xposed/scope.list). - Open Spotify Multipoint Guard and tap Restart Spotify (or force-stop and reopen Spotify once).
# Run unit tests
./gradlew testDebugUnitTest
# Build debug & minified release APKs
./gradlew assembleDebug assembleReleaseAPKs are written to:
app/build/outputs/apk/release/app-release.apkapp/build/outputs/apk/debug/app-debug.apk
- Enable Verbose Logs: Toggle Verbose Xposed Logs in the module UI and inspect Vector Manager → Logs (tag:
SpotifyMultipointGuard). - Brief 1-second audio dip when using messaging apps (e.g., Telegram): Some messaging apps open a short
SoundPool/AudioTrackeven when audible sound effects are muted, which causes multipoint headphones to briefly switch A2DP to your phone and back. Disable both In-App Sounds and In-Chat Sounds in the messaging app if supported.