media encryption mandatory

This commit is contained in:
Claire Rosset 2019-06-14 11:36:33 +02:00
parent 734b69c619
commit 42117c8a40
4 changed files with 28 additions and 0 deletions

View file

@ -47,6 +47,7 @@ public class CallSettingsFragment extends SettingsFragment {
private LinphonePreferences mPrefs;
private SwitchSetting mDeviceRingtone,
mMediaEncryptionMandatory,
mVibrateIncomingCall,
mDtmfSipInfo,
mDtmfRfc2833,
@ -100,6 +101,8 @@ public class CallSettingsFragment extends SettingsFragment {
mDndPermissionSettings =
mRootView.findViewById(R.id.pref_grant_read_dnd_settings_permission);
mMediaEncryptionMandatory = mRootView.findViewById(R.id.pref_media_encryption_mandatory);
}
private void setListeners() {
@ -212,6 +215,14 @@ public class CallSettingsFragment extends SettingsFragment {
new Intent("android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"));
}
});
mMediaEncryptionMandatory.setListener(
new SettingListenerBase() {
@Override
public void onBoolValueChanged(boolean newValue) {
mPrefs.setMediaEncryptionMandatory(newValue);
}
});
}
private void updateValues() {
@ -237,6 +248,8 @@ public class CallSettingsFragment extends SettingsFragment {
mDndPermissionSettings.setVisibility(
Version.sdkAboveOrEqual(Version.API23_MARSHMALLOW_60) ? View.VISIBLE : View.GONE);
mMediaEncryptionMandatory.setChecked(mPrefs.acceptMediaEncryptionMandatory());
setListeners();
}

View file

@ -452,6 +452,14 @@ public class LinphonePreferences {
// End of contact settings
// Call settings
public boolean acceptMediaEncryptionMandatory() {
return getLc().isMediaEncryptionMandatory();
}
public void setMediaEncryptionMandatory(boolean accept) {
getLc().setMediaEncryptionMandatory(accept);
}
public boolean acceptIncomingEarlyMedia() {
return getConfig().getBool("sip", "incoming_calls_early_media", false);
}

View file

@ -36,6 +36,12 @@
android:layout_height="wrap_content"
linphone:title="@string/pref_media_encryption" />
<org.linphone.settings.widget.SwitchSetting
android:id="@+id/pref_media_encryption_mandatory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
linphone:title="@string/pref_media_encryption_mandatory_title" />
<org.linphone.settings.widget.SwitchSetting
android:id="@+id/pref_sipinfo_dtmf"
android:layout_width="match_parent"

View file

@ -450,6 +450,7 @@
<string name="pref_accept_early_media">Accept early-media</string>
<string name="pref_grant_read_dnd_settings_permission_title">Do Not Disturb settings</string>
<string name="pref_grant_read_dnd_settings_permission_desc">We need you to grant use the access to the Do Not Disturb settings to correctly ring or not depending on the current policy</string>
<string name="pref_media_encryption_mandatory_title">Media encryption mandatory</string>
<!-- Chat settings -->
<string name="pref_chat_title">Chat</string>