diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2024-02-07 23:27:20 +0100 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2024-02-08 10:50:58 +0100 |
| commit | 52a9cf9686756b366c5e1d8359f5a2b37c18df8a (patch) | |
| tree | 196d236fa450c19d46003a4907ab74ea822f8680 /android/lib/common/src/main | |
| parent | 25054733a42638a5375ef801025a025d0a1ef605 (diff) | |
| download | mullvadvpn-52a9cf9686756b366c5e1d8359f5a2b37c18df8a.tar.xz mullvadvpn-52a9cf9686756b366c5e1d8359f5a2b37c18df8a.zip | |
Update the relaylist model
Use sealed interface for RelayItem
Add CustomList as a type of RelayItem
Diffstat (limited to 'android/lib/common/src/main')
| -rw-r--r-- | android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/LocationConstraintExtensions.kt | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/LocationConstraintExtensions.kt b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/LocationConstraintExtensions.kt deleted file mode 100644 index d845e3aba9..0000000000 --- a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/LocationConstraintExtensions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package net.mullvad.mullvadvpn.lib.common.util - -import net.mullvad.mullvadvpn.model.Constraint -import net.mullvad.mullvadvpn.model.GeographicLocationConstraint -import net.mullvad.mullvadvpn.model.LocationConstraint - -fun LocationConstraint.toGeographicLocationConstraint(): GeographicLocationConstraint? = - when (this) { - is LocationConstraint.Location -> this.location - is LocationConstraint.CustomList -> null - } - -fun Constraint<LocationConstraint>.toGeographicLocationConstraint(): - Constraint<GeographicLocationConstraint> = - when (this) { - is Constraint.Only -> - when (value) { - is LocationConstraint.Location -> - Constraint.Only((value as LocationConstraint.Location).location) - is LocationConstraint.CustomList -> Constraint.Any() - } - is Constraint.Any -> Constraint.Any() - } |
