mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-10 16:02:25 +01:00
The head unit offers a media sink, but Android answers Setup with an empty reply instead of a Config message. AudioLink now falls back to the advertised sink after 2.5s. AudioCaptureService captures by audio usage, not by app, so switching media apps costs nothing further and one grant covers a whole drive. A one-time adb command (PROJECT_MEDIA) removes the consent dialog itself; the setup screen now includes it as a copyable step, next to the existing mic-permission step. Capture counts as a screen share, so Android 15 hides notification contents while it runs. ScreenShareGuard lifts that protection for the length of the capture, with a second adb grant (WRITE_SECURE_SETTINGS), and restores it afterward, including after a crash. The phone keeps playing what it captures, so AudioCaptureService also mutes STREAM_MUSIC for the drive and restores it on every exit path. Adds a debug bench (BenchAudioSink, CarPreviewActivity --ez audio true) for testing the audio path without a car, and a unit test that rebuilds the real head unit's ServiceDiscoveryResponse from a logged session to confirm the media and guidance sinks are found correctly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>