mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-24 15:21:19 +00:00
Revert "Removed check if VPN is prepared"
This reverts commit 07fd058546
.
This commit is contained in:
parent
53d41d17e6
commit
a419aab396
1 changed files with 9 additions and 0 deletions
|
@ -274,6 +274,15 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
||||||
Log.i(TAG, "Executing intent=" + intent + " command=" + cmd + " reason=" + reason +
|
Log.i(TAG, "Executing intent=" + intent + " command=" + cmd + " reason=" + reason +
|
||||||
" vpn=" + (vpn != null) + " user=" + (Process.myUid() / 100000));
|
" vpn=" + (vpn != null) + " user=" + (Process.myUid() / 100000));
|
||||||
|
|
||||||
|
// Check if prepared
|
||||||
|
if (cmd == Command.start || cmd == Command.reload)
|
||||||
|
if (VpnService.prepare(ServiceSinkhole.this) != null) {
|
||||||
|
Log.w(TAG, "VPN not prepared");
|
||||||
|
prefs.edit().putBoolean("enabled", false).apply();
|
||||||
|
showAutoStartNotification();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if foreground
|
// Check if foreground
|
||||||
if (cmd != Command.stop)
|
if (cmd != Command.stop)
|
||||||
if (!user_foreground) {
|
if (!user_foreground) {
|
||||||
|
|
Loading…
Reference in a new issue