1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-24 11:51:30 +00:00

Fix "Wifi only" / "Charging only" not being applied immediately

This commit is contained in:
Martin Carpella 2015-11-14 23:49:34 +01:00
parent 46a3eb08fc
commit 1e64f88269
2 changed files with 3 additions and 3 deletions

View file

@ -227,9 +227,7 @@ public class SettingsFragment extends PreferenceFragment
boolean requireRestart = false; boolean requireRestart = false;
if (preference.equals(mSyncOnlyCharging) || preference.equals(mSyncOnlyWifi)) { if (preference.equals(mAlwaysRunInBackground)) {
mSyncthingService.updateState();
} else if (preference.equals(mAlwaysRunInBackground)) {
boolean value = (Boolean) o; boolean value = (Boolean) o;
preference.setSummary((value) preference.setSummary((value)
? R.string.always_run_in_background_enabled ? R.string.always_run_in_background_enabled

View file

@ -268,6 +268,8 @@ public class SyncthingService extends Service implements
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals(PREF_NOTIFICATION_TYPE)) if (key.equals(PREF_NOTIFICATION_TYPE))
updateNotification(); updateNotification();
else if (key.equals(PREF_SYNC_ONLY_CHARGING) || key.equals(PREF_SYNC_ONLY_WIFI))
updateState();
} }
/** /**