mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-24 08:45:53 +00:00
Check VpnService.Builder.establish result
This commit is contained in:
parent
2dd8b060b2
commit
caaf936bcb
1 changed files with 6 additions and 7 deletions
|
@ -109,12 +109,8 @@ public class SinkholeService extends VpnService {
|
|||
vpn = startVPN();
|
||||
startDebug(vpn);
|
||||
}
|
||||
if (vpn == null)
|
||||
prefs.edit().putBoolean("enabled", false).apply();
|
||||
else {
|
||||
removeDisabledNotification();
|
||||
Widget.updateWidgets(SinkholeService.this);
|
||||
}
|
||||
removeDisabledNotification();
|
||||
Widget.updateWidgets(SinkholeService.this);
|
||||
break;
|
||||
|
||||
case reload:
|
||||
|
@ -193,7 +189,10 @@ public class SinkholeService extends VpnService {
|
|||
|
||||
// Start VPN service
|
||||
try {
|
||||
return builder.establish();
|
||||
ParcelFileDescriptor result = builder.establish();
|
||||
if (result == null)
|
||||
throw new IllegalStateException("VpnService.Builder.establish returned unexpectedly NULL");
|
||||
return result;
|
||||
|
||||
} catch (Throwable ex) {
|
||||
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
||||
|
|
Loading…
Reference in a new issue