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:
parent
46a3eb08fc
commit
1e64f88269
2 changed files with 3 additions and 3 deletions
|
@ -227,9 +227,7 @@ public class SettingsFragment extends PreferenceFragment
|
|||
|
||||
boolean requireRestart = false;
|
||||
|
||||
if (preference.equals(mSyncOnlyCharging) || preference.equals(mSyncOnlyWifi)) {
|
||||
mSyncthingService.updateState();
|
||||
} else if (preference.equals(mAlwaysRunInBackground)) {
|
||||
if (preference.equals(mAlwaysRunInBackground)) {
|
||||
boolean value = (Boolean) o;
|
||||
preference.setSummary((value)
|
||||
? R.string.always_run_in_background_enabled
|
||||
|
|
|
@ -268,6 +268,8 @@ public class SyncthingService extends Service implements
|
|||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
if (key.equals(PREF_NOTIFICATION_TYPE))
|
||||
updateNotification();
|
||||
else if (key.equals(PREF_SYNC_ONLY_CHARGING) || key.equals(PREF_SYNC_ONLY_WIFI))
|
||||
updateState();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue