diff options
Diffstat (limited to 'android/app/src')
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/di/UiModule.kt | 2 | ||||
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/VersionInfoNotification.kt | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/di/UiModule.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/di/UiModule.kt index 01ce12085f..bbe632f9d5 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/di/UiModule.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/di/UiModule.kt @@ -63,7 +63,7 @@ val uiModule = module { single { AccountExpiryNotification(get()) } single { TunnelStateNotification(get()) } - single { VersionInfoNotification(get()) } + single { VersionInfoNotification(BuildConfig.ENABLE_IN_APP_VERSION_NOTIFICATIONS, get()) } single { AccountRepository(get()) } single { DeviceRepository(get()) } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/VersionInfoNotification.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/VersionInfoNotification.kt index 05ff56f1fe..3407684831 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/VersionInfoNotification.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/VersionInfoNotification.kt @@ -4,13 +4,16 @@ import android.content.Context import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.ui.VersionInfo -class VersionInfoNotification(context: Context) : +class VersionInfoNotification(val isEnabled: Boolean, context: Context) : NotificationWithUrl(context, R.string.download_url) { private val unsupportedVersion = context.getString(R.string.unsupported_version) private val updateAvailable = context.getString(R.string.update_available) fun updateVersionInfo(versionInfo: VersionInfo) { - if (versionInfo.isOutdated || !versionInfo.isSupported) { + val shouldShowNotification = + isEnabled && (versionInfo.isOutdated || !versionInfo.isSupported) + + if (shouldShowNotification) { if (versionInfo.upgradeVersion != null) { message = if (versionInfo.isSupported) { |
