Start call service as foreground for notification actions.

fork-5.53.8
Cody Henthorne 2021-04-05 16:09:04 -04:00
rodzic b8cbcfe986
commit 2218fc0d41
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -112,7 +112,8 @@ public class CallNotificationBuilder {
}
private static NotificationCompat.Action getServiceNotificationAction(Context context, Intent intent, int iconResId, int titleResId) {
PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0);
PendingIntent pendingIntent = Build.VERSION.SDK_INT >= 26 ? PendingIntent.getForegroundService(context, 0, intent, 0)
: PendingIntent.getService(context, 0, intent, 0);
return new NotificationCompat.Action(iconResId, context.getString(titleResId), pendingIntent);
}