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/AccountExpiryTickerFlow.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryTickerFlow.kt b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryTickerFlow.kt
index c3a444f5ed..3683096c80 100644
--- a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryTickerFlow.kt
+++ b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryTickerFlow.kt
@@ -10,7 +10,7 @@ fun expiryTickerFlow(
expiry: DateTime,
tickStart: Duration,
updateInterval: (expiry: DateTime) -> Duration,
-): Flow<Duration> = flow {
+): Flow<Duration?> = flow {
expiry.millisFromNow().let { expiryMillis ->
if (expiryMillis <= 0) {
// Has expired.
@@ -18,6 +18,8 @@ fun expiryTickerFlow(
return@flow
}
if (expiryMillis > tickStart.millis) {
+ // Emit null if no expiry notification should be provided.
+ emit(null)
// Delay until the time we should start emitting.
delay(expiryMillis - tickStart.millis + 1)
}