diff --git a/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/IncomingHostEnvironment.kt b/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/IncomingHostEnvironment.kt index 2507362d..e078fd88 100644 --- a/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/IncomingHostEnvironment.kt +++ b/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/IncomingHostEnvironment.kt @@ -13,6 +13,8 @@ object AppLanguage { } object CallController { + data class State(val ongoing: Boolean) + val state = MutableStateFlow(null) var media = false var blocked = false fun blocksMedia() = blocked @@ -22,9 +24,7 @@ object CallController { fun end(id: Long, reason: Int) { endings.add(id to reason); IncomingCallManager.stopRinging() } } -data class HostRadioCallState(val peerName: String, val channelName: String) -object RadioCallController { - val state = MutableStateFlow(null) - val endings = mutableListOf() - fun end(id: Long) { endings.add(id); IncomingCallManager.stopRinging() } +object StreamController { + var captureBlocked = false + fun blocksCapture() = captureBlocked } diff --git a/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/RadioHostEnvironment.kt b/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/RadioHostEnvironment.kt index 0fa1eafa..78d74468 100644 --- a/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/RadioHostEnvironment.kt +++ b/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/RadioHostEnvironment.kt @@ -7,5 +7,16 @@ object RadioOverlayService { var synchronizations = 0 fun sync(context: Context) { synchronizations++ } } -class HostRadioChannel(val id: String) -class ChatRepository { fun getChannels() = listOf(HostRadioChannel("7"), HostRadioChannel("8")) } +class HostRadioChannel(val id: String, val name: String = id) +class HostRadioMember(val nodeId: Long, val name: String) +class ChatRepository { + companion object { var failRadioLookup = false } + fun getChannels(): List { + check(!failRadioLookup) { "channel lookup failed" } + return listOf(HostRadioChannel("7"), HostRadioChannel("8")) + } + fun getMembers(channel: String): List { + check(!failRadioLookup) { "member lookup failed" } + return listOf(HostRadioMember(99, "Alice")) + } +} diff --git a/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/RouterHostEnvironment.kt b/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/RouterHostEnvironment.kt index f137208f..db13e46c 100644 --- a/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/RouterHostEnvironment.kt +++ b/tools/chatgui-android/router-tests/src/main/kotlin/com/utun/chat/data/RouterHostEnvironment.kt @@ -35,6 +35,14 @@ object LogManager { /** Только host-тест: считает уведомления standby, не загружает JNI и не запускает ядро. */ object NativeLib { + data class RadioCallCommand(val id: Long, val action: Int, val group: Long, val peer: Long) + val radioCalls = mutableListOf() + var onRadioCall: (RadioCallCommand) -> Boolean = { true } + fun radioCall(id: Long, action: Int, group: Long = 0, peer: Long = 0): Boolean { + val command = RadioCallCommand(id, action, group, peer) + radioCalls.add(command) + return onRadioCall(command) + } data class RadioCommand(val kind: String, val group: Long) val radioCommands: MutableList = Collections.synchronizedList(mutableListOf()) @Volatile var radioRequest = 0L