Small improvement

pull/147/head
M66B 6 years ago
parent 36920e2404
commit ab68b1f696

@ -33,10 +33,11 @@ public class ServiceExternal extends IntentService {
else if (ACTION_DISABLE.equals(intent.getAction())) else if (ACTION_DISABLE.equals(intent.getAction()))
enabled = false; enabled = false;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean previous = prefs.getBoolean("enabled", true);
if (enabled != null) { if (enabled != null) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().putBoolean("schedule", false).apply(); prefs.edit().putBoolean("schedule", false).apply();
boolean previous = prefs.getBoolean("enabled", true);
if (!enabled.equals(previous)) { if (!enabled.equals(previous)) {
prefs.edit().putBoolean("enabled", enabled).apply(); prefs.edit().putBoolean("enabled", enabled).apply();
ServiceSynchronize.reload(this, "external"); ServiceSynchronize.reload(this, "external");

Loading…
Cancel
Save