diff options
| author | David Göransson <david.goransson90@gmail.com> | 2024-02-13 16:20:55 +0100 |
|---|---|---|
| committer | David Göransson <david.goransson90@gmail.com> | 2024-02-15 13:42:07 +0100 |
| commit | 34b5e9ed46b436a1fa4a5025aa136b7c88b4ede5 (patch) | |
| tree | 6ac48d3ff01734f491c526dbf92bbdef088ca4d2 /android | |
| parent | d0b49816b95dbf7b6a5e8048caef61212191d07d (diff) | |
| download | mullvadvpn-34b5e9ed46b436a1fa4a5025aa136b7c88b4ede5.tar.xz mullvadvpn-34b5e9ed46b436a1fa4a5025aa136b7c88b4ede5.zip | |
Add support for Latitude and Longitude from Daemon
Diffstat (limited to 'android')
3 files changed, 9 insertions, 5 deletions
diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt index 57eeef5ca4..05dae1d53d 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/ConnectViewModelTest.kt @@ -209,7 +209,9 @@ class ConnectViewModelTest { ipv6 = mockk(relaxed = true), country = "Sweden", city = "Gothenburg", - hostname = "Host" + hostname = "Host", + latitude = 57.7065, + longitude = 11.967 ) // Act, Assert diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/GeoIpLocation.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/GeoIpLocation.kt index e15ab20376..625de76b29 100644 --- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/GeoIpLocation.kt +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/GeoIpLocation.kt @@ -10,5 +10,7 @@ data class GeoIpLocation( val ipv6: InetAddress?, val country: String, val city: String?, - val hostname: String? + val latitude: Double, + val longitude: Double, + val hostname: String?, ) : Parcelable diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/GeographicLocationConstraint.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/GeographicLocationConstraint.kt index 04f92a72ac..386257a72a 100644 --- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/GeographicLocationConstraint.kt +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/GeographicLocationConstraint.kt @@ -9,20 +9,20 @@ sealed class GeographicLocationConstraint : Parcelable { @Parcelize data class Country(val countryCode: String) : GeographicLocationConstraint() { override val location: GeoIpLocation - get() = GeoIpLocation(null, null, countryCode, null, null) + get() = GeoIpLocation(null, null, countryCode, null, 0.0, 0.0, null) } @Parcelize data class City(val countryCode: String, val cityCode: String) : GeographicLocationConstraint() { override val location: GeoIpLocation - get() = GeoIpLocation(null, null, countryCode, cityCode, null) + get() = GeoIpLocation(null, null, countryCode, cityCode, 0.0, 0.0, null) } @Parcelize data class Hostname(val countryCode: String, val cityCode: String, val hostname: String) : GeographicLocationConstraint() { override val location: GeoIpLocation - get() = GeoIpLocation(null, null, countryCode, cityCode, hostname) + get() = GeoIpLocation(null, null, countryCode, cityCode, 0.0, 0.0, hostname) } } |
