Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
27568eb
feat: Forward push payload to our notification sdk
rahul-lohra Jul 28, 2025
f013c8a
Merge branch 'develop' into feature/rahullohra/push-payload-downstream
rahul-lohra Jul 28, 2025
77ebf87
feat: Fix compile time
rahul-lohra Jul 28, 2025
0a75117
feat: replace DeprecationLevel.ERROR with DeprecationLevel.WARNING,
rahul-lohra Jul 28, 2025
30f2caf
feat: remove unnecessary apis,
rahul-lohra Jul 28, 2025
5f404f7
Merge branch 'develop' into feature/rahullohra/push-payload-downstream
rahul-lohra Jul 28, 2025
d3b308a
feat: update deprecation message
rahul-lohra Jul 28, 2025
d309f4a
feat: remove unnecessary code
rahul-lohra Jul 28, 2025
18de591
feat: refactor code
rahul-lohra Jul 28, 2025
774d32e
Merge branch 'develop' into feature/rahullohra/push-payload-downstream
aleksandar-apostolov Jul 29, 2025
6d33678
feat: Allow customization of Pending intent
rahul-lohra Jul 31, 2025
bf3dadc
fix: Fix UTs
rahul-lohra Jul 31, 2025
e25203c
fix: Update logic to reject class via notification buttons
rahul-lohra Aug 1, 2025
c80899d
fix: Refactor code
rahul-lohra Aug 1, 2025
48ffdd2
fix: Refactor code
rahul-lohra Aug 1, 2025
ae3ec9d
Merge branch 'develop' into feature/rahullohra/handle-call-reject-on-…
rahul-lohra Aug 1, 2025
f9a2d93
Merge branch 'develop' into feature/rahullohra/handle-call-reject-on-…
aleksandar-apostolov Aug 1, 2025
f755649
fix: Pass rejection intent via call state
rahul-lohra Aug 1, 2025
8b867d1
Merge branch 'develop' into feature/rahullohra/handle-call-reject-on-…
aleksandar-apostolov Aug 1, 2025
96e4481
temp commit
rahul-lohra Aug 1, 2025
df6b078
temp commit
rahul-lohra Aug 1, 2025
8764c16
temp commit
rahul-lohra Aug 1, 2025
e14a2a9
removed isInTransition
rahul-lohra Aug 1, 2025
97c9d95
Remove comments
rahul-lohra Aug 1, 2025
4c8bf45
Refactor code
rahul-lohra Aug 1, 2025
355fafb
Refactor code
rahul-lohra Aug 1, 2025
3f49b5f
Refactor code
rahul-lohra Aug 1, 2025
7574eea
Refactor code
rahul-lohra Aug 1, 2025
8c63540
Refactor code
rahul-lohra Aug 1, 2025
aa22bd8
Merge remote-tracking branch 'origin/feature/rahullohra/handle-call-r…
rahul-lohra Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import io.getstream.video.android.datastore.delegate.StreamUserDataStore
import io.getstream.video.android.ui.call.CallScreen
import io.getstream.video.android.ui.common.StreamActivityUiDelegate
import io.getstream.video.android.ui.common.StreamCallActivity
import io.getstream.video.android.ui.common.StreamCallActivityConfiguration
import io.getstream.video.android.ui.common.util.StreamCallActivityDelicateApi
import io.getstream.video.android.util.FullScreenCircleProgressBar
import io.getstream.video.android.util.StreamVideoInitHelper
Expand All @@ -48,11 +47,6 @@ class CallActivity : ComposeStreamCallActivity() {

override val uiDelegate: StreamActivityUiDelegate<StreamCallActivity> = StreamDemoUiDelegate()

override fun loadConfigFromIntent(intent: Intent?): StreamCallActivityConfiguration {
return super.loadConfigFromIntent(intent)
.copy(closeScreenOnCallEnded = false, canSkipPermissionRationale = false)
}

@StreamCallActivityDelicateApi
override fun onPreCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
runBlocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import androidx.navigation.navArgument
import io.getstream.video.android.CallActivity
import io.getstream.video.android.core.notifications.NotificationHandler
import io.getstream.video.android.ui.common.StreamCallActivity
import io.getstream.video.android.ui.common.StreamCallActivityConfiguration
import io.getstream.video.android.ui.join.CallJoinScreen
import io.getstream.video.android.ui.join.barcode.BarcodeScanner
import io.getstream.video.android.ui.lobby.CallLobbyScreen
Expand Down Expand Up @@ -94,6 +95,10 @@ fun AppNavHost(
context.startActivity(
StreamCallActivity.callIntent(
action = NotificationHandler.ACTION_OUTGOING_CALL,
configuration = StreamCallActivityConfiguration(
closeScreenOnCallEnded = true,
),
leaveWhenLastInCall = true,
context = context,
cid = cid,
members = members.split(","),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,20 @@ object StreamVideoInitHelper {
context,
object : DefaultNotificationIntentBundleResolver() {

override fun getIncomingCallBundle(
callId: StreamCallId,
notificationId: Int,
payload: Map<String, Any?>,
): Bundle {
return StreamCallActivity.callIntentBundle(
callId,
configuration = StreamCallActivityConfiguration(
closeScreenOnCallEnded = true,
),
leaveWhenLastInCall = true,
)
}

override fun getAcceptCallBundle(
callId: StreamCallId,
notificationId: Int,
Expand Down
2 changes: 2 additions & 0 deletions stream-video-android-core/api/stream-video-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -5610,6 +5610,7 @@ public final class io/getstream/video/android/core/CallState {
public final fun getPinnedParticipants ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getReactions ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getRecording ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getRejectActionBundle ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getRejectedBy ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getRemoteParticipants ()Lkotlinx/coroutines/flow/StateFlow;
public final fun getRingingState ()Lkotlinx/coroutines/flow/StateFlow;
Expand Down Expand Up @@ -5647,6 +5648,7 @@ public final class io/getstream/video/android/core/CallState {
public final fun updateParticipantSortingOrder (Ljava/util/Comparator;)V
public final fun updateParticipantVisibility (Ljava/lang/String;Lio/getstream/video/android/core/model/VisibilityOnScreenState;)V
public final fun updateParticipantVisibilityFlow (Lkotlinx/coroutines/flow/Flow;)V
public final fun updateRejectActionBundle (Landroid/os/Bundle;)V
public final fun updateRejectedBy (Ljava/util/Set;)V
public final fun upsertParticipants (Ljava/util/List;)V
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public class Call(
)
session.fastReconnect(reconnectDetails)
} else {
logger.e { "[reconnect] Disconnecting" }
logger.d { "[fastReconnect] [RealtimeConnection.Disconnected], call_id:$id" }
this@Call.state._connection.value = RealtimeConnection.Disconnected
}
}
Expand Down Expand Up @@ -767,18 +767,19 @@ public class Call(

/** Leave the call, but don't end it for other users */
fun leave() {
logger.d { "[leave] #ringing; no args" }
logger.d { "[leave] #ringing; no args, call_cid:$cid" }
leave(disconnectionReason = null)
}

private fun leave(disconnectionReason: Throwable?) = atomicLeave {
val callId = id
session?.leaveWithReason(disconnectionReason?.message ?: "user")
leaveTimeoutAfterDisconnect?.cancel()
network.unsubscribe(listener)
sfuListener?.cancel()
sfuEvents?.cancel()
state._connection.value = RealtimeConnection.Disconnected
logger.v { "[leave] #ringing; disconnectionReason: $disconnectionReason" }
logger.v { "[leave] #ringing; disconnectionReason: $disconnectionReason, call_id = $id" }
if (isDestroyed) {
logger.w { "[leave] #ringing; Call already destroyed, ignoring" }
return@atomicLeave
Expand Down Expand Up @@ -1318,7 +1319,7 @@ public class Call(
}

suspend fun accept(): Result<AcceptCallResponse> {
logger.d { "[accept] #ringing; no args" }
logger.d { "[accept] #ringing; no args, call_id:$id" }
state.acceptedOnThisDevice = true

clientImpl.state.removeRingingCall()
Expand All @@ -1327,7 +1328,7 @@ public class Call(
}

suspend fun reject(reason: RejectReason? = null): Result<RejectCallResponse> {
logger.d { "[reject] #ringing; rejectReason: $reason" }
logger.d { "[reject] #ringing; rejectReason: $reason, call_id:$id" }
return clientImpl.reject(type, id, reason)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.getstream.video.android.core

import android.os.Bundle
import android.util.Log
import androidx.compose.runtime.Stable
import io.getstream.android.video.generated.models.BlockedUserEvent
Expand Down Expand Up @@ -548,6 +549,9 @@ public class CallState(
private val _rejectedBy: MutableStateFlow<Set<String>> = MutableStateFlow(emptySet())
val rejectedBy: StateFlow<Set<String>> = _rejectedBy

private val _rejectActionBundle: MutableStateFlow<Bundle?> = MutableStateFlow(null)
val rejectActionBundle: StateFlow<Bundle?> = _rejectActionBundle

internal val _session = MutableStateFlow<CallSessionResponse?>(null)
val session: StateFlow<CallSessionResponse?> = _session

Expand Down Expand Up @@ -1529,6 +1533,10 @@ public class CallState(
fun updateRejectedBy(userId: Set<String>) {
_rejectedBy.value = userId
}

fun updateRejectActionBundle(bundle: Bundle) {
_rejectActionBundle.value = bundle
}
}

private fun MemberResponse.toMemberState(): MemberState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ public class RtcSession internal constructor(
WebsocketReconnectStrategy.WEBSOCKET_RECONNECT_STRATEGY_DISCONNECT -> {
// We are told to disconnect.
sfuConnectionModule.socketConnection.disconnect()
logger.d {
"[WebsocketReconnectStrategy.WEBSOCKET_RECONNECT_STRATEGY_DISCONNECT], call_id = ${call.id}"
}
call.state._connection.value = RealtimeConnection.Disconnected
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package io.getstream.video.android.core.notifications.internal.receivers

import android.content.Context
import android.content.Intent
import android.os.Bundle
import io.getstream.log.taggedLogger
import io.getstream.result.Result
import io.getstream.video.android.core.Call
Expand All @@ -39,8 +40,18 @@ internal class RejectCallBroadcastReceiver : GenericCallActionBroadcastReceiver(

override suspend fun onReceive(call: Call, context: Context, intent: Intent) {
when (val rejectResult = call.reject(RejectReason.Decline)) {
is Result.Success -> logger.d { "[onReceive] rejectCall, Success: $rejectResult" }
is Result.Failure -> logger.d { "[onReceive] rejectCall, Failure: $rejectResult" }
is Result.Success -> {
val userId = StreamVideo.instanceOrNull()?.userId
userId?.let {
val set = mutableSetOf(it)
call.state.updateRejectedBy(set)
call.state.updateRejectActionBundle(intent.extras ?: Bundle())
}
logger.d { "[onReceive] rejectCall, Success: $rejectResult" }
}
is Result.Failure -> {
logger.d { "[onReceive] rejectCall, Failure: $rejectResult" }
}
}
logger.d { "[onReceive] #ringing; callId: ${call.id}, action: ${intent.action}" }
CallService.removeIncomingCall(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ public class io/getstream/video/android/compose/ui/StreamCallActivityComposeDele
public fun AudioCallContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Landroidx/compose/runtime/Composer;I)V
public fun CallDisconnectedContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Landroidx/compose/runtime/Composer;I)V
public fun CallFailedContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Ljava/lang/Exception;Landroidx/compose/runtime/Composer;I)V
public fun HandleCallRejectionFromNotification (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Landroidx/compose/runtime/Composer;I)V
public fun IncomingCallContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Landroidx/compose/ui/Modifier;Lio/getstream/video/android/core/Call;ZZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function5;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V
public fun LoadingContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Landroidx/compose/runtime/Composer;I)V
public fun NoAnswerContent (Lio/getstream/video/android/ui/common/StreamCallActivity;Lio/getstream/video/android/core/Call;Landroidx/compose/runtime/Composer;I)V
Expand Down
Loading
Loading