mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
parent
b70b32e3d7
commit
a46864ae1b
@ -834,8 +834,6 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
userEntity.getToken()), ApiHelper.getUrlForSignaling(userEntity.getBaseUrl()))
|
userEntity.getToken()), ApiHelper.getUrlForSignaling(userEntity.getBaseUrl()))
|
||||||
.subscribeOn(Schedulers.newThread())
|
.subscribeOn(Schedulers.newThread())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.repeatWhen(observable -> observable.delay(1500,
|
|
||||||
TimeUnit.MILLISECONDS))
|
|
||||||
.repeatUntil(booleanSupplier)
|
.repeatUntil(booleanSupplier)
|
||||||
.retry(3)
|
.retry(3)
|
||||||
.subscribe(new Observer<SignalingOverall>() {
|
.subscribe(new Observer<SignalingOverall>() {
|
||||||
@ -860,12 +858,10 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
dispose(signalingDisposable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
dispose(signalingDisposable);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -969,7 +965,8 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
Set<String> oldSesssions = new HashSet<>();
|
Set<String> oldSesssions = new HashSet<>();
|
||||||
|
|
||||||
for (HashMap<String, String> participant : users) {
|
for (HashMap<String, String> participant : users) {
|
||||||
if (!participant.get("sessionId").equals(callSession)) {
|
if (!participant.get("sessionId").equals(callSession) && !participant.get("userId").equals(userEntity
|
||||||
|
.getUserId())) {
|
||||||
Object inCallObject = participant.get("inCall");
|
Object inCallObject = participant.get("inCall");
|
||||||
if ((boolean) inCallObject) {
|
if ((boolean) inCallObject) {
|
||||||
newSessions.add(participant.get("sessionId"));
|
newSessions.add(participant.get("sessionId"));
|
||||||
@ -979,7 +976,6 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (MagicPeerConnectionWrapper magicPeerConnectionWrapper : magicPeerConnectionWrapperList) {
|
for (MagicPeerConnectionWrapper magicPeerConnectionWrapper : magicPeerConnectionWrapperList) {
|
||||||
oldSesssions.add(magicPeerConnectionWrapper.getSessionId());
|
oldSesssions.add(magicPeerConnectionWrapper.getSessionId());
|
||||||
}
|
}
|
||||||
@ -1394,7 +1390,7 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private void registerNetworkReceiver() {
|
private void registerNetworkReceiver() {
|
||||||
IntentFilter intentFilter = new IntentFilter();
|
IntentFilter intentFilter = new IntentFilter();
|
||||||
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
|
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANxGE");
|
||||||
intentFilter.addAction("android.net.wifi.STATE_CHANGE");
|
intentFilter.addAction("android.net.wifi.STATE_CHANGE");
|
||||||
|
|
||||||
this.registerReceiver(networkBroadcastReceier, intentFilter);
|
this.registerReceiver(networkBroadcastReceier, intentFilter);
|
||||||
|
@ -133,7 +133,7 @@ public class MagicPeerConnectionWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendChannelData(DataChannelMessage dataChannelMessage) {
|
public void sendChannelData(DataChannelMessage dataChannelMessage) {
|
||||||
ByteBuffer buffer = null;
|
ByteBuffer buffer;
|
||||||
if (magicDataChannel != null) {
|
if (magicDataChannel != null) {
|
||||||
try {
|
try {
|
||||||
buffer = ByteBuffer.wrap(LoganSquare.serialize(dataChannelMessage).getBytes());
|
buffer = ByteBuffer.wrap(LoganSquare.serialize(dataChannelMessage).getBytes());
|
||||||
@ -245,17 +245,13 @@ public class MagicPeerConnectionWrapper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSignalingChange(PeerConnection.SignalingState signalingState) {
|
public void onSignalingChange(PeerConnection.SignalingState signalingState) {
|
||||||
if (signalingState.equals(PeerConnection.SignalingState.CLOSED)) {
|
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
|
||||||
.CLOSE_PEER, sessionId, null, null));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
|
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
|
||||||
if (iceConnectionState.equals(PeerConnection.IceConnectionState.CONNECTED) && hasInitiated) {
|
if (iceConnectionState.equals(PeerConnection.IceConnectionState.CONNECTED) && hasInitiated) {
|
||||||
sendInitialMediaStatus();
|
sendInitialMediaStatus();
|
||||||
} else if (iceConnectionState.equals(PeerConnection.IceConnectionState.FAILED)) {
|
} else if (iceConnectionState.equals(PeerConnection.IceConnectionState.CLOSED)) {
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
||||||
.CLOSE_PEER, sessionId, null, null));
|
.CLOSE_PEER, sessionId, null, null));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user