diff --git a/.claude/skills/car-logs/SKILL.md b/.claude/skills/car-logs/SKILL.md index 2c751e7..e30f9ad 100644 --- a/.claude/skills/car-logs/SKILL.md +++ b/.claude/skills/car-logs/SKILL.md @@ -65,10 +65,10 @@ drive shows the same. ## Music-sources checks `fetch-logs` also brings `media-probe-YYYYMMDD-HHMMSS.txt` (Logs tab, "Check music sources", -`MediaProbe`). Three parts: audio players (use, app, state), active media sessions, and every -media browser service with `connected` / `refused or failed` / `no answer`, then its state and -song (TITLE, ARTIST, ALBUM, ALBUM_ART as a size). CarPlay's is -`com.allgo.remoteui.mediabrowserservice/...RemoteUIMediaBrowserService`. Ask what was playing +`MediaProbe`). Three parts: audio players (use, app, state), active media sessions with state +and song (TITLE, ARTIST, ALBUM, ALBUM_ART as a size or ALBUM_ART_URI), and the media browser +services by name (2.42.1 on; 2.42.0 also connected to them, which stopped the music). CarPlay's +session is `com.allgo.remoteui.mediabrowserservice`, Bluetooth's `com.android.bluetooth`. Ask what was playing when the check ran. ## Rules diff --git a/AGENTS.md b/AGENTS.md index df65bad..744dcc4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -82,7 +82,7 @@ Repository: `ssh://git@git.stinnesbeck.com:2222/nils/mg4.git` (remote `origin`), | Live data | on/off, ABRP API key and user token, upload frequency | | Server | URL, pairing by QR, ingest token, installation ID (read-only), config import | | Settings | drive mode (Eco, Normal, Sport, Snow, Custom; the lit one is what the car reports; changes only in P at a standstill, `DriveModeWrite`; "Set at start" sets the last confirmed choice again when the service starts with the head unit), full screen, voice key, Overview style with the accent colour beside it (offered only for styles drawn in it, `OverviewStyle.usesAccent`; Retro, Terminal, Grid (and Grid with map, sharing Grid's choice) and Visor add "Original" for their own palette, `hasOriginal`), tyre unit, battery and charging price (one card on wide screens), version, update check, install from USB, About | -| Logs | signal recorder (`SignalRecorder`/`SignalRecording`: every property and vendor getter via `VendorSurfaceProbe.capture`, again and again for 3 minutes, plus change events of the driver-assistance block it subscribes to, `EVHardware.listenToProperties` with `AssistBlock`, and steering-wheel key broadcasts; lists what changed, rarest first; saved to the app, a USB stick and the server, through `LogOutbox`, which sends it again later when the car is offline; how to find where the car publishes something), music-sources check (`MediaProbe`: audio players, media sessions and every media browser service, CarPlay's among them, with their song; read only, saved and sent like a recording), update log (every install step, with the platform's words), upload log | +| Logs | signal recorder (`SignalRecorder`/`SignalRecording`: every property and vendor getter via `VendorSurfaceProbe.capture`, again and again for 3 minutes, plus change events of the driver-assistance block it subscribes to, `EVHardware.listenToProperties` with `AssistBlock`, and steering-wheel key broadcasts; lists what changed, rarest first; saved to the app, a USB stick and the server, through `LogOutbox`, which sends it again later when the car is offline; how to find where the car publishes something), music-sources check (`MediaProbe`: audio players and the active media sessions, CarPlay's and Bluetooth's among them, with their song, and the media browser services by name — never connected to: binding them stopped the music in 2.42.0; saved and sent like a recording), update log (every install step, with the platform's words), upload log | Key classes (`app/src/main/java/com/evsuite/abrp/`): `AbrpUploadService` (foreground service, 15 s tick), `TelemetryUploader` (+ `TelemetryQueue`, persisted), `TelemetryPayload` (server diff --git a/SPECS.md b/SPECS.md index 1f71ee0..dddf4cb 100644 --- a/SPECS.md +++ b/SPECS.md @@ -140,6 +140,21 @@ tyre pressures, GPS (lat, lon, elevation, heading) and the is_* flags. It does * confirmed car facts, app structure, UI conventions, build/test/ship, documents. It replaces upstream's EVABRPUploader text. The test emulator is now in the flake: `nix run .#car-emulator` (Android 9 AOSP at 1920×720, 160 dpi; the car build installs as the system user — checked). +- 2026-10-28 — App 2.42.1: **the music-sources check no longer connects to other apps' media + services.** In the car, 2.42.0's check (14:26, Bluetooth music playing) made the head unit ask + whether to allow access to media (the owner agreed) and **stopped the Bluetooth music**: it + connected to every media browser service, and among them the AOSP car radio's + (`com.android.car.radio/.RadioService`, which answered "connecting", most likely taking the + audio) and the Local Media Player (`com.android.car.media.localmediaplayer`, whose permission + request is most likely the question; it may now read media files). My claim that the check only + read was wrong: binding another app's service starts it. Now the services are only listed. + Nothing lost: the active sessions alone carried everything — **Bluetooth** + (`com.android.bluetooth`: title, artist, album, duration, track, cover as a file path, playing) + and **CarPlay** (`com.allgo.remoteui.mediabrowserservice`: title, artist, duration, paused) — + readable with MEDIA_CONTENT_CONTROL, no connection needed. Services on the car: CarPlay's, + Bluetooth A2DP, Local Media Player, the AOSP car radio, SAIC's radio (DAB, "Brillux Radio"), + SAIC's USB 1/2 and online media, and SAIC's video browser. Tests and lint pass; not run on the + emulator (stopped for low memory; the change only removes code); not tried on the car. - 2026-10-28 — App 2.42.0 published (`car-2.42.0`). - 2026-10-28 — App 2.42.0: **music-sources check** on the Logs tab (`MediaProbe`, `MediaProbeText`; owner: "is it possible to show playing music in our dashboard as well?", then diff --git a/app/build.gradle b/app/build.gradle index 82cec14..52f7827 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,8 +34,8 @@ android { applicationId "com.stinnesbeck.nilsmg4" minSdk 27 targetSdk 36 - versionCode 151 - versionName "2.42.0" + versionCode 152 + versionName "2.42.1" // Nothing about the server ships in the APK: its URL and ingest token are entered in // the app's Server tab (ServerConfig), and the database is only reachable by the server. diff --git a/app/src/main/java/com/evsuite/abrp/MediaProbe.java b/app/src/main/java/com/evsuite/abrp/MediaProbe.java index dc073c5..e186a63 100644 --- a/app/src/main/java/com/evsuite/abrp/MediaProbe.java +++ b/app/src/main/java/com/evsuite/abrp/MediaProbe.java @@ -9,25 +9,17 @@ import android.graphics.Bitmap; import android.media.AudioManager; import android.media.AudioPlaybackConfiguration; import android.media.MediaMetadata; -import android.media.browse.MediaBrowser; import android.media.session.MediaController; import android.media.session.MediaSessionManager; import android.media.session.PlaybackState; -import android.os.Handler; -import android.os.HandlerThread; import android.service.media.MediaBrowserService; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; -import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; -import java.util.Set; import java.util.TreeSet; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; /** * The music-sources check on the Logs tab: where the head unit tells what is playing, before @@ -37,23 +29,15 @@ import java.util.concurrent.atomic.AtomicReference; *