mirror of https://github.com/M66B/NetGuard.git
Handle race condition with outher VPN solutions
This commit is contained in:
parent
14b0aea105
commit
b533b2c98a
|
@ -109,6 +109,8 @@ public class SinkholeService extends VpnService {
|
||||||
vpn = startVPN();
|
vpn = startVPN();
|
||||||
startDebug(vpn);
|
startDebug(vpn);
|
||||||
}
|
}
|
||||||
|
if (vpn == null)
|
||||||
|
prefs.edit().putBoolean("enabled", false).apply();
|
||||||
removeDisabledNotification();
|
removeDisabledNotification();
|
||||||
Widget.updateWidgets(SinkholeService.this);
|
Widget.updateWidgets(SinkholeService.this);
|
||||||
break;
|
break;
|
||||||
|
@ -209,7 +211,7 @@ public class SinkholeService extends VpnService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startDebug(final ParcelFileDescriptor pfd) {
|
private void startDebug(final ParcelFileDescriptor pfd) {
|
||||||
if (!debug)
|
if (pfd == null || !debug)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
thread = new Thread(new Runnable() {
|
thread = new Thread(new Runnable() {
|
||||||
|
|
Loading…
Reference in New Issue