mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-07 17:45:09 +00:00
26 lines
1.0 KiB
Java
26 lines
1.0 KiB
Java
![]() |
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!/
|
||
|
}
|
||
|
}
|
||
|
}
|