mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-24 22:17:25 +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
|
||||
|
||||
try {
|
||||
val answerFuture = callManager.onIncomingCall(this) // add is always turn here
|
||||
val answerFuture = callManager.onIncomingCall(this)
|
||||
answerFuture.fail { e ->
|
||||
if (isConsistentState(expectedState,expectedCallId, callManager.currentConnectionState, callManager.callId)) {
|
||||
Log.e(TAG, e)
|
||||
|
@@ -407,7 +407,7 @@ class CallManager(context: Context, audioManager: AudioManagerCompat): PeerConne
|
||||
return answerMessage.success {
|
||||
pendingOffer = null
|
||||
pendingOfferTime = -1
|
||||
} // TODO: maybe add success state update
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
state = State.UNINITIALIZED
|
||||
state = State.PREINITIALIZED
|
||||
|
||||
wiredHeadsetReceiver?.let { receiver ->
|
||||
try {
|
||||
@@ -236,10 +236,10 @@ class SignalAudioManager(private val context: Context,
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
if (signalBluetoothManager!!.state.hasDevice()) {
|
||||
|
Reference in New Issue
Block a user