Skip to content

Commit

Permalink
Reload when enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Nov 4, 2015
1 parent 5f705da commit ac141af
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/src/main/java/eu/faircode/netguard/SinkholeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,13 @@ public static void start(Context context) {
}

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) {
Expand Down

0 comments on commit ac141af

Please sign in to comment.