2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-03 15:45:10 +00:00

fix channel names not being set when creating notification channels

This commit is contained in:
Wojciech M
2022-10-17 20:42:07 +02:00
parent 67e4b27915
commit 9af94884f9

View File

@@ -48,32 +48,32 @@ public class NotificationHelper {
public static void initializeChannels(Context context) { public static void initializeChannels(Context context) {
final NotificationChannelCompat persistentChannel = new NotificationChannelCompat final NotificationChannelCompat persistentChannel = new NotificationChannelCompat
.Builder(Channels.PERSISTENT, NotificationManagerCompat.IMPORTANCE_MIN) .Builder(Channels.PERSISTENT, NotificationManagerCompat.IMPORTANCE_MIN)
.setDescription(context.getString(R.string.notification_channel_persistent)) .setName(context.getString(R.string.notification_channel_persistent))
.build(); .build();
final NotificationChannelCompat defaultChannel = new NotificationChannelCompat final NotificationChannelCompat defaultChannel = new NotificationChannelCompat
.Builder(Channels.DEFAULT, NotificationManagerCompat.IMPORTANCE_DEFAULT) .Builder(Channels.DEFAULT, NotificationManagerCompat.IMPORTANCE_DEFAULT)
.setDescription(context.getString(R.string.notification_channel_default)) .setName(context.getString(R.string.notification_channel_default))
.build(); .build();
final NotificationChannelCompat mediaChannel = new NotificationChannelCompat final NotificationChannelCompat mediaChannel = new NotificationChannelCompat
.Builder(Channels.MEDIA_CONTROL, NotificationManagerCompat.IMPORTANCE_LOW) .Builder(Channels.MEDIA_CONTROL, NotificationManagerCompat.IMPORTANCE_LOW)
.setDescription(context.getString(R.string.notification_channel_media_control)) .setName(context.getString(R.string.notification_channel_media_control))
.build(); .build();
final NotificationChannelCompat fileTransferChannel = new NotificationChannelCompat final NotificationChannelCompat fileTransferChannel = new NotificationChannelCompat
.Builder(Channels.FILETRANSFER, NotificationManagerCompat.IMPORTANCE_LOW) .Builder(Channels.FILETRANSFER, NotificationManagerCompat.IMPORTANCE_LOW)
.setDescription(context.getString(R.string.notification_channel_filetransfer)) .setName(context.getString(R.string.notification_channel_filetransfer))
.setVibrationEnabled(false) .setVibrationEnabled(false)
.build(); .build();
final NotificationChannelCompat receiveNotificationChannel = new NotificationChannelCompat final NotificationChannelCompat receiveNotificationChannel = new NotificationChannelCompat
.Builder(Channels.RECEIVENOTIFICATION, NotificationManagerCompat.IMPORTANCE_DEFAULT) .Builder(Channels.RECEIVENOTIFICATION, NotificationManagerCompat.IMPORTANCE_DEFAULT)
.setDescription(context.getString(R.string.notification_channel_receivenotification)) .setName(context.getString(R.string.notification_channel_receivenotification))
.build(); .build();
final NotificationChannelCompat smsMmsChannel = new NotificationChannelCompat final NotificationChannelCompat smsMmsChannel = new NotificationChannelCompat
.Builder(Channels.SMS_MMS, NotificationManagerCompat.IMPORTANCE_DEFAULT) .Builder(Channels.SMS_MMS, NotificationManagerCompat.IMPORTANCE_DEFAULT)
.setDescription(context.getString(R.string.notification_channel_sms_mms)) .setName(context.getString(R.string.notification_channel_sms_mms))
.build(); .build();
final NotificationChannelCompat highPriorityChannel = new NotificationChannelCompat final NotificationChannelCompat highPriorityChannel = new NotificationChannelCompat
.Builder(Channels.HIGHPRIORITY, NotificationManagerCompat.IMPORTANCE_HIGH) .Builder(Channels.HIGHPRIORITY, NotificationManagerCompat.IMPORTANCE_HIGH)
.setDescription(context.getString(R.string.notification_channel_high_priority)) .setName(context.getString(R.string.notification_channel_high_priority))
.build(); .build();
final List<NotificationChannelCompat> channels = Arrays.asList(persistentChannel, final List<NotificationChannelCompat> channels = Arrays.asList(persistentChannel,