mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 08:15:02 +00:00
Merge pull request #7943 from element-hq/feature/valere/bump_ec_native_to_0.1.0-rc.8
Bump element-call-android to 0.1.0-rc.8 and the Rust SDK to 26.10.15
This commit is contained in:
+2
@@ -42,6 +42,8 @@ class DefaultNativeCallEntryPoint(
|
|||||||
ElementCallData(
|
ElementCallData(
|
||||||
roomId = RoomId(callData.roomId.value),
|
roomId = RoomId(callData.roomId.value),
|
||||||
isAudioCall = callData.isAudioCall,
|
isAudioCall = callData.isAudioCall,
|
||||||
|
// Temporary, to be removed from the library soon: the core already skips the ring when anyone else is in the call.
|
||||||
|
isStartingCall = true,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
// The call screen asks for the microphone itself, and is where the answer normally comes
|
// The call screen asks for the microphone itself, and is where the answer normally comes
|
||||||
|
|||||||
+4
-1
@@ -8,6 +8,7 @@
|
|||||||
package io.element.android.features.callnative.impl
|
package io.element.android.features.callnative.impl
|
||||||
|
|
||||||
import io.element.android.call.api.ElementCallData
|
import io.element.android.call.api.ElementCallData
|
||||||
|
import io.element.android.call.api.ElementCallEndReason
|
||||||
import io.element.android.call.api.ElementCallLifecycleListener
|
import io.element.android.call.api.ElementCallLifecycleListener
|
||||||
import io.element.android.features.call.api.CallData
|
import io.element.android.features.call.api.CallData
|
||||||
import io.element.android.features.call.api.CurrentCall
|
import io.element.android.features.call.api.CurrentCall
|
||||||
@@ -19,6 +20,7 @@ import io.element.android.services.appnavstate.api.AppForegroundStateService
|
|||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import timber.log.Timber
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reports a native call back to the parts of Element X that already track calls.
|
* Reports a native call back to the parts of Element X that already track calls.
|
||||||
@@ -47,7 +49,8 @@ class ElementXCallLifecycleListener(
|
|||||||
sessionCoroutineScope.launch { ringingCallTracker.onCallJoined(callData.toCallData()) }
|
sessionCoroutineScope.launch { ringingCallTracker.onCallJoined(callData.toCallData()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCallEnded(callData: ElementCallData?) {
|
override fun onCallEnded(callData: ElementCallData?, reason: ElementCallEndReason) {
|
||||||
|
Timber.i("Native call ended: $reason")
|
||||||
currentCallTracker.onCallEnded()
|
currentCallTracker.onCallEnded()
|
||||||
callData?.let { sessionCoroutineScope.launch { ringingCallTracker.onCallEnded(it.toCallData()) } }
|
callData?.let { sessionCoroutineScope.launch { ringingCallTracker.onCallEnded(it.toCallData()) } }
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -9,6 +9,7 @@ package io.element.android.features.callnative.impl
|
|||||||
|
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import io.element.android.call.api.ElementCallData
|
import io.element.android.call.api.ElementCallData
|
||||||
|
import io.element.android.call.api.ElementCallEndReason
|
||||||
import io.element.android.call.api.rtc.id.RoomId
|
import io.element.android.call.api.rtc.id.RoomId
|
||||||
import io.element.android.features.call.api.CurrentCall
|
import io.element.android.features.call.api.CurrentCall
|
||||||
import io.element.android.features.call.test.FakeCurrentCallTracker
|
import io.element.android.features.call.test.FakeCurrentCallTracker
|
||||||
@@ -30,7 +31,7 @@ class ElementXCallLifecycleListenerTest {
|
|||||||
val listener = createListener(currentCallTracker = currentCallTracker)
|
val listener = createListener(currentCallTracker = currentCallTracker)
|
||||||
|
|
||||||
listener.onCallStarted(A_CALL)
|
listener.onCallStarted(A_CALL)
|
||||||
listener.onCallEnded(A_CALL)
|
listener.onCallEnded(A_CALL, ElementCallEndReason.LEFT)
|
||||||
|
|
||||||
assertThat(currentCallTracker.calls).containsExactly(
|
assertThat(currentCallTracker.calls).containsExactly(
|
||||||
CurrentCall.RoomCall(A_ROOM_ID),
|
CurrentCall.RoomCall(A_ROOM_ID),
|
||||||
@@ -59,7 +60,7 @@ class ElementXCallLifecycleListenerTest {
|
|||||||
ringingCallTracker = ringingCallTracker,
|
ringingCallTracker = ringingCallTracker,
|
||||||
)
|
)
|
||||||
|
|
||||||
listener.onCallEnded(null)
|
listener.onCallEnded(null, ElementCallEndReason.LEFT)
|
||||||
runCurrent()
|
runCurrent()
|
||||||
|
|
||||||
// The current call is always cleared; only the ring needs to know which call it was.
|
// The current call is always cleared; only the ring needs to know which call it was.
|
||||||
@@ -79,6 +80,6 @@ class ElementXCallLifecycleListenerTest {
|
|||||||
)
|
)
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
val A_CALL = ElementCallData(roomId = RoomId(A_ROOM_ID.value), isAudioCall = true)
|
val A_CALL = ElementCallData(roomId = RoomId(A_ROOM_ID.value), isAudioCall = true, isStartingCall = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@ class RoomCallStatePresenter(
|
|||||||
isAudioCall = roomInfo.activeCallIntentConsensus.isAudio(),
|
isAudioCall = roomInfo.activeCallIntentConsensus.isAudio(),
|
||||||
)
|
)
|
||||||
else -> {
|
else -> {
|
||||||
val isEmptyDm = roomInfo.isDm && roomInfo.activeMembersCount <= 1
|
val isEmptyDm = roomInfo.isDm && roomInfo.joinedMembersCount <= 1
|
||||||
RoomCallState.StandBy(
|
RoomCallState.StandBy(
|
||||||
canStartCall = canJoinCall && !isEmptyDm,
|
canStartCall = canJoinCall && !isEmptyDm,
|
||||||
isDM = roomInfo.isDm
|
isDM = roomInfo.isDm
|
||||||
|
|||||||
+16
-1
@@ -85,6 +85,21 @@ class RoomCallStatePresenterTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `present - a DM whose other member is only invited cannot be called`() = runTest {
|
||||||
|
val room = FakeJoinedRoom(
|
||||||
|
baseRoom = FakeBaseRoom(
|
||||||
|
initialRoomInfo = aRoomInfo(isDm = true, activeMembersCount = 2, joinedMembersCount = 1),
|
||||||
|
roomPermissions = roomPermissions(true),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
val presenter = createRoomCallStatePresenter(joinedRoom = room)
|
||||||
|
presenter.test {
|
||||||
|
skipItems(1)
|
||||||
|
assertThat(awaitItem()).isEqualTo(RoomCallState.StandBy(canStartCall = false, isDM = true))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - element call not available`() = runTest {
|
fun `present - element call not available`() = runTest {
|
||||||
val room = FakeJoinedRoom(
|
val room = FakeJoinedRoom(
|
||||||
@@ -128,7 +143,7 @@ class RoomCallStatePresenterTest {
|
|||||||
fun `present - initial state - when is DM room`() = runTest {
|
fun `present - initial state - when is DM room`() = runTest {
|
||||||
val room = FakeJoinedRoom(
|
val room = FakeJoinedRoom(
|
||||||
baseRoom = FakeBaseRoom(
|
baseRoom = FakeBaseRoom(
|
||||||
initialRoomInfo = aRoomInfo(isDm = true),
|
initialRoomInfo = aRoomInfo(isDm = true, joinedMembersCount = 2),
|
||||||
roomPermissions = roomPermissions(true),
|
roomPermissions = roomPermissions(true),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ ktlint = "1.8.0"
|
|||||||
androidx-test-ext-junit = "1.3.0"
|
androidx-test-ext-junit = "1.3.0"
|
||||||
kover = "0.9.11"
|
kover = "0.9.11"
|
||||||
# The native MatrixRTC call component, https://github.com/element-hq/element-call-android
|
# The native MatrixRTC call component, https://github.com/element-hq/element-call-android
|
||||||
element_call = "0.1.0-rc.7"
|
element_call = "0.1.0-rc.8"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
# Project
|
# Project
|
||||||
@@ -186,7 +186,7 @@ test_detekt_test = { module = "io.gitlab.arturbosch.detekt:detekt-test", version
|
|||||||
# it as a plain `require`: without this, a library built against a newer SDK would silently drag this app
|
# it as a plain `require`: without this, a library built against a newer SDK would silently drag this app
|
||||||
# onto it. With it, this pin always wins, and a library that needs something newer fails at configuration
|
# onto it. With it, this pin always wins, and a library that needs something newer fails at configuration
|
||||||
# time naming both versions instead of at runtime with NoSuchMethodError.
|
# time naming both versions instead of at runtime with NoSuchMethodError.
|
||||||
matrix_sdk = { module = "org.matrix.rustcomponents:sdk-android", version = { strictly = "26.10.14-nightly" } }
|
matrix_sdk = { module = "org.matrix.rustcomponents:sdk-android", version = { strictly = "26.10.15" } }
|
||||||
rustls_platform_verifier = "org.rustls:rustls-platform-verifier:0.2.0"
|
rustls_platform_verifier = "org.rustls:rustls-platform-verifier:0.2.0"
|
||||||
|
|
||||||
# Others
|
# Others
|
||||||
|
|||||||
Reference in New Issue
Block a user