Commit f294d763 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[Reveivenotification] Put notifications into own channel

Summary:
This allows for more fine-grained control.
CCBUG: 402488

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17787
parent 54b2a20b
......@@ -323,5 +323,6 @@
<string name="new_notification">New notification</string>
<string name="block_contents">Block contents of notifications</string>
<string name="block_images">Block images in notifications</string>
<string name="notification_channel_receivenotification">Notifications from other devices</string>
</resources>
......@@ -17,6 +17,7 @@ public class NotificationHelper {
public final static String DEFAULT = "default";
public final static String MEDIA_CONTROL = "media_control";
public final static String FILETRANSFER = "filetransfer";
public final static String RECEIVENOTIFICATION = "receive";
}
public static void notifyCompat(NotificationManager notificationManager, int notificationId, Notification notification) {
......@@ -73,6 +74,12 @@ public class NotificationHelper {
manager.createNotificationChannel(fileTransfer);
manager.createNotificationChannel(new NotificationChannel(
Channels.RECEIVENOTIFICATION,
context.getString(R.string.notification_channel_receivenotification),
NotificationManager.IMPORTANCE_DEFAULT)
);
}
......
......@@ -105,7 +105,7 @@ public class ReceiveNotificationsPlugin extends Plugin {
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification noti = new NotificationCompat.Builder(context, NotificationHelper.Channels.DEFAULT)
Notification noti = new NotificationCompat.Builder(context, NotificationHelper.Channels.RECEIVENOTIFICATION)
.setContentTitle(np.getString("appName"))
.setContentText(np.getString("ticker"))
.setContentIntent(resultPendingIntent)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment