diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/v2/WebRtcCallActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/v2/WebRtcCallActivity.kt index a1408c9554..b20457eb37 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/v2/WebRtcCallActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/v2/WebRtcCallActivity.kt @@ -289,9 +289,11 @@ class WebRtcCallActivity : BaseActivity(), SafetyNumberChangeDialog.Callback, Re } override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + setIntent(intent) + val callIntent = getCallIntent() Log.i(TAG, "onNewIntent(${callIntent.isStartedFromFullScreen})") - super.onNewIntent(intent) logIntent(callIntent) processIntent(callIntent) } @@ -309,8 +311,8 @@ class WebRtcCallActivity : BaseActivity(), SafetyNumberChangeDialog.Callback, Re if (!callPermissionsDialogController.isAskingForPermission && !viewModel.isCallStarting && !isChangingConfigurations) { val state = viewModel.callParticipantsStateSnapshot if (state.callState.isPreJoinOrNetworkUnavailable || (Build.VERSION.SDK_INT >= 27 && state.callState.isIncomingOrHandledElsewhere)) { - if (getCallIntent().isStartedFromFullScreen && state.callState == WebRtcViewModel.State.CALL_INCOMING) { - Log.w(TAG, "Pausing during full-screen incoming call view. Refusing to finish.") + if (state.callState == WebRtcViewModel.State.CALL_INCOMING) { + Log.w(TAG, "Pausing during incoming call view. Refusing to finish.") } else { finish() } diff --git a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingCallActionProcessor.java b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingCallActionProcessor.java index c17fc2261f..621bb9160b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingCallActionProcessor.java +++ b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingCallActionProcessor.java @@ -215,6 +215,14 @@ public class IncomingCallActionProcessor extends DeviceAwareActionProcessor { try { webRtcInteractor.rejectIncomingCall(activePeer.getId()); webRtcInteractor.getCallManager().hangup(); + + currentState = currentState.builder() + .changeCallInfoState() + .callState(WebRtcViewModel.State.CALL_DISCONNECTED) + .build(); + + webRtcInteractor.postStateUpdate(currentState); + return terminate(currentState, activePeer); } catch (CallException e) { return callFailure(currentState, "hangup() failed: ", e); diff --git a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingGroupCallActionProcessor.java b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingGroupCallActionProcessor.java index af94328d9a..e70f4984f7 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingGroupCallActionProcessor.java +++ b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingGroupCallActionProcessor.java @@ -325,6 +325,13 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro currentState = WebRtcVideoUtil.deinitializeVideo(currentState); EglBaseWrapper.releaseEglBase(RemotePeer.GROUP_CALL_ID.longValue()); + currentState = currentState.builder() + .changeCallInfoState() + .callState(WebRtcViewModel.State.CALL_DISCONNECTED) + .build(); + + webRtcInteractor.postStateUpdate(currentState); + return currentState.builder() .actionProcessor(new IdleActionProcessor(webRtcInteractor)) .terminate(RemotePeer.GROUP_CALL_ID)