diff options
| author | David Göransson <david.goransson@mullvad.net> | 2025-10-02 11:27:53 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-10-06 11:43:15 +0200 |
| commit | d229d24b508f97c24fcc0a4a2db4f845141fd931 (patch) | |
| tree | 19241200a1830c7c5b8703714d2055b8d87619e7 /android/lib | |
| parent | f82099962e5160b4577038b794170fa2f70ed546 (diff) | |
| download | mullvadvpn-d229d24b508f97c24fcc0a4a2db4f845141fd931.tar.xz mullvadvpn-d229d24b508f97c24fcc0a4a2db4f845141fd931.zip | |
Warn users about android 16 upgrade issue
Diffstat (limited to 'android/lib')
7 files changed, 71 insertions, 4 deletions
diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/InAppNotification.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/InAppNotification.kt index 7a681da66c..77cfd97e5c 100644 --- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/InAppNotification.kt +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/InAppNotification.kt @@ -20,12 +20,17 @@ sealed class InAppNotification { } else { StatusLevel.Error } - override val priority: Long = 1004 + override val priority: Long = 1005 + } + + data object Android16UpgradeWarning : InAppNotification() { + override val statusLevel = StatusLevel.Warning + override val priority: Long = 1005 } data object TunnelStateBlocked : InAppNotification() { override val statusLevel = StatusLevel.None - override val priority: Long = 1003 + override val priority: Long = 1004 } data class UnsupportedVersion(val versionInfo: VersionInfo) : InAppNotification() { diff --git a/android/lib/resource/src/main/res/values/strings.xml b/android/lib/resource/src/main/res/values/strings.xml index 03379ec5b8..bc07a73fd7 100644 --- a/android/lib/resource/src/main/res/values/strings.xml +++ b/android/lib/resource/src/main/res/values/strings.xml @@ -440,4 +440,9 @@ <string name="no_matching_servers_found_second_line">Please try changing your filters.</string> <string name="refresh_server_list">Update server list</string> <string name="updating_server_list_in_the_background">Updating server list in the background...</string> + <string name="android_16_upgrade_warning_title">Can\'t connect?</string> + <string name="android_16_upgrade_warning_message">Android 16 has a known issue. Please restart your device and try again. To learn more, </string> + <string name="android_16_upgrade_warning_dialog_first_message">After updating a VPN app on Android 16, devices might end up in a state where VPN apps are no longer able to reach the internet.</string> + <string name="android_16_upgrade_warning_dialog_second_message">Please restart your device and try connecting again. If this does not work, please write an email to %s in Swedish or English.</string> + <string name="click_here">click here</string> </resources> diff --git a/android/lib/resource/src/main/res/values/strings_non_translatable.xml b/android/lib/resource/src/main/res/values/strings_non_translatable.xml index aab7a4117a..3595fe7096 100644 --- a/android/lib/resource/src/main/res/values/strings_non_translatable.xml +++ b/android/lib/resource/src/main/res/values/strings_non_translatable.xml @@ -17,4 +17,5 @@ </string> <string name="daita" translatable="false">DAITA</string> <string name="daita_full" translatable="false">Defence against AI-guided Traffic Analysis</string> + <string name="support_email">support@mullvadvpn.net</string> </resources> diff --git a/android/lib/tv/src/main/kotlin/net/mullvad/mullvadvpn/lib/tv/NotificationBannerTv.kt b/android/lib/tv/src/main/kotlin/net/mullvad/mullvadvpn/lib/tv/NotificationBannerTv.kt index 8208e5f6ec..e375c43c08 100644 --- a/android/lib/tv/src/main/kotlin/net/mullvad/mullvadvpn/lib/tv/NotificationBannerTv.kt +++ b/android/lib/tv/src/main/kotlin/net/mullvad/mullvadvpn/lib/tv/NotificationBannerTv.kt @@ -24,9 +24,11 @@ fun PreviewNotificationBannerTv() { openAppListing = {}, onClickShowAccount = {}, onClickShowChangelog = {}, + onClickShowAndroid16UpgradeInfo = {}, onClickDismissChangelog = {}, onClickDismissNewDevice = {}, onClickShowWireguardPortSettings = {}, + onClickDismissAndroid16UpgradeWarning = {}, ) } } @@ -40,9 +42,11 @@ fun NotificationBannerTv( contentFocusRequester: FocusRequester = FocusRequester(), onClickShowAccount: () -> Unit, onClickShowChangelog: () -> Unit, + onClickShowAndroid16UpgradeInfo: () -> Unit, onClickDismissChangelog: () -> Unit, onClickDismissNewDevice: () -> Unit, onClickShowWireguardPortSettings: () -> Unit, + onClickDismissAndroid16UpgradeWarning: () -> Unit, ) { AnimatedNotificationBanner( modifier = modifier, @@ -63,8 +67,10 @@ fun NotificationBannerTv( contentFocusRequester = contentFocusRequester, onClickShowAccount = onClickShowAccount, onClickShowChangelog = onClickShowChangelog, + onClickShowAndroid16UpgradeInfo = onClickShowAndroid16UpgradeInfo, onClickDismissChangelog = onClickDismissChangelog, onClickDismissNewDevice = onClickDismissNewDevice, onClickShowWireguardPortSettings = onClickShowWireguardPortSettings, + onClickDismissAndroid16UpgradeWarning = onClickDismissAndroid16UpgradeWarning, ) } diff --git a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/AnimatedNotificationBanner.kt b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/AnimatedNotificationBanner.kt index 94a935db74..b9799fab33 100644 --- a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/AnimatedNotificationBanner.kt +++ b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/AnimatedNotificationBanner.kt @@ -49,9 +49,11 @@ fun AnimatedNotificationBanner( contentFocusRequester: FocusRequester, onClickShowAccount: () -> Unit, onClickShowChangelog: () -> Unit, + onClickShowAndroid16UpgradeInfo: () -> Unit, onClickDismissChangelog: () -> Unit, onClickDismissNewDevice: () -> Unit, onClickShowWireguardPortSettings: () -> Unit, + onClickDismissAndroid16UpgradeWarning: () -> Unit, ) { // Fix for animating to invisible state val previous = rememberPrevious(current = notification, shouldUpdate = { _, _ -> true }) @@ -81,9 +83,11 @@ fun AnimatedNotificationBanner( openAppListing, onClickShowAccount, onClickShowChangelog, + onClickShowAndroid16UpgradeInfo, onClickDismissChangelog, onClickDismissNewDevice, onClickShowWireguardPortSettings, + onClickDismissAndroid16UpgradeWarning, ), ) } diff --git a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/NotificationData.kt b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/NotificationData.kt index 3af3b8b4ae..9f4c17dbd9 100644 --- a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/NotificationData.kt +++ b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/NotificationData.kt @@ -25,6 +25,8 @@ import net.mullvad.mullvadvpn.lib.model.ErrorStateCause import net.mullvad.mullvadvpn.lib.model.InAppNotification import net.mullvad.mullvadvpn.lib.model.ParameterGenerationError import net.mullvad.mullvadvpn.lib.model.StatusLevel +import net.mullvad.mullvadvpn.lib.ui.component.NotificationMessage.ClickableText +import net.mullvad.mullvadvpn.lib.ui.component.NotificationMessage.Text data class NotificationData( val title: AnnotatedString, @@ -70,15 +72,18 @@ data class NotificationAction( val contentDescription: String, ) +@Suppress("LongMethod") @Composable fun InAppNotification.toNotificationData( isPlayBuild: Boolean, openAppListing: () -> Unit, onClickShowAccount: () -> Unit, onClickShowChangelog: () -> Unit, + onClickShowAndroid16UpgradeInfo: () -> Unit, onClickDismissChangelog: () -> Unit, onClickDismissNewDevice: () -> Unit, onClickShowWireguardPortSettings: () -> Unit, + onClickDismissAndroid16UpgradeWarning: () -> Unit, ) = when (this) { is InAppNotification.NewDevice -> @@ -86,7 +91,7 @@ fun InAppNotification.toNotificationData( title = AnnotatedString(stringResource(id = R.string.new_device_notification_title)), message = - NotificationMessage.Text( + Text( stringResource(id = R.string.new_device_notification_message, deviceName) .formatWithHtml() ), @@ -135,7 +140,7 @@ fun InAppNotification.toNotificationData( NotificationData( title = stringResource(id = R.string.new_changelog_notification_title), message = - NotificationMessage.ClickableText( + ClickableText( text = buildAnnotatedString { withStyle(SpanStyle(textDecoration = TextDecoration.Underline)) { @@ -158,6 +163,40 @@ fun InAppNotification.toNotificationData( stringResource(id = R.string.dismiss), ), ) + + InAppNotification.Android16UpgradeWarning -> + NotificationData( + title = stringResource(id = R.string.android_16_upgrade_warning_title), + message = + ClickableText( + text = + buildAnnotatedString { + append( + stringResource(id = R.string.android_16_upgrade_warning_message) + ) + append(SPACE_CHAR) + withStyle( + SpanStyle( + textDecoration = TextDecoration.Underline, + color = MaterialTheme.colorScheme.onSurface, + ) + ) { + append(stringResource(R.string.click_here)) + } + append(DOT_CHAR) + }, + onClick = onClickShowAndroid16UpgradeInfo, + contentDescription = + stringResource(id = R.string.new_changelog_notification_message), + ), + statusLevel = statusLevel, + action = + NotificationAction( + Icons.Default.Clear, + onClickDismissAndroid16UpgradeWarning, + stringResource(id = R.string.dismiss), + ), + ) } @Composable diff --git a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/StringConstant.kt b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/StringConstant.kt new file mode 100644 index 0000000000..3198dc8101 --- /dev/null +++ b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/StringConstant.kt @@ -0,0 +1,7 @@ +package net.mullvad.mullvadvpn.lib.ui.component + +const val EMPTY_STRING = "" +const val SPACE_CHAR = ' ' +const val NEWLINE_STRING = "\n" +const val HTML_NEWLINE_STRING = "<br/>" +const val DOT_CHAR = '.' |
