Modern Apps git

← Modern-Apps.git

maauto: walk refusal test to ACTIVE before 0x8

Commit
a2894f0625a490b48a8e01fa80f7640bd846ef89
Author
vayun-mathur <[email protected]>
When
2026-09-12 14:51 UTC (2 months ago)
Parents
9843e0c

Diff

auto/protocol/src/test/java/com/vayunmathur/auto/protocol/GalControlSessionTest.kt
diff --git a/auto/protocol/src/test/java/com/vayunmathur/auto/protocol/GalControlSessionTest.kt b/auto/protocol/src/test/java/com/vayunmathur/auto/protocol/GalControlSessionTest.ktindex 4cf33306e8..082246cda7 100644--- a/auto/protocol/src/test/java/com/vayunmathur/auto/protocol/GalControlSessionTest.kt+++ b/auto/protocol/src/test/java/com/vayunmathur/auto/protocol/GalControlSessionTest.kt@@ -221,8 +221,27 @@ class GalControlSessionTest {     fun `a refused channel open is recorded, not fatal`() {         // DHU 2.0 answers some opens with an empty MessageError and never sends         // 0x8 at all; other times 0x8 carries non-SUCCESS. Either way the-        // bring-up continues with the remaining services.-        val session = session(GalCredential.serverEngine(context()))+        // bring-up continues with the remaining services. Walk to ACTIVE first:+        // opens only happen after discovery completes.+        val context = context()+        val server = GalCredential.serverEngine(context)+        val car = context.createSSLEngine().apply { useClientMode = true }+        val session = session(server)+        session.onMessage(GalMessage.Control.VERSION_REQUEST, versionRequest(1, 6))+        runHandshake(session, car)+        session.onMessage(+            GalMessage.Control.AUTH_COMPLETE,+            AuthComplete.newBuilder()+                .setStatus(MessageStatus.STATUS_SUCCESS.number)+                .build()+                .toByteArray(),+        )+        session.onMessage(+            GalMessage.Control.SERVICE_DISCOVERY_RESPONSE,+            headUnitServices().toByteArray(),+        )+        assertEquals(SessionState.ACTIVE, session.state)+         val service = Service.newBuilder().setId(GalService.VIDEO_SINK.id).build()         session.openChannel(service)         assertEquals(listOf(GalService.VIDEO_SINK.id), session.pendingChannels)@@ -236,7 +255,7 @@ class GalControlSessionTest {         assertEquals(setOf(GalService.VIDEO_SINK.id), session.refusedChannels)         assertTrue(session.pendingChannels.isEmpty())         assertNull(session.failure)-        assertEquals(SessionState.DISCOVERING, session.state)+        assertEquals(SessionState.ACTIVE, session.state)     }      @Test