1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-02-22 14:21:01 +00:00

Reload when enabled

This commit is contained in:
M66B 2015-11-04 23:45:47 +01:00
parent 5f705da814
commit ac141afe5d

View file

@ -425,11 +425,13 @@ public class SinkholeService extends VpnService {
}
public static void reload(String network, Context context) {
if (network == null || ("wifi".equals(network) ? !Util.isMetered(context) : Util.isMetered(context))) {
Intent intent = new Intent(context, SinkholeService.class);
intent.putExtra(EXTRA_COMMAND, Command.reload);
context.startService(intent);
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.getBoolean("enabled", false))
if (network == null || ("wifi".equals(network) ? !Util.isMetered(context) : Util.isMetered(context))) {
Intent intent = new Intent(context, SinkholeService.class);
intent.putExtra(EXTRA_COMMAND, Command.reload);
context.startService(intent);
}
}
public static void stop(Context context) {