mirror of https://github.com/M66B/NetGuard.git
Reload when enabled
This commit is contained in:
parent
5f705da814
commit
ac141afe5d
|
@ -425,6 +425,8 @@ public class SinkholeService extends VpnService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void reload(String network, Context context) {
|
public static void reload(String network, Context context) {
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
if (prefs.getBoolean("enabled", false))
|
||||||
if (network == null || ("wifi".equals(network) ? !Util.isMetered(context) : Util.isMetered(context))) {
|
if (network == null || ("wifi".equals(network) ? !Util.isMetered(context) : Util.isMetered(context))) {
|
||||||
Intent intent = new Intent(context, SinkholeService.class);
|
Intent intent = new Intent(context, SinkholeService.class);
|
||||||
intent.putExtra(EXTRA_COMMAND, Command.reload);
|
intent.putExtra(EXTRA_COMMAND, Command.reload);
|
||||||
|
|
Loading…
Reference in New Issue