From cfa5461b7dc3fd29e670ee817d3bdc44a65fa56e Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 19 Jun 2024 10:40:10 +0200 Subject: [PATCH] Notification channels: No need to include the version in the constant name. --- .../impl/notifications/channels/NotificationChannels.kt | 6 +++--- .../impl/notifications/channels/NotificationChannelsTest.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/channels/NotificationChannels.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/channels/NotificationChannels.kt index 4421dd3d3d..cb3a59cb1a 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/channels/NotificationChannels.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/notifications/channels/NotificationChannels.kt @@ -40,7 +40,7 @@ import javax.inject.Inject * ========================================================================================== */ internal const val SILENT_NOTIFICATION_CHANNEL_ID = "DEFAULT_SILENT_NOTIFICATION_CHANNEL_ID_V2" internal const val NOISY_NOTIFICATION_CHANNEL_ID = "DEFAULT_NOISY_NOTIFICATION_CHANNEL_ID" -internal const val CALL_NOTIFICATION_CHANNEL_ID_V3 = "CALL_NOTIFICATION_CHANNEL_ID_V3" +internal const val CALL_NOTIFICATION_CHANNEL_ID = "CALL_NOTIFICATION_CHANNEL_ID_V3" internal const val RINGING_CALL_NOTIFICATION_CHANNEL_ID = "RINGING_CALL_NOTIFICATION_CHANNEL_ID" /** @@ -154,7 +154,7 @@ class DefaultNotificationChannels @Inject constructor( // Register a channel for incoming and in progress call notifications with no ringing notificationManager.createNotificationChannel( NotificationChannel( - CALL_NOTIFICATION_CHANNEL_ID_V3, + CALL_NOTIFICATION_CHANNEL_ID, stringProvider.getString(R.string.notification_channel_call).ifEmpty { "Call" }, NotificationManager.IMPORTANCE_HIGH ) @@ -191,7 +191,7 @@ class DefaultNotificationChannels @Inject constructor( } override fun getChannelForIncomingCall(ring: Boolean): String { - return if (ring) RINGING_CALL_NOTIFICATION_CHANNEL_ID else CALL_NOTIFICATION_CHANNEL_ID_V3 + return if (ring) RINGING_CALL_NOTIFICATION_CHANNEL_ID else CALL_NOTIFICATION_CHANNEL_ID } override fun getChannelIdForMessage(noisy: Boolean): String { diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/channels/NotificationChannelsTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/channels/NotificationChannelsTest.kt index ec87069cd2..cc6a9f0225 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/channels/NotificationChannelsTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/channels/NotificationChannelsTest.kt @@ -55,7 +55,7 @@ class NotificationChannelsTest { assertThat(ringingChannel).isEqualTo(RINGING_CALL_NOTIFICATION_CHANNEL_ID) val normalChannel = notificationChannels.getChannelForIncomingCall(ring = false) - assertThat(normalChannel).isEqualTo(CALL_NOTIFICATION_CHANNEL_ID_V3) + assertThat(normalChannel).isEqualTo(CALL_NOTIFICATION_CHANNEL_ID) } @Test