// 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? {
// 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)