mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
Tell the user when protection stops and check the server address in the service
- When the tunnel stops working, a notification says that DNS is no longer encrypted (new "Protection alerts" channel). - The service no longer brings up a tunnel for a server address that is not a valid HTTPS URL (always-on VPN or a restart by the system), and says so in a notification. - With "Block connections without VPN" on, a notification explains that the DNS server cannot be reached. - The tunnel is closed only after its reader thread has left. - Turning protection off from the quick settings tile needs an unlocked phone.
This commit is contained in:
@@ -59,6 +59,15 @@ class DnsTileService : TileService() {
|
||||
return
|
||||
}
|
||||
}
|
||||
// Turning protection off needs an unlocked phone, like other security toggles
|
||||
if (running && isLocked) {
|
||||
unlockAndRun { toggle(running) }
|
||||
return
|
||||
}
|
||||
toggle(running)
|
||||
}
|
||||
|
||||
private fun toggle(running: Boolean) {
|
||||
val action = if (running) DohVpnService.ACTION_STOP else DohVpnService.ACTION_START
|
||||
try {
|
||||
startService(Intent(this, DohVpnService::class.java).setAction(action))
|
||||
|
||||
Reference in New Issue
Block a user