mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
Notification channels: No need to include the version in the constant name.
This commit is contained in:
+3
-3
@@ -40,7 +40,7 @@ import javax.inject.Inject
|
|||||||
* ========================================================================================== */
|
* ========================================================================================== */
|
||||||
internal const val SILENT_NOTIFICATION_CHANNEL_ID = "DEFAULT_SILENT_NOTIFICATION_CHANNEL_ID_V2"
|
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 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"
|
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
|
// Register a channel for incoming and in progress call notifications with no ringing
|
||||||
notificationManager.createNotificationChannel(
|
notificationManager.createNotificationChannel(
|
||||||
NotificationChannel(
|
NotificationChannel(
|
||||||
CALL_NOTIFICATION_CHANNEL_ID_V3,
|
CALL_NOTIFICATION_CHANNEL_ID,
|
||||||
stringProvider.getString(R.string.notification_channel_call).ifEmpty { "Call" },
|
stringProvider.getString(R.string.notification_channel_call).ifEmpty { "Call" },
|
||||||
NotificationManager.IMPORTANCE_HIGH
|
NotificationManager.IMPORTANCE_HIGH
|
||||||
)
|
)
|
||||||
@@ -191,7 +191,7 @@ class DefaultNotificationChannels @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getChannelForIncomingCall(ring: Boolean): String {
|
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 {
|
override fun getChannelIdForMessage(noisy: Boolean): String {
|
||||||
|
|||||||
+1
-1
@@ -55,7 +55,7 @@ class NotificationChannelsTest {
|
|||||||
assertThat(ringingChannel).isEqualTo(RINGING_CALL_NOTIFICATION_CHANNEL_ID)
|
assertThat(ringingChannel).isEqualTo(RINGING_CALL_NOTIFICATION_CHANNEL_ID)
|
||||||
|
|
||||||
val normalChannel = notificationChannels.getChannelForIncomingCall(ring = false)
|
val normalChannel = notificationChannels.getChannelForIncomingCall(ring = false)
|
||||||
assertThat(normalChannel).isEqualTo(CALL_NOTIFICATION_CHANNEL_ID_V3)
|
assertThat(normalChannel).isEqualTo(CALL_NOTIFICATION_CHANNEL_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user