summaryrefslogtreecommitdiffhomepage
path: root/android/service
diff options
context:
space:
mode:
Diffstat (limited to 'android/service')
-rw-r--r--android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryNotificationProvider.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryNotificationProvider.kt b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryNotificationProvider.kt
index 776ce47960..0be99896c9 100644
--- a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryNotificationProvider.kt
+++ b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryNotificationProvider.kt
@@ -20,7 +20,7 @@ class AccountExpiryNotificationProvider(private val channelId: NotificationChann
override val notifications: Flow<NotificationUpdate<Notification.AccountExpiry>>
get() = notificationChannel.receiveAsFlow()
- suspend fun showNotification(durationUntilExpiry: Duration) {
+ fun showNotification(durationUntilExpiry: Duration) {
val notification =
Notification.AccountExpiry(
channelId = channelId,
@@ -29,7 +29,8 @@ class AccountExpiryNotificationProvider(private val channelId: NotificationChann
)
val notificationUpdate = NotificationUpdate.Notify(NOTIFICATION_ID, notification)
- notificationChannel.send(notificationUpdate)
+ // Always succeeds because the channel is conflated.
+ notificationChannel.trySend(notificationUpdate)
}
suspend fun cancelNotification() {