X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacycell%2Fservices%2FRealtimeMonitoringService.kt;h=19e1a3e2cede164c571b6dbc4558801bd5108979;hb=bad17a63b18ff3c8b5ae24ab467f423bbfbddd98;hp=c54e290813c07abd015b1f3d0443dc7afdc45317;hpb=6c4410a4a8c146b4e76b872b66bb8880b8f85b71;p=PrivacyCell.git diff --git a/app/src/main/java/com/stoutner/privacycell/services/RealtimeMonitoringService.kt b/app/src/main/java/com/stoutner/privacycell/services/RealtimeMonitoringService.kt index c54e290..19e1a3e 100644 --- a/app/src/main/java/com/stoutner/privacycell/services/RealtimeMonitoringService.kt +++ b/app/src/main/java/com/stoutner/privacycell/services/RealtimeMonitoringService.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2022 Soren Stoutner . + * Copyright 2021-2022 Soren Stoutner . * * This file is part of Privacy Cell . * @@ -148,6 +148,9 @@ class RealtimeMonitoringService : Service() { // Set the color. notificationBuilder.setColor(getColor(R.color.red_notification_icon)) + // Prevent swiping to dismiss the notification. + notificationBuilder.setOngoing(true) + // Start the foreground notification. startForeground(NOTIFICATION_ID, notificationBuilder.build()) @@ -251,6 +254,9 @@ class RealtimeMonitoringService : Service() { // Set the color. antiquatedNetworkNotificationBuilder.setColor(getColor(R.color.red_notification_icon)) + // Prevent swiping to dismiss the notification. + antiquatedNetworkNotificationBuilder.setOngoing(true) + // Update the notification. notificationManager.notify(NOTIFICATION_ID, antiquatedNetworkNotificationBuilder.build()) @@ -275,6 +281,9 @@ class RealtimeMonitoringService : Service() { // Set the color. insecureNetworkNotificationBuilder.setColor(getColor(R.color.yellow_notification_icon)) + // Prevent swiping to dismiss the notification. + insecureNetworkNotificationBuilder.setOngoing(true) + // Update the notification. notificationManager.notify(NOTIFICATION_ID, insecureNetworkNotificationBuilder.build()) @@ -299,6 +308,9 @@ class RealtimeMonitoringService : Service() { // Set the color. secureNetworkNotificationBuilder.setColor(getColor(R.color.blue_icon)) + // Prevent swiping to dismiss the notification. + secureNetworkNotificationBuilder.setOngoing(true) + // Update the notification. notificationManager.notify(NOTIFICATION_ID, secureNetworkNotificationBuilder.build()) @@ -307,4 +319,4 @@ class RealtimeMonitoringService : Service() { } } } -} \ No newline at end of file +}