Disconnect groupCall object when network is unavailable.

This commit is contained in:
Alex Hart
2025-05-13 16:47:46 -03:00
committed by Michelle Tang
parent 7e00739240
commit 7c43462771
2 changed files with 11 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ import android.net.NetworkInfo;
import androidx.annotation.NonNull;
import org.signal.core.util.logging.Log;
import org.signal.ringrtc.CallException;
import org.signal.ringrtc.GroupCall;
import org.thoughtcrime.securesms.components.webrtc.EglBaseWrapper;
import org.thoughtcrime.securesms.events.WebRtcViewModel;
@@ -71,6 +72,13 @@ public class GroupNetworkUnavailableActionProcessor extends WebRtcActionProcesso
protected @NonNull WebRtcServiceState handleCancelPreJoinCall(@NonNull WebRtcServiceState currentState) {
Log.i(TAG, "handleCancelPreJoinCall():");
GroupCall groupCall = currentState.getCallInfoState().requireGroupCall();
try {
groupCall.disconnect();
} catch (CallException e) {
return groupCallFailure(currentState, "Unable to disconnect from group call", e);
}
WebRtcVideoUtil.deinitializeVideo(currentState);
EglBaseWrapper.releaseEglBase(RemotePeer.GROUP_CALL_ID.longValue());