diff --git a/app/src/main/java/io/homeassistant/companion/android/websocket/WebsocketManager.kt b/app/src/main/java/io/homeassistant/companion/android/websocket/WebsocketManager.kt index edcc65d8a92..b38d240cf38 100644 --- a/app/src/main/java/io/homeassistant/companion/android/websocket/WebsocketManager.kt +++ b/app/src/main/java/io/homeassistant/companion/android/websocket/WebsocketManager.kt @@ -215,16 +215,12 @@ class WebsocketManager( */ private suspend fun createNotification(): Boolean { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - var notificationChannel = - notificationManager.getNotificationChannel(CHANNEL_WEBSOCKET) - if (notificationChannel == null) { - notificationChannel = NotificationChannel( - CHANNEL_WEBSOCKET, - applicationContext.getString(R.string.websocket_setting_name), - NotificationManager.IMPORTANCE_LOW - ) - notificationManager.createNotificationChannel(notificationChannel) - } + val notificationChannel = NotificationChannel( + CHANNEL_WEBSOCKET, + applicationContext.getString(R.string.websocket_setting_name), + NotificationManager.IMPORTANCE_LOW + ) + notificationManager.createNotificationChannel(notificationChannel) } val intent = WebViewActivity.newInstance(applicationContext) diff --git a/common/src/main/java/io/homeassistant/companion/android/common/notifications/NotificationFunctions.kt b/common/src/main/java/io/homeassistant/companion/android/common/notifications/NotificationFunctions.kt index 774f615d5c0..689cdec59fc 100755 --- a/common/src/main/java/io/homeassistant/companion/android/common/notifications/NotificationFunctions.kt +++ b/common/src/main/java/io/homeassistant/companion/android/common/notifications/NotificationFunctions.kt @@ -75,7 +75,7 @@ fun handleChannel( ): String { // Define some values for a default channel var channelID = CHANNEL_GENERAL - var channelName = "General" + var channelName = context.getString(R.string.general) if (!data[NotificationData.CHANNEL].isNullOrEmpty()) { channelID = createChannelID(data[NotificationData.CHANNEL].toString()) diff --git a/common/src/main/java/io/homeassistant/companion/android/common/sensors/SensorWorkerBase.kt b/common/src/main/java/io/homeassistant/companion/android/common/sensors/SensorWorkerBase.kt index db4dbc7b9df..3a412ae00e7 100644 --- a/common/src/main/java/io/homeassistant/companion/android/common/sensors/SensorWorkerBase.kt +++ b/common/src/main/java/io/homeassistant/companion/android/common/sensors/SensorWorkerBase.kt @@ -92,16 +92,12 @@ abstract class SensorWorkerBase( protected fun createNotificationChannel() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - var notificationChannel = - notificationManager.getNotificationChannel(CHANNEL_SENSOR_WORKER) - if (notificationChannel == null) { - notificationChannel = NotificationChannel( - CHANNEL_SENSOR_WORKER, - TAG, - NotificationManager.IMPORTANCE_LOW - ) - notificationManager.createNotificationChannel(notificationChannel) - } + val notificationChannel = NotificationChannel( + CHANNEL_SENSOR_WORKER, + appContext.getString(commonR.string.sensor_updates), + NotificationManager.IMPORTANCE_LOW + ) + notificationManager.createNotificationChannel(notificationChannel) } } } diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 464c458a551..2b5d3c99ebd 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1313,4 +1313,6 @@ Total steps taken since midnight from Health Connect Blood glucose Last recorded blood glucose reading in milligrams per deciliter from Health Connect + General + Sensor updates