summaryrefslogtreecommitdiffhomepage
path: root/android/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'android/src/main')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/AccountExpiryNotification.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/AccountExpiryNotification.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/AccountExpiryNotification.kt
index 78b8ac8e34..ee82610035 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/AccountExpiryNotification.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/AccountExpiryNotification.kt
@@ -58,9 +58,10 @@ class AccountExpiryNotification(
private suspend fun update(accountExpiry: DateTime?) {
val remainingTime = accountExpiry?.let { expiry -> Duration(DateTime.now(), expiry) }
+ val closeToExpire = remainingTime?.isShorterThan(REMAINING_TIME_FOR_REMINDERS) ?: false
- if (remainingTime != null && remainingTime.isShorterThan(REMAINING_TIME_FOR_REMINDERS)) {
- val notification = build(accountExpiry, remainingTime)
+ if (closeToExpire && !accountCache.newlyCreatedAccount) {
+ val notification = build(accountExpiry!!, remainingTime!!)
channel.notificationManager.notify(NOTIFICATION_ID, notification)