withContext
abstract suspend fun <T> withContext(context: ClientContext, block: suspend NavManagerService.() -> T): T
Use this function to provide context to the IPC calls you are about to make. For example:
val voiceAssistantContext = ClientContext(id = "conversation45")
voiceAssistantContext.add("""{ "user_utterance": "hey car, navigate me to Berlin" }""")
navManagerService.withContext(voiceAssistantContext) {
val searchResults = forward("restaurant")
navigateTo(searchResults.first())
}Content copied to clipboard
NOTE: it is expected that all calls with the same context are sequential (not parallel).