Commit 9f662d2b authored by Emil van den Berg's avatar Emil van den Berg
Browse files

keep service in same state after reboot

parent 1d59008b
......@@ -9,7 +9,7 @@ import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.net.*
import android.os.* import android.provider.Settings
import android.os.*
import android.system.OsConstants
import android.util.Base64
import androidx.core.app.NotificationCompat
......@@ -166,6 +166,7 @@ class DnsVpnService : VpnService(), Runnable {
override fun onCreate() {
getPreferences().startAppOnBoot = true
super.onCreate()
AbstractHttpsDNSHandle // Loads the known servers.
AbstractTLSDnsHandle
......@@ -401,6 +402,7 @@ class DnsVpnService : VpnService(), Runnable {
when (intent.getSerializableExtra("command") as Command) {
Command.STOP -> {
log("Received STOP command.")
getPreferences().startAppOnBoot = false
destroy()
stopForeground(true)
stopSelf()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment