diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/serviceconnection/RelayListListener.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/serviceconnection/RelayListListener.kt index fe68c63408bb..d0f54a0cf625 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/serviceconnection/RelayListListener.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/serviceconnection/RelayListListener.kt @@ -101,6 +101,7 @@ class RelayListListener( location = Constraint.Any(), ownership = Constraint.Any(), wireguardConstraints = WireguardConstraints(Constraint.Any()), + providers = Constraint.Any() ) ) diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Providers.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Providers.kt new file mode 100644 index 000000000000..5d97588ca63b --- /dev/null +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Providers.kt @@ -0,0 +1,6 @@ +package net.mullvad.mullvadvpn.model + +import android.os.Parcelable +import kotlinx.parcelize.Parcelize + +@JvmInline @Parcelize value class Providers(val providers: HashSet) : Parcelable diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/RelayConstraints.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/RelayConstraints.kt index 21b1575edca8..031b09bacecc 100644 --- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/RelayConstraints.kt +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/RelayConstraints.kt @@ -6,6 +6,7 @@ import kotlinx.parcelize.Parcelize @Parcelize data class RelayConstraints( val location: Constraint, + val providers: Constraint, val ownership: Constraint, val wireguardConstraints: WireguardConstraints, ) : Parcelable diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/RelayConstraintsUpdate.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/RelayConstraintsUpdate.kt index 9d07ba92c316..8a382a87d99f 100644 --- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/RelayConstraintsUpdate.kt +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/RelayConstraintsUpdate.kt @@ -2,6 +2,7 @@ package net.mullvad.mullvadvpn.model data class RelayConstraintsUpdate( val location: Constraint?, + val providers: Constraint?, val ownership: Constraint?, val wireguardConstraints: WireguardConstraints? ) diff --git a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/RelayListListener.kt b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/RelayListListener.kt index cb57e7585ded..6974d804a181 100644 --- a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/RelayListListener.kt +++ b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/RelayListListener.kt @@ -99,7 +99,8 @@ class RelayListListener(endpoint: ServiceEndpoint) { RelayConstraintsUpdate( location = location, wireguardConstraints = wireguardConstraints, - ownership = Constraint.Any() + ownership = Constraint.Any(), + providers = Constraint.Any() ) ) diff --git a/mullvad-jni/src/classes.rs b/mullvad-jni/src/classes.rs index 9bdec1669175..45dc21a4a2d1 100644 --- a/mullvad-jni/src/classes.rs +++ b/mullvad-jni/src/classes.rs @@ -3,6 +3,7 @@ pub const CLASSES: &[&str] = &[ "java/net/InetAddress", "java/net/InetSocketAddress", "java/util/ArrayList", + "java/util/HashSet", "net/mullvad/mullvadvpn/model/AccountAndDevice", "net/mullvad/mullvadvpn/model/AccountData", "net/mullvad/mullvadvpn/model/AppVersionInfo", @@ -43,6 +44,7 @@ pub const CLASSES: &[&str] = &[ "net/mullvad/mullvadvpn/model/QuantumResistantState", "net/mullvad/mullvadvpn/model/Port", "net/mullvad/mullvadvpn/model/PortRange", + "net/mullvad/mullvadvpn/model/Providers", "net/mullvad/mullvadvpn/model/Relay", "net/mullvad/mullvadvpn/model/RelayConstraints", "net/mullvad/mullvadvpn/model/RelayEndpointData$Bridge", diff --git a/mullvad-types/src/relay_constraints.rs b/mullvad-types/src/relay_constraints.rs index 600a04646c3a..d0178c3c988f 100644 --- a/mullvad-types/src/relay_constraints.rs +++ b/mullvad-types/src/relay_constraints.rs @@ -369,7 +369,6 @@ impl<'a> fmt::Display for LocationConstraintFormatter<'a> { #[cfg_attr(target_os = "android", jnix(package = "net.mullvad.mullvadvpn.model"))] pub struct RelayConstraints { pub location: Constraint, - #[cfg_attr(target_os = "android", jnix(skip))] pub providers: Constraint, pub ownership: Constraint, #[cfg_attr(target_os = "android", jnix(skip))] @@ -607,6 +606,8 @@ pub struct OwnershipParseError; /// provider. pub type Provider = String; +#[cfg_attr(target_os = "android", derive(IntoJava, FromJava))] +#[cfg_attr(target_os = "android", jnix(package = "net.mullvad.mullvadvpn.model"))] #[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)] pub struct Providers { providers: HashSet, @@ -986,7 +987,6 @@ impl RelaySettingsUpdate { #[serde(default)] pub struct RelayConstraintsUpdate { pub location: Option>, - #[cfg_attr(target_os = "android", jnix(default))] pub providers: Option>, pub ownership: Option>, #[cfg_attr(target_os = "android", jnix(default))]