Skip to content

Commit cd10c1c

Browse files
committed
fix: prevent app from being killed in VPN mode
1 parent 1e5da53 commit cd10c1c

File tree

1 file changed

+7
-0
lines changed
  • tordnscrypt/src/main/java/pan/alexander/tordnscrypt/vpn/service

1 file changed

+7
-0
lines changed

tordnscrypt/src/main/java/pan/alexander/tordnscrypt/vpn/service/ServiceVPN.java

+7
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,13 @@ public void onTaskRemoved(Intent rootIntent) {
948948

949949
loge("VPN service task removed " + this.hashCode());
950950

951+
boolean vpnEnabled = defaultPreferences.get().getBoolean(VPN_SERVICE_ENABLED, false);
952+
if (vpnEnabled) {
953+
Intent starterIntent = new Intent(this, BootCompleteReceiver.class);
954+
starterIntent.setAction(ALWAYS_ON_VPN);
955+
sendBroadcast(starterIntent);
956+
}
957+
951958
super.onTaskRemoved(rootIntent);
952959
}
953960
}

0 commit comments

Comments
 (0)