mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-29 13:17:43 +00:00
Fix crash when user tries to unload plugin, which is not supported by platform.
This commit is contained in:
parent
a0a9eca060
commit
4fd96062f6
@ -116,7 +116,9 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCreate() {
|
public boolean onCreate() {
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT < 18) return false;
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//Check for permissions
|
//Check for permissions
|
||||||
String notificationListenerList = Settings.Secure.getString(context.getContentResolver(), "enabled_notification_listeners");
|
String notificationListenerList = Settings.Secure.getString(context.getContentResolver(), "enabled_notification_listeners");
|
||||||
@ -146,6 +148,11 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
NotificationReceiver.RunCommand(context, new NotificationReceiver.InstanceCallback() {
|
NotificationReceiver.RunCommand(context, new NotificationReceiver.InstanceCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onServiceStart(NotificationReceiver service) {
|
public void onServiceStart(NotificationReceiver service) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user