mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:01:40 +00:00
incomingCallTimedOut() does not need to be exposed in the interface.
This commit is contained in:
committed by
Benoit Marty
parent
cf9dbc60f6
commit
858e8c827b
+6
-6
@@ -8,6 +8,7 @@
|
|||||||
package io.element.android.features.call.impl.utils
|
package io.element.android.features.call.impl.utils
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import androidx.annotation.VisibleForTesting
|
||||||
import androidx.core.app.NotificationManagerCompat
|
import androidx.core.app.NotificationManagerCompat
|
||||||
import com.squareup.anvil.annotations.ContributesBinding
|
import com.squareup.anvil.annotations.ContributesBinding
|
||||||
import io.element.android.appconfig.ElementCallConfig
|
import io.element.android.appconfig.ElementCallConfig
|
||||||
@@ -56,11 +57,6 @@ interface ActiveCallManager {
|
|||||||
*/
|
*/
|
||||||
fun registerIncomingCall(notificationData: CallNotificationData)
|
fun registerIncomingCall(notificationData: CallNotificationData)
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the incoming call timed out. It will remove the active call and remove any associated UI, adding a 'missed call' notification.
|
|
||||||
*/
|
|
||||||
fun incomingCallTimedOut()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the active call has been hung up. It will remove any existing UI and the active call.
|
* Called when the active call has been hung up. It will remove any existing UI and the active call.
|
||||||
* @param callType The type of call that the user hung up, either an external url one or a room one.
|
* @param callType The type of call that the user hung up, either an external url one or a room one.
|
||||||
@@ -117,7 +113,11 @@ class DefaultActiveCallManager @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun incomingCallTimedOut() {
|
/**
|
||||||
|
* Called when the incoming call timed out. It will remove the active call and remove any associated UI, adding a 'missed call' notification.
|
||||||
|
*/
|
||||||
|
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
|
||||||
|
fun incomingCallTimedOut() {
|
||||||
val previousActiveCall = activeCall.value ?: return
|
val previousActiveCall = activeCall.value ?: return
|
||||||
val notificationData = (previousActiveCall.callState as? CallState.Ringing)?.notificationData ?: return
|
val notificationData = (previousActiveCall.callState as? CallState.Ringing)?.notificationData ?: return
|
||||||
activeCall.value = null
|
activeCall.value = null
|
||||||
|
|||||||
-5
@@ -15,7 +15,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
|||||||
|
|
||||||
class FakeActiveCallManager(
|
class FakeActiveCallManager(
|
||||||
var registerIncomingCallResult: (CallNotificationData) -> Unit = {},
|
var registerIncomingCallResult: (CallNotificationData) -> Unit = {},
|
||||||
var incomingCallTimedOutResult: () -> Unit = {},
|
|
||||||
var hungUpCallResult: (CallType) -> Unit = {},
|
var hungUpCallResult: (CallType) -> Unit = {},
|
||||||
var joinedCallResult: (CallType) -> Unit = {},
|
var joinedCallResult: (CallType) -> Unit = {},
|
||||||
) : ActiveCallManager {
|
) : ActiveCallManager {
|
||||||
@@ -25,10 +24,6 @@ class FakeActiveCallManager(
|
|||||||
registerIncomingCallResult(notificationData)
|
registerIncomingCallResult(notificationData)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun incomingCallTimedOut() {
|
|
||||||
incomingCallTimedOutResult()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun hungUpCall(callType: CallType) {
|
override fun hungUpCall(callType: CallType) {
|
||||||
hungUpCallResult(callType)
|
hungUpCallResult(callType)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user