Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stream-video-android-core/api/stream-video-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -9648,6 +9648,11 @@ public final class io/getstream/video/android/core/call/CallType$AudioCall : io/
public static final field INSTANCE Lio/getstream/video/android/core/call/CallType$AudioCall;
}

public final class io/getstream/video/android/core/call/CallType$AudioRoom : io/getstream/video/android/core/call/CallType {
public static final field INSTANCE Lio/getstream/video/android/core/call/CallType$AudioRoom;
public fun getSortPreset ()Lio/getstream/video/android/core/sorting/SortPreset;
}

public final class io/getstream/video/android/core/call/CallType$Companion {
public final fun fromName (Ljava/lang/String;)Lio/getstream/video/android/core/call/CallType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ sealed class CallType(val name: String) {
object Livestream : CallType("livestream") {
override val sortPreset: SortPreset get() = SortPreset.LivestreamOrAudioRoom
}

/**
* Group audio chat (mirrors React's `audio_room` and iOS's `audio_room` call type).
* Distinct from [AudioCall], which is the Android-specific 1:1 voice call type.
*/
object AudioRoom : CallType("audio_room") {
override val sortPreset: SortPreset get() = SortPreset.LivestreamOrAudioRoom
}

object AudioCall : CallType("audio_call")
object Default : CallType("default")
object AnyMarker : CallType("ALL_CALL_TYPES")
Expand All @@ -43,7 +52,13 @@ sealed class CallType(val name: String) {

companion object {
fun fromName(name: String): CallType? {
return listOf(Livestream, AudioCall, Default, AnyMarker).find { it.name == name }
return listOf(
Livestream,
AudioRoom,
AudioCall,
Default,
AnyMarker,
).find { it.name == name }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,27 @@ class CallTypeSortPresetTest {
assertThat(CallType.Livestream.sortPreset).isEqualTo(SortPreset.LivestreamOrAudioRoom)
}

@Test
fun `AudioRoom call type uses SortPreset LivestreamOrAudioRoom`() {
// CallType.AudioRoom mirrors the "audio_room" server type used by React and iOS.
// It applies the same livestream-style sort (activity + roles).
assertThat(CallType.AudioRoom.sortPreset).isEqualTo(SortPreset.LivestreamOrAudioRoom)
}

@Test
fun `AudioCall call type falls back to SortPreset Default (1to1 audio is not livestream-like)`() {
// CallType.AudioCall represents a 1:1 audio call, not the React/iOS audio_room
// concept. Auto-applying LivestreamOrAudioRoom there would mis-sort the two
// participants. Stays on Default until a dedicated AudioRoom call type lands.
// CallType.AudioCall represents a 1:1 audio call, distinct from AudioRoom (group
// audio). Auto-applying LivestreamOrAudioRoom there would mis-sort the two
// participants. AudioCall stays on Default.
assertThat(CallType.AudioCall.sortPreset).isEqualTo(SortPreset.Default)
}

@Test
fun `fromName audio_room resolves to AudioRoom call type with LivestreamOrAudioRoom preset`() {
val resolved = CallType.fromName("audio_room")?.sortPreset ?: SortPreset.Default
assertThat(resolved).isEqualTo(SortPreset.LivestreamOrAudioRoom)
}

@Test
fun `Custom call types default to SortPreset Default`() {
val custom = CallType.CustomCallType("my_custom_type")
Expand Down
Loading