Enhance video preference

This commit is contained in:
Erwan Croze 2018-06-11 13:43:43 +02:00
parent 12aca6fb66
commit 6032adb676

View file

@ -840,6 +840,12 @@ public class SettingsFragment extends PreferencesListFragment {
public boolean onPreferenceChange(Preference preference, Object newValue) {
boolean enable = (Boolean) newValue;
mPrefs.enableVideo(enable);
if (!enable) {
mPrefs.setInitiateVideoCall(false);
mPrefs.setAutomaticallyAcceptVideoRequests(false);
((CheckBoxPreference) findPreference(getString(R.string.pref_video_initiate_call_with_video_key))).setChecked(mPrefs.shouldInitiateVideoCall());
((CheckBoxPreference) findPreference(getString(R.string.pref_video_automatically_accept_video_key))).setChecked(mPrefs.shouldAutomaticallyAcceptVideoRequests());
}
return true;
}
});