X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyCell.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacycell%2Fservices%2FRealtimeMonitoringService.kt;h=663c178016e701f2ea4650feb72745cc93b53dad;hp=dc5b49483425cc043c238790452d5d48c4899259;hb=08d7a49066e6a6c62d9a2035686e50597b231336;hpb=976d7da4c16f9ddc87f0cd7c67cd2eefc9f260b1 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 dc5b494..663c178 100644 --- a/app/src/main/java/com/stoutner/privacycell/services/RealtimeMonitoringService.kt +++ b/app/src/main/java/com/stoutner/privacycell/services/RealtimeMonitoringService.kt @@ -44,6 +44,7 @@ class RealtimeMonitoringService : Service() { // Define the public constants. const val SECURE_NETWORK = "secure_network" const val INSECURE_NETWORK = "insecure_network" + const val UNKNOWN_NETWORK = "unknown_network" } override fun onBind(intent: Intent?): IBinder? { @@ -61,25 +62,29 @@ class RealtimeMonitoringService : Service() { // Prepare the notification channels. val secureNetworkChannel = NotificationChannel(SECURE_NETWORK, getString(R.string.secure_network_channel), NotificationManager.IMPORTANCE_DEFAULT) val insecureNetworkChannel = NotificationChannel(INSECURE_NETWORK, getString(R.string.insecure_network_channel), NotificationManager.IMPORTANCE_DEFAULT) + val unknownNetworkChannel = NotificationChannel(UNKNOWN_NETWORK, getString(R.string.unknown_network_channel), NotificationManager.IMPORTANCE_LOW) // Set the notification channel group. secureNetworkChannel.group = REALTIME_MONITORING insecureNetworkChannel.group = REALTIME_MONITORING + unknownNetworkChannel.group = REALTIME_MONITORING // Disable the notification dots. secureNetworkChannel.setShowBadge(false) insecureNetworkChannel.setShowBadge(false) + unknownNetworkChannel.setShowBadge(false) - // Set the notifications to be public. + // Set the notifications to be public for the secure and insecure networks. secureNetworkChannel.lockscreenVisibility = Notification.VISIBILITY_PUBLIC insecureNetworkChannel.lockscreenVisibility = Notification.VISIBILITY_PUBLIC // Create the notification channels. notificationManager.createNotificationChannel(secureNetworkChannel) notificationManager.createNotificationChannel(insecureNetworkChannel) + notificationManager.createNotificationChannel(unknownNetworkChannel) // Create a notification builder. - val notificationBuilder = Notification.Builder(this, INSECURE_NETWORK) + val notificationBuilder = Notification.Builder(this, UNKNOWN_NETWORK) // Create an intent to open Privacy Cell. val privacyCellIntent = Intent(this, PrivacyCellActivity::class.java)