mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-21 01:05:11 +01:00
Ensure intent and deny call command are properly handled in the activity.
This commit is contained in:
+5
-3
@@ -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()
|
||||
}
|
||||
|
||||
+8
@@ -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);
|
||||
|
||||
+7
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user