1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-02-24 07:10:50 +00:00

Revert "Removed check if VPN is prepared"

This reverts commit 07fd058546.
This commit is contained in:
M66B 2016-07-02 17:35:39 +02:00
parent 53d41d17e6
commit a419aab396

View file

@ -274,6 +274,15 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
Log.i(TAG, "Executing intent=" + intent + " command=" + cmd + " reason=" + reason +
" 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
if (cmd != Command.stop)
if (!user_foreground) {