mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-05-03 15:26:27 +00:00
Fixed NAT policy account settings changes not saved/restored when app restarts
This commit is contained in:
parent
b511867e62
commit
54a65f713a
2 changed files with 11 additions and 14 deletions
|
|
@ -14,8 +14,7 @@ static def getPackageName() {
|
|||
|
||||
def firebaseEnabled = new File(projectDir.absolutePath +'/google-services.json').exists()
|
||||
|
||||
def crashlyticsEnabled = false//new File(projectDir.absolutePath +'/google-services.json').exists() && new File(LinphoneSdkBuildDir + '/libs/').exists() && new File(LinphoneSdkBuildDir + '/libs-debug/').exists()
|
||||
|
||||
def crashlyticsEnabled = new File(projectDir.absolutePath +'/google-services.json').exists() && new File(LinphoneSdkBuildDir + '/libs/').exists() && new File(LinphoneSdkBuildDir + '/libs-debug/').exists()
|
||||
|
||||
if (firebaseEnabled) {
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
|
|
|||
|
|
@ -312,19 +312,14 @@ class AccountSettingsViewModel(val account: Account) : GenericSettingsViewModel(
|
|||
val stunServerListener = object : SettingListenerStub() {
|
||||
override fun onTextValueChanged(newValue: String) {
|
||||
val params = account.params.clone()
|
||||
if (params.natPolicy == null) {
|
||||
Log.w("[Account Settings] No NAT Policy object in account params yet")
|
||||
val natPolicy = core.createNatPolicy()
|
||||
natPolicy.stunServer = newValue
|
||||
natPolicy.isStunEnabled = newValue.isNotEmpty()
|
||||
params.natPolicy = natPolicy
|
||||
} else {
|
||||
params.natPolicy?.stunServer = newValue
|
||||
params.natPolicy?.isStunEnabled = newValue.isNotEmpty()
|
||||
}
|
||||
val natPolicy = params.natPolicy
|
||||
val newNatPolicy = natPolicy?.clone() ?: core.createNatPolicy()
|
||||
newNatPolicy.stunServer = newValue
|
||||
newNatPolicy.isStunEnabled = newValue.isNotEmpty()
|
||||
params.natPolicy = newNatPolicy
|
||||
account.params = params
|
||||
if (newValue.isEmpty()) ice.value = false
|
||||
stunServer.value = newValue
|
||||
account.params = params
|
||||
}
|
||||
}
|
||||
val stunServer = MutableLiveData<String>()
|
||||
|
|
@ -332,7 +327,10 @@ class AccountSettingsViewModel(val account: Account) : GenericSettingsViewModel(
|
|||
val iceListener = object : SettingListenerStub() {
|
||||
override fun onBoolValueChanged(newValue: Boolean) {
|
||||
val params = account.params.clone()
|
||||
params.natPolicy?.isIceEnabled = newValue
|
||||
val natPolicy = params.natPolicy
|
||||
val newNatPolicy = natPolicy?.clone() ?: core.createNatPolicy()
|
||||
newNatPolicy.isIceEnabled = newValue
|
||||
params.natPolicy = newNatPolicy
|
||||
account.params = params
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue