diff --git a/tordnscrypt/src/main/java/pan/alexander/tordnscrypt/vpn/service/ServiceVPN.java b/tordnscrypt/src/main/java/pan/alexander/tordnscrypt/vpn/service/ServiceVPN.java index a25f123fa..feff87333 100644 --- a/tordnscrypt/src/main/java/pan/alexander/tordnscrypt/vpn/service/ServiceVPN.java +++ b/tordnscrypt/src/main/java/pan/alexander/tordnscrypt/vpn/service/ServiceVPN.java @@ -948,6 +948,13 @@ public void onTaskRemoved(Intent rootIntent) { loge("VPN service task removed " + this.hashCode()); + boolean vpnEnabled = defaultPreferences.get().getBoolean(VPN_SERVICE_ENABLED, false); + if (vpnEnabled) { + Intent starterIntent = new Intent(this, BootCompleteReceiver.class); + starterIntent.setAction(ALWAYS_ON_VPN); + sendBroadcast(starterIntent); + } + super.onTaskRemoved(rootIntent); } }