mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-22 07:43:15 +00:00
Removed VPN handover
There are just too many problems with this
This commit is contained in:
parent
a32a18ec78
commit
848667885e
1 changed files with 5 additions and 21 deletions
|
@ -571,28 +571,12 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
last_builder = builder;
|
||||
Log.i(TAG, "VPN restart");
|
||||
|
||||
// Attempt seamless handover
|
||||
ParcelFileDescriptor prev = vpn;
|
||||
if (vpn != null){
|
||||
stopNative(vpn, clear);
|
||||
stopVPN(vpn);
|
||||
}
|
||||
|
||||
vpn = startVPN(builder);
|
||||
|
||||
if (prev != null && vpn == null) {
|
||||
Log.w(TAG, "Handover failed");
|
||||
stopNative(prev, clear);
|
||||
stopVPN(prev);
|
||||
prev = null;
|
||||
try {
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
vpn = startVPN(last_builder);
|
||||
if (vpn == null)
|
||||
throw new IllegalStateException("Handover failed");
|
||||
}
|
||||
|
||||
if (prev != null) {
|
||||
stopNative(prev, clear);
|
||||
stopVPN(prev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue