Start call service as foreground for notification actions.
This commit is contained in:
parent
b8cbcfe986
commit
2218fc0d41
1 changed files with 2 additions and 1 deletions
|
@ -112,7 +112,8 @@ public class CallNotificationBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static NotificationCompat.Action getServiceNotificationAction(Context context, Intent intent, int iconResId, int titleResId) {
|
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);
|
return new NotificationCompat.Action(iconResId, context.getString(titleResId), pendingIntent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue