summaryrefslogtreecommitdiffhomepage
path: root/android/lib
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2024-06-17 09:58:57 +0200
committerMarkus Pettersson <markus.pettersson@mullvad.net>2024-06-17 09:58:57 +0200
commit778e5297430a1bdbec94acd67dc98bcfa2703596 (patch)
tree6a17f4c00b1997d4906fdbbea00700ef7d89ed4b /android/lib
parent9cba0d84ca508a7ac69442cb32b1660691704653 (diff)
parent5c16eff4b48c6e14b720b81e0b548c8b31d5a22e (diff)
downloadmullvadvpn-778e5297430a1bdbec94acd67dc98bcfa2703596.tar.xz
mullvadvpn-778e5297430a1bdbec94acd67dc98bcfa2703596.zip
Merge branch 'provide-data-dir-path-to-daemon-during-initialization-des-993'
Diffstat (limited to 'android/lib')
-rw-r--r--android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/constant/DiConstant.kt3
-rw-r--r--android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/constant/PathConstant.kt3
-rw-r--r--android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt10
3 files changed, 14 insertions, 2 deletions
diff --git a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/constant/DiConstant.kt b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/constant/DiConstant.kt
new file mode 100644
index 0000000000..0acd41c7ec
--- /dev/null
+++ b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/constant/DiConstant.kt
@@ -0,0 +1,3 @@
+package net.mullvad.mullvadvpn.lib.common.constant
+
+const val GRPC_SOCKET_FILE_NAMED_ARGUMENT = "RPC_SOCKET"
diff --git a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/constant/PathConstant.kt b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/constant/PathConstant.kt
new file mode 100644
index 0000000000..4ad0471c86
--- /dev/null
+++ b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/constant/PathConstant.kt
@@ -0,0 +1,3 @@
+package net.mullvad.mullvadvpn.lib.common.constant
+
+const val GRPC_SOCKET_FILE_NAME = "rpc-socket"
diff --git a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt
index 987b7e56ea..10c2406850 100644
--- a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt
+++ b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt
@@ -16,6 +16,7 @@ import io.grpc.ConnectivityState
import io.grpc.Status
import io.grpc.StatusException
import io.grpc.android.UdsChannelBuilder
+import java.io.File
import java.net.InetAddress
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -127,14 +128,19 @@ import net.mullvad.mullvadvpn.lib.model.wireguardConstraints
@Suppress("TooManyFunctions")
class ManagementService(
- rpcSocketPath: String,
+ rpcSocketFile: File,
private val extensiveLogging: Boolean,
private val scope: CoroutineScope,
) {
private var job: Job? = null
+ // We expect daemon to create the rpc socket file on the path provided on initialisation
private val channel =
- UdsChannelBuilder.forPath(rpcSocketPath, LocalSocketAddress.Namespace.FILESYSTEM).build()
+ UdsChannelBuilder.forPath(
+ rpcSocketFile.absolutePath,
+ LocalSocketAddress.Namespace.FILESYSTEM
+ )
+ .build()
val connectionState: StateFlow<GrpcConnectivityState> =
channel