diff options
Diffstat (limited to 'app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java')
-rw-r--r-- | app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java b/app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java index 767586a..86c9f86 100644 --- a/app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java +++ b/app/src/main/java/se/lublin/mumla/service/MumlaReconnectNotification.java @@ -19,6 +19,7 @@ package se.lublin.mumla.service; import static android.app.PendingIntent.FLAG_CANCEL_CURRENT; import static android.app.PendingIntent.FLAG_IMMUTABLE; +import static android.content.Context.RECEIVER_NOT_EXPORTED; import android.app.NotificationChannel; import android.app.NotificationManager; @@ -81,7 +82,11 @@ public class MumlaReconnectNotification { filter.addAction(BROADCAST_RECONNECT); filter.addAction(BROADCAST_CANCEL_RECONNECT); try { - mContext.registerReceiver(mNotificationReceiver, filter); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + mContext.registerReceiver(mNotificationReceiver, filter, RECEIVER_NOT_EXPORTED); + } else { + mContext.registerReceiver(mNotificationReceiver, filter); + } } catch (IllegalArgumentException e) { // Thrown if receiver is already registered. e.printStackTrace(); |