fix rare crashes in call integration
This commit is contained in:
parent
4968bde774
commit
96bf407bf0
|
@ -297,7 +297,8 @@ public class CallIntegration extends Connection {
|
|||
}
|
||||
|
||||
private AudioDevice getAudioDeviceFallback() {
|
||||
return requireAppRtcAudioManager().getSelectedAudioDevice();
|
||||
final var audioDevice = requireAppRtcAudioManager().getSelectedAudioDevice();
|
||||
return audioDevice == null ? AudioDevice.NONE : audioDevice;
|
||||
}
|
||||
|
||||
private void setAudioDeviceFallback(final AudioDevice audioDevice) {
|
||||
|
|
|
@ -128,6 +128,12 @@ public class CallIntegrationConnectionService extends ConnectionService {
|
|||
final var proposal =
|
||||
service.getJingleConnectionManager()
|
||||
.proposeJingleRtpSession(account, with, media);
|
||||
if (proposal == null) {
|
||||
// TODO instead of just null checking try to get the sessionID
|
||||
return Connection.createFailedConnection(
|
||||
new DisconnectCause(
|
||||
DisconnectCause.ERROR, "a call is already in progress"));
|
||||
}
|
||||
intent.putExtra(
|
||||
RtpSessionActivity.EXTRA_LAST_REPORTED_STATE,
|
||||
RtpEndUserState.FINDING_DEVICE.toString());
|
||||
|
|
|
@ -4,6 +4,8 @@ import android.telecom.VideoProfile;
|
|||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
@ -727,7 +729,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
|
|||
return rtpConnection;
|
||||
}
|
||||
|
||||
public RtpSessionProposal proposeJingleRtpSession(
|
||||
public @Nullable RtpSessionProposal proposeJingleRtpSession(
|
||||
final Account account, final Jid with, final Set<Media> media) {
|
||||
synchronized (this.rtpSessionProposals) {
|
||||
for (final Map.Entry<RtpSessionProposal, DeviceDiscoveryState> entry :
|
||||
|
|
Loading…
Reference in a new issue