mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-08 01:55:08 +00:00
Introduced NotificationHelper
This commit is contained in:
25
src/org/kde/kdeconnect/Helpers/NotificationHelper.java
Normal file
25
src/org/kde/kdeconnect/Helpers/NotificationHelper.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package org.kde.kdeconnect.Helpers;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
|
||||
public class NotificationHelper {
|
||||
|
||||
public static void notifyCompat(NotificationManager notificationManager, int notificationId, Notification notification) {
|
||||
try {
|
||||
notificationManager.notify(notificationId, notification);
|
||||
} catch(Exception e) {
|
||||
//4.1 will throw an exception about not having the VIBRATE permission, ignore it.
|
||||
//https://android.googlesource.com/platform/frameworks/base/+/android-4.2.1_r1.2%5E%5E!/
|
||||
}
|
||||
}
|
||||
|
||||
public static void notifyCompat(NotificationManager notificationManager, String tag, int notificationId, Notification notification) {
|
||||
try {
|
||||
notificationManager.notify(tag, notificationId, notification);
|
||||
} catch(Exception e) {
|
||||
//4.1 will throw an exception about not having the VIBRATE permission, ignore it.
|
||||
//https://android.googlesource.com/platform/frameworks/base/+/android-4.2.1_r1.2%5E%5E!/
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user