diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt index 98c87114fbaa..ec518c870a9a 100644 --- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt +++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt @@ -597,40 +597,6 @@ class ConnectScreenTest { } } - @Test - fun testOutdatedVersionNotification() { - composeExtension.use { - // Arrange - val versionInfo = - VersionInfo( - currentVersion = "1.0", - isSupported = true, - suggestedUpgradeVersion = "1.1" - ) - setContentWithTheme { - ConnectScreen( - state = - ConnectUiState( - location = null, - selectedRelayItemTitle = null, - tunnelState = TunnelState.Connecting(null, null), - inAddress = null, - outAddress = "", - showLocation = false, - deviceName = "", - daysLeftUntilExpiry = null, - inAppNotification = InAppNotification.UpdateAvailable(versionInfo), - isPlayBuild = false - ), - ) - } - - // Assert - onNodeWithText("UPDATE AVAILABLE").assertExists() - onNodeWithText("Install Mullvad VPN (1.1) to stay up to date").assertExists() - } - } - @Test fun testUnsupportedVersionNotification() { composeExtension.use { diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreenTest.kt index afa144f405a3..81f98c590624 100644 --- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreenTest.kt +++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreenTest.kt @@ -31,7 +31,7 @@ class SettingsScreenTest { SettingsUiState( appVersion = "", isLoggedIn = true, - isUpdateAvailable = true, + isUnsupportedVersion = false, isPlayBuild = false ), ) @@ -54,7 +54,7 @@ class SettingsScreenTest { SettingsUiState( appVersion = "", isLoggedIn = false, - isUpdateAvailable = true, + isUnsupportedVersion = false, isPlayBuild = false ), ) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/NavigationComposeCell.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/NavigationComposeCell.kt index fdc01ab62d59..5793bcad56d1 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/NavigationComposeCell.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/NavigationComposeCell.kt @@ -95,7 +95,7 @@ internal fun NavigationTitleView( Image( painter = painterResource(id = R.drawable.icon_alert), modifier = Modifier.padding(end = Dimens.smallPadding), - contentDescription = stringResource(id = R.string.update_available) + contentDescription = "" ) } Text( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/notificationbanner/NotificationData.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/notificationbanner/NotificationData.kt index b8ea96fc72a3..28efcee9c437 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/notificationbanner/NotificationData.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/notificationbanner/NotificationData.kt @@ -93,19 +93,6 @@ fun InAppNotification.toNotificationData( if (isPlayBuild) null else NotificationAction(R.drawable.icon_extlink, onClickUpdateVersion) ) - is InAppNotification.UpdateAvailable -> - NotificationData( - title = stringResource(id = R.string.update_available), - message = - stringResource( - id = R.string.update_available_description, - versionInfo.suggestedUpgradeVersion ?: "" - ), - statusLevel = StatusLevel.Warning, - action = - if (isPlayBuild) null - else NotificationAction(R.drawable.icon_extlink, onClickUpdateVersion) - ) } @Composable diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt index 1ea7d9e80c91..f7cc4a977752 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DeviceListScreen.kt @@ -1,5 +1,6 @@ package net.mullvad.mullvadvpn.compose.screen +import android.util.Log import androidx.compose.animation.animateContentSize import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement @@ -32,6 +33,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.lifecycle.Lifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.dropUnlessResumed +import co.touchlab.kermit.Logger import com.ramcosta.composedestinations.annotation.Destination import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.generated.destinations.LoginDestination @@ -160,6 +162,8 @@ fun DeviceList( onTryAgainClicked = viewModel::fetchDevices, navigateToRemoveDeviceConfirmationDialog = dropUnlessResumed { + //Logger.i("DeviceList: remove device: $it") + Log.d("mullvad", "DeviceList: remove device: $it") navigator.navigate(RemoveDeviceConfirmationDialogDestination(it)) } ) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt index 15852560c130..668df7ebad45 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SettingsScreen.kt @@ -54,7 +54,7 @@ private fun PreviewSettings() { SettingsUiState( appVersion = "2222.22", isLoggedIn = true, - isUpdateAvailable = true, + isUnsupportedVersion = true, isPlayBuild = false ), ) @@ -172,13 +172,13 @@ private fun AppVersion(context: Context, state: SettingsUiState) { ) } }, - showWarning = state.isUpdateAvailable, + showWarning = state.isUnsupportedVersion, isRowEnabled = !state.isPlayBuild ) - if (state.isUpdateAvailable) { + if (state.isUnsupportedVersion) { Text( - text = stringResource(id = R.string.update_available_footer), + text = stringResource(id = R.string.unsupported_version_description), style = MaterialTheme.typography.labelMedium, color = MaterialTheme.colorScheme.onSecondary, modifier = diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/SettingsUiState.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/SettingsUiState.kt index b325ed2ce735..270179513a0c 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/SettingsUiState.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/SettingsUiState.kt @@ -3,6 +3,6 @@ package net.mullvad.mullvadvpn.compose.state data class SettingsUiState( val appVersion: String, val isLoggedIn: Boolean, - val isUpdateAvailable: Boolean, + val isUnsupportedVersion: Boolean, val isPlayBuild: Boolean ) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/InAppNotificationController.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/InAppNotificationController.kt index 79db20d39011..6686621f7b65 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/InAppNotificationController.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/InAppNotificationController.kt @@ -47,11 +47,6 @@ sealed class InAppNotification { override val statusLevel = StatusLevel.Info override val priority: Long = 1001 } - - data class UpdateAvailable(val versionInfo: VersionInfo) : InAppNotification() { - override val statusLevel = StatusLevel.Info - override val priority: Long = 1000 - } } class InAppNotificationController( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/VersionInfo.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/VersionInfo.kt index c0ab7dd0ed00..ec343b31bcc3 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/VersionInfo.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/VersionInfo.kt @@ -4,6 +4,4 @@ data class VersionInfo( val currentVersion: String, val isSupported: Boolean, val suggestedUpgradeVersion: String? -) { - val isUpdateAvailable: Boolean = suggestedUpgradeVersion != null -} +) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/VersionNotificationUseCase.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/VersionNotificationUseCase.kt index 43f1fdac7716..9086caf2fde4 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/VersionNotificationUseCase.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/usecase/VersionNotificationUseCase.kt @@ -16,22 +16,11 @@ class VersionNotificationUseCase( .versionInfo() .map { versionInfo -> listOfNotNull( - unsupportedVersionNotification(versionInfo), - updateAvailableNotification(versionInfo) + unsupportedVersionNotification(versionInfo) ) } .distinctUntilChanged() - private fun updateAvailableNotification(versionInfo: VersionInfo): InAppNotification? { - if (!isVersionInfoNotificationEnabled) { - return null - } - - return if (versionInfo.isUpdateAvailable) { - InAppNotification.UpdateAvailable(versionInfo) - } else null - } - private fun unsupportedVersionNotification(versionInfo: VersionInfo): InAppNotification? { if (!isVersionInfoNotificationEnabled) { return null diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SettingsViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SettingsViewModel.kt index 5150af274786..dfc3b7851ddf 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SettingsViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SettingsViewModel.kt @@ -24,8 +24,7 @@ class SettingsViewModel( SettingsUiState( isLoggedIn = deviceState is DeviceState.LoggedIn, appVersion = versionInfo.currentVersion, - isUpdateAvailable = - versionInfo.let { it.isSupported.not() || it.isUpdateAvailable }, + isUnsupportedVersion = versionInfo.isSupported.not(), isPlayBuild = isPlayBuild ) } @@ -35,7 +34,7 @@ class SettingsViewModel( SettingsUiState( appVersion = "", isLoggedIn = false, - isUpdateAvailable = false, + isUnsupportedVersion = false, isPlayBuild ) ) @@ -47,7 +46,7 @@ class SettingsViewModel( SettingsUiState( appVersion = "", isLoggedIn = false, - isUpdateAvailable = false, + isUnsupportedVersion = false, isPlayBuild ) ) diff --git a/android/lib/resource/src/main/res/values/strings.xml b/android/lib/resource/src/main/res/values/strings.xml index f7fafc72ffcb..367b635879de 100644 --- a/android/lib/resource/src/main/res/values/strings.xml +++ b/android/lib/resource/src/main/res/values/strings.xml @@ -145,8 +145,6 @@ Unable to resolve host of custom tunnel. Try changing your settings. Your device is offline. The tunnel will automatically connect once your device is back online. Virtual adapter error - UPDATE AVAILABLE - Install Mullvad VPN (%1$s) to stay up to date UNSUPPORTED VERSION Your privacy might be at risk with this unsupported app version. Please update now. You are running an unsupported app version.