Ensure intent and deny call command are properly handled in the activity.

This commit is contained in:
Alex Hart
2026-08-24 15:49:31 -03:00
parent 4b7fbeba72
commit 3105469328
3 changed files with 20 additions and 3 deletions
@@ -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()
}
@@ -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);
@@ -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)