Fix dangling call notification and remove active call manager flag.

This commit is contained in:
Cody Henthorne
2024-04-12 09:36:11 -04:00
parent 09404157aa
commit eefc86f27e
9 changed files with 110 additions and 534 deletions

View File

@@ -18,7 +18,7 @@ import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.WebRtcCallActivity;
import org.thoughtcrime.securesms.notifications.NotificationChannels;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.service.webrtc.WebRtcCallService;
import org.thoughtcrime.securesms.service.webrtc.ActiveCallManager;
import org.thoughtcrime.securesms.util.ConversationUtil;
/**
@@ -29,8 +29,8 @@ import org.thoughtcrime.securesms.util.ConversationUtil;
public class CallNotificationBuilder {
public static final int WEBRTC_NOTIFICATION = 313388;
private static final int WEBRTC_NOTIFICATION_RINGING = 313389;
public static final int WEBRTC_NOTIFICATION = 313388;
public static final int WEBRTC_NOTIFICATION_RINGING = 313389;
public static final int TYPE_INCOMING_RINGING = 1;
public static final int TYPE_OUTGOING_RINGING = 2;
@@ -114,7 +114,7 @@ public class CallNotificationBuilder {
if (deviceVersionSupportsIncomingCallStyle()) {
builder.setStyle(NotificationCompat.CallStyle.forIncomingCall(
person,
WebRtcCallService.denyCallIntent(context),
ActiveCallManager.denyCallIntent(context),
getActivityPendingIntent(context, isVideoCall ? LaunchCallScreenIntentState.VIDEO : LaunchCallScreenIntentState.AUDIO)
).setIsVideo(isVideoCall));
}
@@ -122,7 +122,7 @@ public class CallNotificationBuilder {
return builder.build();
} else if (type == TYPE_OUTGOING_RINGING) {
builder.setContentText(context.getString(R.string.NotificationBarManager__establishing_signal_call));
builder.addAction(getServiceNotificationAction(context, WebRtcCallService.hangupIntent(context), R.drawable.symbol_phone_down_fill_24, R.string.NotificationBarManager__cancel_call));
builder.addAction(getServiceNotificationAction(context, ActiveCallManager.hangupIntent(context), R.drawable.symbol_phone_down_fill_24, R.string.NotificationBarManager__cancel_call));
return builder.build();
} else {
builder.setContentText(getOngoingCallContentText(context, recipient, isVideoCall));
@@ -138,7 +138,7 @@ public class CallNotificationBuilder {
if (deviceVersionSupportsIncomingCallStyle()) {
builder.setStyle(NotificationCompat.CallStyle.forOngoingCall(
person,
WebRtcCallService.hangupIntent(context)
ActiveCallManager.hangupIntent(context)
).setIsVideo(isVideoCall));
}

View File

@@ -12,9 +12,8 @@ import org.thoughtcrime.securesms.util.ParcelUtil
* Commands that can be issued to [SignalAudioManager] to perform various tasks.
*
* Additional context: The audio management is tied closely with the Android audio and thus benefits from being
* tied to the [org.thoughtcrime.securesms.service.webrtc.WebRtcCallService] lifecycle. Because of this, all
* calls have to go through an intent to the service and this allows one entry point for that but multiple
* operations.
* tied to the [org.thoughtcrime.securesms.service.webrtc.ActiveCallManager] lifecycle. Because of this, all
* calls have to go through it and this allows one entry point for that but multiple operations.
*/
sealed class AudioManagerCommand : Parcelable {