Skip to content

About

A small, local Android bridge that gives **Diffuse** the album artwork of whatever music app is playing, without taking over that app's media controls.w

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Diffuse Bridge 1.1.0

A small, local Android bridge that gives Diffuse the album artwork of whatever music app is playing, without taking over that app's media controls.

  • Package: com.example.diffusebridge
  • Version: 1.1.0 (versionCode 2)
  • Minimum Android: 7.0 (API 24)
  • No accounts, no network, no analytics. Everything stays on the device.
  • Engineered by boxmol (Abdullah Waleed).

Why the old version broke controls

The 1.0 bridge created its own MediaSession and immediately made it active. Android therefore routed media buttons and the system media player to the bridge instead of the real music app. The bridge also re-posted its notification as often as every 100 ms and always reported position 0, with no duration and no actions. The result was a notification that supplied artwork but hid/overrode the source player's duration and playback controls.

How 1.1.0 fixes it

The bridge now has two modes.

Artwork only (default, recommended)

The bridge listens for the source app's media notification, reads its large icon and metadata, and re-posts a quiet, media-looking notification for Diffuse.

Its own MediaSession stays inactive, so the source player keeps:

  • its own active media session
  • its real duration and position
  • its own playback controls and media-button handling

The re-posted notification still carries the artwork and a valid session token. The bridge session exposes real metadata, duration/position and play/pause/next/previous actions, so Diffuse can read everything it needs without the bridge stealing focus.

Mirror controls (compatibility fallback)

For a player that Diffuse cannot read through the notification alone, the bridge can make its session active and mirror the source player:

  • duration, position and playback speed come from the source PlaybackState
  • play, pause, next, previous, stop and seek are forwarded to the source MediaController
  • the bridge notification exposes play/pause/next/previous, and its session exposes stop/seek
  • the source player's notification is left in place

Only use this mode if artwork-only mode does not work with your player. Mirror mode is opt-in because an active bridge session is exactly what can compete with the source player for system media controls.


What it does

  1. NotificationListenerService watches notifications from the selected apps (or from any app when Any media app is on).
  2. It recognizes media notifications by their media-session token, transport category, large icon and transport actions.
  3. It reads the artwork from the large icon and metadata, plus title, artist, album, duration and position when available.
  4. It re-posts a low-importance ongoing notification (ID 1001, channel bridge_artwork_v2) with the artwork as its large icon.
  5. Diffuse reads that notification and displays the artwork.

The old bridge_channel channel is deleted on first run so its old notification and settings do not linger.

Setup

  1. Install releases/DiffuseBridge-1.1.0.apk. It is signed with the same public AOSP test key as the original 1.0 build, so it can upgrade in place and keep the existing Notification Access grant.
  2. Open Diffuse Bridge.
  3. In the Setup card, follow the order shown:
    • Battery optimization → tap Manage and set Diffuse Bridge to Unrestricted first. The app asks you to do this before opening Notification access: MIUI / HyperOS, One UI, ColorOS, etc. can otherwise stop the listener in the background. This is the simple explanation shown in the warning under the battery row.
    • Notification access → grant it for Diffuse Bridge. On Android 13+, sideloaded apps must first be allowed restricted settings: open App info → ⋮ → Allow restricted settings, then come back. The app explains this step when you tap Notification access.
    • Post notifications → allow notifications (Android 13+ asks at runtime; the bridge cannot post its artwork notification without this).
    • On Xiaomi/POCO/Redmi, also open Autostart and enable Diffuse Bridge.
    • After setup, open Recents, long-press Diffuse Bridge, and tap the lock icon. This keeps the relay from being swiped away or killed. Don't skip this step on MIUI/HyperOS.
  4. In Music sources, tap Choose apps and select the player(s) you use.
    • Auris (com.dev.bitchord) is selected automatically only when it is installed.
    • You can select several players; the one that is currently playing wins.
    • Turn on Any media app to relay any app that posts a media notification.
  5. In Diffuse, choose Diffuse Bridge as the notification source (not the old MediaFire Music Widget).
  6. Play something. The Now playing card should show the track and the bridge notification should appear quietly in the shade.

What changed in the revamp

  • New clean Material 3 interface (cards, tonal colours, chips, dark mode, dynamic system colours on Android 12+).
  • On/off switch for the bridge service.
  • Multi-select music-app picker with search and an Any media app fallback.
  • Setup card with live permission/status indicators and direct shortcuts.
  • Appearance selector (System / Light / Dark).
  • Mode selector (Artwork only / Mirror controls).
  • Real duration, position, speed and notification actions in the bridge session.
  • Artwork is only re-posted when the track, artwork, app or play state actually changes; there is no 100 ms re-post loop and no position reset.
  • No MediaFire "Music Widget" link and no YouTube setup link. Help lives in the app.
  • Live Beats is not touched by the bridge: it is Diffuse's microphone feature, separate from notification artwork.

Troubleshooting

No artwork in Diffuse

  • Confirm Notification access is Granted and Post notifications is Allowed in the Setup card.
  • Make sure the player is selected (or Any media app is on) and is actually posting a media notification with a large icon.
  • Check that the bridge notification is not blocked at the channel level: Android Settings → Apps → Diffuse Bridge → Notifications → Artwork relay.
  • Some players remove their media notification when paused. The bridge can only relay what the player posts.

Notification access is blocked or restricted

  • On Android 13+, apps installed outside the Play Store are restricted. Open App info → ⋮ → Allow restricted settings, then try Notification access again. If the three-dot menu does not show that option, it may already be allowed.
  • The app shows a short explanation before opening Notification access. This is separate from the battery warning: Android's restriction blocks the access toggle, while the battery setting keeps the relay alive afterward.

Controls or duration disappear

  • Use Artwork only (the default). It deliberately keeps the bridge session inactive.
  • Mirror controls is only for players that Diffuse cannot read otherwise, and it intentionally becomes the active session.

Bridge stops after a while

  • Set Battery optimization to Unrestricted. The app asks for this before opening Notification access; if you skipped it, fix it in the Setup card.
  • Lock Diffuse Bridge in Recents: open Recents, long-press the app, tap the lock icon. This prevents the system from killing the relay when you swipe apps away.
  • Enable Autostart on Xiaomi/POCO/Redmi, Oppo/realme, vivo/iQOO, OnePlus, Samsung, Huawei/Honor.
  • Re-open the app after a reboot if your OEM aggressively cleans background services; the listener will reconnect as soon as notification access is available.

Install fails with a signature error

The APK is signed with the original AOSP test key. If your installed copy was signed with a different key, uninstall it first (this removes its Notification Access grant) and install this build fresh.

Build

From the project root:

./build.sh

Output: releases/DiffuseBridge-1.1.0.apk.

The script uses the local Android SDK build-tools and JDK, compiles resources with aapt2, compiles Java with javac, dexes with d8, aligns with zipalign, and signs with signing/testkey.pk8 + signing/testkey.x509.pem (the public AOSP test key, SHA-1 61:ED:37:7E:85:D3:86:A8:DF:EE:6B:86:4B:D8:5B:0B:FA:A5:AF:81).

Privacy

The bridge reads notifications locally through Android's Notification Listener API. It does not upload, log, or persist artwork or track information. Only the selected-app list and user preferences are stored locally.

About

A small, local Android bridge that gives **Diffuse** the album artwork of whatever music app is playing, without taking over that app's media controls.w

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors