diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-02-01 21:00:21 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-04-13 17:21:48 +0000 |
| commit | b49e2b3ce98bccb1ce0097f2f128d77000c9f327 (patch) | |
| tree | fcb720fa73bb72f281abc0b2bf9f05e61f1bad92 /android/src | |
| parent | e07cdaf640c1824bd114029b14ba54a9fb1a310b (diff) | |
| download | mullvadvpn-b49e2b3ce98bccb1ce0097f2f128d77000c9f327.tar.xz mullvadvpn-b49e2b3ce98bccb1ce0097f2f128d77000c9f327.zip | |
Remove unused service side methods
Diffstat (limited to 'android/src')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/CustomDns.kt | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/CustomDns.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/CustomDns.kt index f52fd63862..aec190d81d 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/CustomDns.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/CustomDns.kt @@ -38,19 +38,21 @@ class CustomDns(private val endpoint: ServiceEndpoint) { endpoint.dispatcher.apply { registerHandler(Request.AddCustomDnsServer::class) { request -> - addDnsServer(request.address) + commandChannel.sendBlocking(Command.AddDnsServer(request.address)) } registerHandler(Request.RemoveCustomDnsServer::class) { request -> - removeDnsServer(request.address) + commandChannel.sendBlocking(Command.RemoveDnsServer(request.address)) } registerHandler(Request.ReplaceCustomDnsServer::class) { request -> - replaceDnsServer(request.oldAddress, request.newAddress) + commandChannel.sendBlocking( + Command.ReplaceDnsServer(request.oldAddress, request.newAddress) + ) } registerHandler(Request.SetEnableCustomDns::class) { request -> - setEnabled(request.enable) + commandChannel.sendBlocking(Command.SetEnabled(request.enable)) } } } @@ -60,22 +62,6 @@ class CustomDns(private val endpoint: ServiceEndpoint) { commandChannel.close() } - fun addDnsServer(server: InetAddress) { - commandChannel.sendBlocking(Command.AddDnsServer(server)) - } - - fun replaceDnsServer(oldServer: InetAddress, newServer: InetAddress) { - commandChannel.sendBlocking(Command.ReplaceDnsServer(oldServer, newServer)) - } - - fun removeDnsServer(server: InetAddress) { - commandChannel.sendBlocking(Command.RemoveDnsServer(server)) - } - - fun setEnabled(enabled: Boolean) { - commandChannel.sendBlocking(Command.SetEnabled(enabled)) - } - private fun spawnActor() = GlobalScope.actor<Command>(Dispatchers.Default, Channel.UNLIMITED) { try { while (true) { |
