From edf4841371579062b89967550c96c43b3bb16141 Mon Sep 17 00:00:00 2001 From: ganfra Date: Wed, 9 Dec 2020 11:52:48 +0100 Subject: [PATCH] VoIP: in-app notif add content action --- .../main/java/im/vector/app/core/services/CallService.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/services/CallService.kt b/vector/src/main/java/im/vector/app/core/services/CallService.kt index 1b8345491b..9fb353736a 100644 --- a/vector/src/main/java/im/vector/app/core/services/CallService.kt +++ b/vector/src/main/java/im/vector/app/core/services/CallService.kt @@ -174,10 +174,11 @@ class CallService : VectorService(), WiredHeadsetStateReceiver.HeadsetEventListe matrixItem = opponentMatrixItem, avatarRenderer = avatarRenderer, isVideoCall = isVideoCall, - onAccept = { acceptIncomingCall(call) }, + onAccept = { showCallScreen(call, VectorCallActivity.INCOMING_ACCEPT) }, onReject = { call.endCall() } ) dismissedAction = Runnable { call.endCall() } + contentAction = Runnable { showCallScreen(call, VectorCallActivity.INCOMING_RINGING) } } alertManager.postVectorAlert(incomingCallAlert) } @@ -189,11 +190,11 @@ class CallService : VectorService(), WiredHeadsetStateReceiver.HeadsetEventListe startForeground(NOTIFICATION_ID, notification) } - private fun acceptIncomingCall(call: WebRtcCall){ + private fun showCallScreen(call: WebRtcCall, mode: String) { val intent = VectorCallActivity.newIntent( context = this, mxCall = call.mxCall, - mode = VectorCallActivity.INCOMING_ACCEPT + mode = mode ) startActivity(intent) }