Reload when enabled

This commit is contained in:
M66B 2015-11-04 23:45:47 +01:00
parent 5f705da814
commit ac141afe5d
1 changed files with 7 additions and 5 deletions

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