diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-04-07 15:20:30 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-04-09 09:46:21 +0200 |
| commit | 0db6e80bbc591eeefb2408fa2e335b2804135eb2 (patch) | |
| tree | 3b465d233d94a4739f9a0850607fc0424c9cb8af /android/lib | |
| parent | 9a6938a4a32ecc162cc5afcf15fa636de2f9b9fe (diff) | |
| download | mullvadvpn-0db6e80bbc591eeefb2408fa2e335b2804135eb2.tar.xz mullvadvpn-0db6e80bbc591eeefb2408fa2e335b2804135eb2.zip | |
Improve error message when an unavailable ip version is selected
Diffstat (limited to 'android/lib')
4 files changed, 13 insertions, 3 deletions
diff --git a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/mapper/ToDomain.kt b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/mapper/ToDomain.kt index 40ee4d6bcf..10c417cf1c 100644 --- a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/mapper/ToDomain.kt +++ b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/mapper/ToDomain.kt @@ -302,7 +302,11 @@ internal fun ManagementInterface.ErrorState.GenerationError.toDomain(): Paramete ManagementInterface.ErrorState.GenerationError.NO_WIREGUARD_KEY -> ParameterGenerationError.NoWireguardKey ManagementInterface.ErrorState.GenerationError.CUSTOM_TUNNEL_HOST_RESOLUTION_ERROR -> - ParameterGenerationError.CustomTunnelHostResultionError + ParameterGenerationError.CustomTunnelHostResolutionError + ManagementInterface.ErrorState.GenerationError.NETWORK_IPV4_UNAVAILABLE -> + ParameterGenerationError.Ipv4_Unavailable + ManagementInterface.ErrorState.GenerationError.NETWORK_IPV6_UNAVAILABLE -> + ParameterGenerationError.Ipv6_Unavailable ManagementInterface.ErrorState.GenerationError.UNRECOGNIZED -> throw IllegalArgumentException("Unrecognized parameter generation error") } diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/ParameterGenerationError.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/ParameterGenerationError.kt index 0aadc19094..5683dc08b1 100644 --- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/ParameterGenerationError.kt +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/ParameterGenerationError.kt @@ -4,5 +4,7 @@ enum class ParameterGenerationError { NoMatchingRelay, NoMatchingBridgeRelay, NoWireguardKey, - CustomTunnelHostResultionError, + CustomTunnelHostResolutionError, + Ipv4_Unavailable, + Ipv6_Unavailable, } diff --git a/android/lib/resource/src/main/res/values/strings.xml b/android/lib/resource/src/main/res/values/strings.xml index 4fc739770c..30bc03d3dc 100644 --- a/android/lib/resource/src/main/res/values/strings.xml +++ b/android/lib/resource/src/main/res/values/strings.xml @@ -407,4 +407,6 @@ <string name="uri_browser_app_not_found">No browser app installed, could not open link</string> <string name="device_ip_version_subtitle">This allows access to WireGuard for devices that only support IPv6.</string> <string name="ipv6_info">When this feature is enabled, IPv6 can be used alongside IPv4 in the VPN tunnel to communicate with internet services.</string> + <string name="ip_version_v4_unavailable">IPv4 is not available</string> + <string name="ip_version_v6_unavailable">IPv6 is not available</string> </resources> 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 c7fdad4793..b022ca8c07 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 @@ -237,8 +237,10 @@ private fun ParameterGenerationError.errorMessageId(): Int = R.string.no_matching_relay } ParameterGenerationError.NoWireguardKey -> R.string.no_wireguard_key - ParameterGenerationError.CustomTunnelHostResultionError -> + ParameterGenerationError.CustomTunnelHostResolutionError -> R.string.custom_tunnel_host_resolution_error + ParameterGenerationError.Ipv4_Unavailable -> R.string.ip_version_v4_unavailable + ParameterGenerationError.Ipv6_Unavailable -> R.string.ip_version_v6_unavailable } private fun InetAddress.addressString(): String { |
