mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-24 07:10:50 +00:00
Always show error when not starting/reloading
This commit is contained in:
parent
24a1a452b0
commit
ac6fb2e51c
1 changed files with 14 additions and 12 deletions
|
@ -346,19 +346,21 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
} catch (Throwable ex) {
|
||||
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
||||
|
||||
if ((cmd == Command.start || cmd == Command.reload) &&
|
||||
VpnService.prepare(ServiceSinkhole.this) == null) {
|
||||
Log.w(TAG, "VPN not prepared");
|
||||
showAutoStartNotification();
|
||||
showErrorNotification(ex.toString());
|
||||
// Retried on connectivity change
|
||||
} else {
|
||||
showErrorNotification(ex.toString());
|
||||
if (cmd == Command.start || cmd == Command.reload) {
|
||||
if (VpnService.prepare(ServiceSinkhole.this) == null) {
|
||||
Log.w(TAG, "VPN not prepared");
|
||||
showAutoStartNotification();
|
||||
showErrorNotification(ex.toString());
|
||||
// Retried on connectivity change
|
||||
} else {
|
||||
showErrorNotification(ex.toString());
|
||||
|
||||
// Disable firewall
|
||||
prefs.edit().putBoolean("enabled", false).apply();
|
||||
Widget.updateWidgets(ServiceSinkhole.this);
|
||||
}
|
||||
// Disable firewall
|
||||
prefs.edit().putBoolean("enabled", false).apply();
|
||||
Widget.updateWidgets(ServiceSinkhole.this);
|
||||
}
|
||||
} else
|
||||
showErrorNotification(ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue