mirror of https://github.com/M66B/NetGuard.git
Reload when enabled
This commit is contained in:
parent
5f705da814
commit
ac141afe5d
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue