mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 18:48:04 +00:00
fix: bluetooth auto-connection and re-connection fixes, removing finished todos, allowing self-send call messages for deduping answers
This commit is contained in:
@@ -387,7 +387,7 @@ class WebRtcCallService: Service(), PeerConnection.Observer {
|
|||||||
val expectedCallId = callManager.callId
|
val expectedCallId = callManager.callId
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val answerFuture = callManager.onIncomingCall(this) // add is always turn here
|
val answerFuture = callManager.onIncomingCall(this)
|
||||||
answerFuture.fail { e ->
|
answerFuture.fail { e ->
|
||||||
if (isConsistentState(expectedState,expectedCallId, callManager.currentConnectionState, callManager.callId)) {
|
if (isConsistentState(expectedState,expectedCallId, callManager.currentConnectionState, callManager.callId)) {
|
||||||
Log.e(TAG, e)
|
Log.e(TAG, e)
|
||||||
|
@@ -407,7 +407,7 @@ class CallManager(context: Context, audioManager: AudioManagerCompat): PeerConne
|
|||||||
return answerMessage.success {
|
return answerMessage.success {
|
||||||
pendingOffer = null
|
pendingOffer = null
|
||||||
pendingOfferTime = -1
|
pendingOfferTime = -1
|
||||||
} // TODO: maybe add success state update
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onOutgoingCall(context: Context, isAlwaysTurn: Boolean = false): Promise<Unit, Exception> {
|
fun onOutgoingCall(context: Context, isAlwaysTurn: Boolean = false): Promise<Unit, Exception> {
|
||||||
|
@@ -152,7 +152,7 @@ class SignalAudioManager(private val context: Context,
|
|||||||
soundPool.play(disconnectedSoundId, volume, volume, 0, 0, 1.0f)
|
soundPool.play(disconnectedSoundId, volume, volume, 0, 0, 1.0f)
|
||||||
}
|
}
|
||||||
|
|
||||||
state = State.UNINITIALIZED
|
state = State.PREINITIALIZED
|
||||||
|
|
||||||
wiredHeadsetReceiver?.let { receiver ->
|
wiredHeadsetReceiver?.let { receiver ->
|
||||||
try {
|
try {
|
||||||
@@ -236,10 +236,10 @@ class SignalAudioManager(private val context: Context,
|
|||||||
userSelectedAudioDevice = AudioDevice.NONE
|
userSelectedAudioDevice = AudioDevice.NONE
|
||||||
}
|
}
|
||||||
|
|
||||||
val needBluetoothAudioStart = signalBluetoothManager!!.state == SignalBluetoothManager.State.AVAILABLE &&
|
val needBluetoothAudioStart = signalBluetoothManager!!.state == SignalBluetoothManager.State.AVAILABLE && signalBluetoothManager!!.state != SignalBluetoothManager.State.CONNECTING
|
||||||
(userSelectedAudioDevice == AudioDevice.NONE || userSelectedAudioDevice == AudioDevice.BLUETOOTH || autoSwitchToBluetooth)
|
(userSelectedAudioDevice == AudioDevice.NONE || userSelectedAudioDevice == AudioDevice.BLUETOOTH || autoSwitchToBluetooth)
|
||||||
|
|
||||||
val needBluetoothAudioStop = (signalBluetoothManager!!.state == SignalBluetoothManager.State.CONNECTED || signalBluetoothManager!!.state == SignalBluetoothManager.State.CONNECTING) &&
|
val needBluetoothAudioStop = (signalBluetoothManager!!.state == SignalBluetoothManager.State.CONNECTED || signalBluetoothManager!!.state != SignalBluetoothManager.State.CONNECTING) &&
|
||||||
(userSelectedAudioDevice != AudioDevice.NONE && userSelectedAudioDevice != AudioDevice.BLUETOOTH)
|
(userSelectedAudioDevice != AudioDevice.NONE && userSelectedAudioDevice != AudioDevice.BLUETOOTH)
|
||||||
|
|
||||||
if (signalBluetoothManager!!.state.hasDevice()) {
|
if (signalBluetoothManager!!.state.hasDevice()) {
|
||||||
|
@@ -11,7 +11,7 @@ class CallMessage(): ControlMessage() {
|
|||||||
var sdpMids: List<String> = listOf()
|
var sdpMids: List<String> = listOf()
|
||||||
var callId: UUID? = null
|
var callId: UUID? = null
|
||||||
|
|
||||||
override val isSelfSendValid: Boolean = false
|
override val isSelfSendValid: Boolean = type in arrayOf(SignalServiceProtos.CallMessage.Type.END_CALL,SignalServiceProtos.CallMessage.Type.ANSWER)
|
||||||
|
|
||||||
override val ttl: Long = 300000L // 30s
|
override val ttl: Long = 300000L // 30s
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user