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() {
|
private AudioDevice getAudioDeviceFallback() {
|
||||||
return requireAppRtcAudioManager().getSelectedAudioDevice();
|
final var audioDevice = requireAppRtcAudioManager().getSelectedAudioDevice();
|
||||||
|
return audioDevice == null ? AudioDevice.NONE : audioDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAudioDeviceFallback(final AudioDevice audioDevice) {
|
private void setAudioDeviceFallback(final AudioDevice audioDevice) {
|
||||||
|
|
|
@ -128,6 +128,12 @@ public class CallIntegrationConnectionService extends ConnectionService {
|
||||||
final var proposal =
|
final var proposal =
|
||||||
service.getJingleConnectionManager()
|
service.getJingleConnectionManager()
|
||||||
.proposeJingleRtpSession(account, with, media);
|
.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(
|
intent.putExtra(
|
||||||
RtpSessionActivity.EXTRA_LAST_REPORTED_STATE,
|
RtpSessionActivity.EXTRA_LAST_REPORTED_STATE,
|
||||||
RtpEndUserState.FINDING_DEVICE.toString());
|
RtpEndUserState.FINDING_DEVICE.toString());
|
||||||
|
|
|
@ -4,6 +4,8 @@ import android.telecom.VideoProfile;
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
@ -727,7 +729,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
|
||||||
return rtpConnection;
|
return rtpConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RtpSessionProposal proposeJingleRtpSession(
|
public @Nullable RtpSessionProposal proposeJingleRtpSession(
|
||||||
final Account account, final Jid with, final Set<Media> media) {
|
final Account account, final Jid with, final Set<Media> media) {
|
||||||
synchronized (this.rtpSessionProposals) {
|
synchronized (this.rtpSessionProposals) {
|
||||||
for (final Map.Entry<RtpSessionProposal, DeviceDiscoveryState> entry :
|
for (final Map.Entry<RtpSessionProposal, DeviceDiscoveryState> entry :
|
||||||
|
|
Loading…
Reference in a new issue