fix: bluetooth auto-connection and re-connection fixes, removing finished todos, allowing self-send call messages for deduping answers

This commit is contained in:
Harris
2021-11-18 16:19:09 +11:00
parent 2029874e26
commit 276f808ca3
4 changed files with 6 additions and 6 deletions

View File

@@ -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)

View File

@@ -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> {

View File

@@ -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()) {