Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set Foreground Service Behavior IMMEDIATE (WPB-5512) #3666

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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 @@ -23,6 +23,7 @@ import android.app.Notification
import android.content.Context
import android.service.notification.StatusBarNotification
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE
import androidx.core.app.NotificationManagerCompat
import com.wire.android.R
import com.wire.android.appLogger
Expand Down Expand Up @@ -199,6 +200,7 @@ class CallNotificationBuilder @Inject constructor(
.setOngoing(true)
.setSilent(true)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setForegroundServiceBehavior(FOREGROUND_SERVICE_IMMEDIATE )
.addAction(getHangUpCallAction(context, conversationIdString, userIdString))
.setFullScreenIntent(outgoingCallPendingIntent(context, conversationIdString), true)
.setContentIntent(outgoingCallPendingIntent(context, conversationIdString))
Expand Down Expand Up @@ -254,6 +256,7 @@ class CallNotificationBuilder @Inject constructor(
.setAutoCancel(true)
.setOngoing(true)
.setUsesChronometer(true)
.setForegroundServiceBehavior(FOREGROUND_SERVICE_IMMEDIATE)
.addAction(getHangUpCallAction(context, conversationIdString, userIdString))
.addAction(getOpenOngoingCallAction(context, conversationIdString))
.setFullScreenIntent(openOngoingCallPendingIntent(context, conversationIdString), true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class PersistentWebSocketService : Service() {
.setSmallIcon(R.drawable.websocket_notification_icon_small)
.setContentIntent(openAppPendingIntent(this))
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE)
.setAutoCancel(false)
.setOngoing(true)
.build()
Expand Down
Loading