mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +03:00
klint
This commit is contained in:
parent
c4b977c6e1
commit
84b474d070
5 changed files with 3 additions and 17 deletions
|
@ -21,11 +21,9 @@ enum class CallState {
|
|||
/** Idle, setting up objects */
|
||||
IDLE,
|
||||
|
||||
|
||||
/** Dialing. Outgoing call is signaling the remote peer */
|
||||
DIALING,
|
||||
|
||||
|
||||
/** Local ringing. Incoming call offer received */
|
||||
LOCAL_RINGING,
|
||||
|
||||
|
@ -35,7 +33,6 @@ enum class CallState {
|
|||
/** Connecting. Incoming/Outgoing Offer and answer are known, Currently checking and testing pairs of ice candidates */
|
||||
CONNECTING,
|
||||
|
||||
|
||||
/** Connected. Incoming/Outgoing call, the call is connected */
|
||||
CONNECTED,
|
||||
|
||||
|
|
|
@ -89,7 +89,6 @@ class CallControlsView @JvmOverloads constructor(
|
|||
interactionListener?.returnToChat()
|
||||
}
|
||||
|
||||
|
||||
fun updateForState(state: VectorCallViewState) {
|
||||
val callState = state.callState.invoke()
|
||||
muteIcon.setImageResource(if (state.isAudioMuted) R.drawable.ic_microphone_off else R.drawable.ic_microphone_on)
|
||||
|
|
|
@ -28,8 +28,6 @@ import com.squareup.inject.assisted.AssistedInject
|
|||
import im.vector.matrix.android.api.session.Session
|
||||
import im.vector.matrix.android.api.session.call.CallState
|
||||
import im.vector.matrix.android.api.session.call.MxCall
|
||||
import im.vector.matrix.android.api.session.room.model.call.CallAnswerContent
|
||||
import im.vector.matrix.android.api.session.room.model.call.CallHangupContent
|
||||
import im.vector.matrix.android.api.util.MatrixItem
|
||||
import im.vector.matrix.android.api.util.toMatrixItem
|
||||
import im.vector.riotx.core.extensions.exhaustive
|
||||
|
@ -103,7 +101,6 @@ class VectorCallViewModel @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
|
@ -138,7 +135,7 @@ class VectorCallViewModel @AssistedInject constructor(
|
|||
}
|
||||
VectorCallViewActions.ToggleVideo -> {
|
||||
withState {
|
||||
if(it.isVideoCall) {
|
||||
if (it.isVideoCall) {
|
||||
val videoEnabled = it.isVideoEnabled
|
||||
webRtcPeerConnectionManager.enableVideo(!videoEnabled)
|
||||
setState {
|
||||
|
|
|
@ -607,7 +607,6 @@ class WebRtcPeerConnectionManager @Inject constructor(
|
|||
* "connecting", or "checking".
|
||||
*/
|
||||
PeerConnection.PeerConnectionState.DISCONNECTED -> {
|
||||
|
||||
}
|
||||
null -> {
|
||||
}
|
||||
|
@ -630,13 +629,11 @@ class WebRtcPeerConnectionManager @Inject constructor(
|
|||
override fun onIceConnectionChange(newState: PeerConnection.IceConnectionState) {
|
||||
Timber.v("## VOIP StreamObserver onIceConnectionChange IceConnectionState:$newState")
|
||||
when (newState) {
|
||||
|
||||
/**
|
||||
* the ICE agent is gathering addresses or is waiting to be given remote candidates through
|
||||
* calls to RTCPeerConnection.addIceCandidate() (or both).
|
||||
*/
|
||||
PeerConnection.IceConnectionState.NEW -> {
|
||||
|
||||
}
|
||||
/**
|
||||
* The ICE agent has been given one or more remote candidates and is checking pairs of local and remote candidates
|
||||
|
@ -644,7 +641,6 @@ class WebRtcPeerConnectionManager @Inject constructor(
|
|||
* the peer connection to be made. It's possible that gathering of candidates is also still underway.
|
||||
*/
|
||||
PeerConnection.IceConnectionState.CHECKING -> {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -654,7 +650,6 @@ class WebRtcPeerConnectionManager @Inject constructor(
|
|||
* candidates against one another looking for a better connection to use.
|
||||
*/
|
||||
PeerConnection.IceConnectionState.CONNECTED -> {
|
||||
|
||||
}
|
||||
/**
|
||||
* Checks to ensure that components are still connected failed for at least one component of the RTCPeerConnection.
|
||||
|
@ -674,13 +669,11 @@ class WebRtcPeerConnectionManager @Inject constructor(
|
|||
* The ICE agent has finished gathering candidates, has checked all pairs against one another, and has found a connection for all components.
|
||||
*/
|
||||
PeerConnection.IceConnectionState.COMPLETED -> {
|
||||
|
||||
}
|
||||
/**
|
||||
* The ICE agent for this RTCPeerConnection has shut down and is no longer handling requests.
|
||||
*/
|
||||
PeerConnection.IceConnectionState.CLOSED -> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -691,7 +684,7 @@ class WebRtcPeerConnectionManager @Inject constructor(
|
|||
// reportError("Weird-looking stream: " + stream);
|
||||
if (stream.audioTracks.size > 1 || stream.videoTracks.size > 1) {
|
||||
Timber.e("## VOIP StreamObserver weird looking stream: $stream")
|
||||
//TODO maybe do something more??
|
||||
// TODO maybe do something more??
|
||||
callContext.mxCall.hangUp()
|
||||
return@execute
|
||||
}
|
||||
|
|
|
@ -295,7 +295,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
sharedCallActionViewModel
|
||||
.activeCall
|
||||
.observe(viewLifecycleOwner, Observer {
|
||||
//TODO delay a bit if it's a new call to let call activity launch before ..
|
||||
// TODO delay a bit if it's a new call to let call activity launch before ..
|
||||
activeCallView.isVisible = it != null
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue