Hide Element Call entry point if Element Call service is not available. (#4783)

* Hide Element Call entry point if Element Call service is not available.

* No need to preview the case RoomCallState.Unavailable

* Hide start call action from user profile if Element Call is not available.

* Add mising `use` and cover the problem by a test.

* Update screenshots

* Update enterprise submodule ref.

* Ensure `enterpriseService.isElementCallAvailable()` is not called several times.
And fix unit tests on CI

---------

Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
Benoit Marty 2025-05-27 16:31:05 +02:00 committed by GitHub
parent 730fb684b0
commit 5b9da3c41b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 146 additions and 45 deletions

View file

@ -13,6 +13,8 @@ import io.element.android.features.roomcall.api.RoomCallState.StandBy
@Immutable
sealed interface RoomCallState {
data object Unavailable : RoomCallState
data class StandBy(
val canStartCall: Boolean,
) : RoomCallState
@ -25,6 +27,7 @@ sealed interface RoomCallState {
}
fun RoomCallState.hasPermissionToJoin() = when (this) {
RoomCallState.Unavailable -> false
is StandBy -> canStartCall
is OnGoing -> canJoinCall
}

View file

@ -16,6 +16,7 @@ open class RoomCallStateProvider : PreviewParameterProvider<RoomCallState> {
anOngoingCallState(),
anOngoingCallState(canJoinCall = false),
anOngoingCallState(canJoinCall = true, isUserInTheCall = true),
RoomCallState.Unavailable,
)
}