Modern Apps git

← Modern-Apps.git

maauto: GAL 11/12 gap docs plus NOT_SUPPORTED stub, tests

Commit
3d7d48c323786e69bd0b26c824c1a64ea0b39350
Author
vayun-mathur <[email protected]>
When
2026-09-12 20:43 UTC (2 months ago)
Parents
e6fb1a1

Diff

auto/protocol/src/main/java/com/vayunmathur/auto/protocol/GalMessage.kt
diff --git a/auto/protocol/src/main/java/com/vayunmathur/auto/protocol/GalMessage.kt b/auto/protocol/src/main/java/com/vayunmathur/auto/protocol/GalMessage.ktindex bbb8f0ac77..b1c886027f 100644--- a/auto/protocol/src/main/java/com/vayunmathur/auto/protocol/GalMessage.kt+++ b/auto/protocol/src/main/java/com/vayunmathur/auto/protocol/GalMessage.kt@@ -132,3 +132,14 @@ enum class GalService(val id: Int) {         fun fromId(id: Int): GalService? = byId[id]     } }++/**+ * GAL 11/12 gap (Phase 4, MA Auto sender): the teardown recovered the+ * `MEDIA_PLAYBACK_STATUS` (`xkn`, control.proto field 9) and `MEDIA_BROWSER`+ * (`xki`, field 11) descriptor fields but never their channel message IDs, so+ * MA Auto neither opens these channels' semantics nor answers them. Now-playing+ * is served from the on-device media session and rendered into the ch2 video+ * stream instead; inbound 11/12 traffic is NOT_SUPPORTED: observed and ignored.+ */+fun isMediaBrowserChannel(channelId: Int): Boolean =+    channelId == GalService.MEDIA_PLAYBACK_STATUS.id || channelId == GalService.MEDIA_BROWSER.id
auto/protocol/src/main/proto/gal/media.proto
diff --git a/auto/protocol/src/main/proto/gal/media.proto b/auto/protocol/src/main/proto/gal/media.protoindex 63f05179a5..d5b8ccdd4c 100644--- a/auto/protocol/src/main/proto/gal/media.proto+++ b/auto/protocol/src/main/proto/gal/media.proto@@ -1,6 +1,13 @@ // Google Automotive Link media channels: the shared setup/start/ack sequence used by the // video sink and the three audio sinks, plus video focus. //+// GAL 11/12 GAP (Phase 4, MA Auto sender): the media-playback-status (service 11,+// `xkn`) and media-browser (service 12, `xki`) channel messages are unmapped, so they+// are deliberately absent below. Now-playing is served from the on-device media session+// and rendered into the ch2 video stream instead; inbound 11/12 traffic is+// NOT_SUPPORTED (observed, never answered -- see `isMediaBrowserChannel`).+// If the teardown ever recovers those IDs, their messages go at the end of this file.+// // Field numbers recovered from the APK's protobuf-lite descriptors and exact; names follow // aasdk/openauto. See gal/control.proto for the provenance note. 
auto/protocol/src/main/proto/gal/services.proto
diff --git a/auto/protocol/src/main/proto/gal/services.proto b/auto/protocol/src/main/proto/gal/services.protoindex a46a9acfb7..7b25ce4b66 100644--- a/auto/protocol/src/main/proto/gal/services.proto+++ b/auto/protocol/src/main/proto/gal/services.proto@@ -1,6 +1,12 @@ // Google Automotive Link service descriptors -- the payloads a head unit puts inside each // Service entry of its discovery response. //+// GAL 11/12 GAP (Phase 4, MA Auto sender): the APK teardown recovered the service+// descriptor fields but not the MEDIA_PLAYBACK_STATUS / MEDIA_BROWSER channel message+// IDs, so MA Auto does not speak services 11/12. Now-playing is served from the+// on-device media session and rendered into the ch2 video stream instead; inbound+// 11/12 traffic is NOT_SUPPORTED (observed, never answered). See gal/media.proto.+// // Field numbers recovered from the APK's protobuf-lite descriptors and exact; names follow // aasdk/openauto. See gal/control.proto for the provenance note. 
auto/protocol/src/test/java/com/vayunmathur/auto/protocol/MediaGalGapTest.kt
diff --git a/auto/protocol/src/test/java/com/vayunmathur/auto/protocol/MediaGalGapTest.kt b/auto/protocol/src/test/java/com/vayunmathur/auto/protocol/MediaGalGapTest.ktnew file mode 100644index 0000000000..1463730dd4--- /dev/null+++ b/auto/protocol/src/test/java/com/vayunmathur/auto/protocol/MediaGalGapTest.kt@@ -0,0 +1,54 @@+package com.vayunmathur.auto.protocol++import com.google.protobuf.ByteString+import com.vayunmathur.auto.protocol.gal.Service+import kotlin.test.Test+import kotlin.test.assertEquals+import kotlin.test.assertFalse+import kotlin.test.assertTrue++/**+ * Pins the GAL 11/12 gap: the media-browser and playback-status services stay+ * opaque and unanswered, with now-playing riding the ch2 video stream instead.+ */+class MediaGalGapTest {++    @Test+    fun `channels 11 and 12 are media-gap channels`() {+        assertTrue(isMediaBrowserChannel(GalService.MEDIA_PLAYBACK_STATUS.id))+        assertTrue(isMediaBrowserChannel(GalService.MEDIA_BROWSER.id))+    }++    @Test+    fun `real channels are not media-gap channels`() {+        assertFalse(isMediaBrowserChannel(GalService.CONTROL.id))+        assertFalse(isMediaBrowserChannel(GalService.VIDEO_SINK.id))+        assertFalse(isMediaBrowserChannel(GalService.INPUT_SOURCE.id))+    }++    @Test+    fun `media browser descriptor stays opaque bytes`() {+        val parsed = Service.parseFrom(+            Service.newBuilder()+                .setId(GalService.MEDIA_BROWSER.id)+                .setMediaBrowser(ByteString.copyFromUtf8("xki"))+                .build()+                .toByteArray(),+        )+        assertTrue(parsed.hasMediaBrowser())+        assertEquals("xki", parsed.mediaBrowser.toStringUtf8())+    }++    @Test+    fun `media playback status descriptor stays opaque bytes`() {+        val parsed = Service.parseFrom(+            Service.newBuilder()+                .setId(GalService.MEDIA_PLAYBACK_STATUS.id)+                .setMediaPlaybackStatus(ByteString.copyFromUtf8("xkn"))+                .build()+                .toByteArray(),+        )+        assertTrue(parsed.hasMediaPlaybackStatus())+        assertEquals("xkn", parsed.mediaPlaybackStatus.toStringUtf8())+    }+}