Restart the activity if an incoming call comes in after a network failure.

This commit is contained in:
Alex Hart 2025-01-22 09:45:09 -04:00
parent 5034effbf0
commit 4a9196abf8

View file

@ -936,12 +936,23 @@ public class WebRtcCallActivity extends BaseActivity implements SafetyNumberChan
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN)
public void onEventMainThread(@NonNull WebRtcViewModel event) {
Log.i(TAG, "Got message from service: " + event.describeDifference(previousEvent));
WebRtcViewModel.State previousCallState = previousEvent != null ? previousEvent.getState() : null;
previousEvent = event;
viewModel.setRecipient(event.getRecipient());
controlsAndInfoViewModel.setRecipient(event.getRecipient());
switch (event.getState()) {
case CALL_INCOMING:
if (previousCallState == WebRtcViewModel.State.NETWORK_FAILURE) {
Log.d(TAG, "Incoming call directly from network failure state. Recreating activity.");
recreate();
return;
}
break;
case CALL_PRE_JOIN:
handleCallPreJoin(event); break;
case CALL_CONNECTED: