mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Added download & apply button next to remote provisioning URL advanced settings
This commit is contained in:
parent
486f905d65
commit
1aeb917d62
5 changed files with 38 additions and 2 deletions
|
|
@ -552,7 +552,7 @@ class AccountCreationViewModel @UiThread constructor() : ViewModel() {
|
|||
operationInProgress.postValue(false)
|
||||
}
|
||||
|
||||
val status = accountCreator.createAccount()
|
||||
val status = accountCreator.createAccount() // TODO FIXME: use createPushAccount instead ?
|
||||
Log.i("$TAG createAccount returned $status")
|
||||
if (status != AccountCreator.Status.RequestOk) {
|
||||
Log.e("$TAG Can't create account [$status]")
|
||||
|
|
|
|||
|
|
@ -389,4 +389,17 @@ class SettingsViewModel @UiThread constructor() : ViewModel() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@UiThread
|
||||
fun downloadAndApplyRemoteProvisioning() {
|
||||
Log.i("$TAG Updating remote provisioning URI now and then download/apply it")
|
||||
updateRemoteProvisioningUrl()
|
||||
coreContext.postOnCoreThread {
|
||||
Log.i("$TAG Restarting the Core to apply configuration changes")
|
||||
coreContext.core.stop()
|
||||
Log.i("$TAG Core has been stopped, restarting it")
|
||||
coreContext.core.start()
|
||||
Log.i("$TAG Core has been restarted")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,13 +112,34 @@
|
|||
android:maxLines="1"
|
||||
android:background="@drawable/edit_text_background"
|
||||
android:inputType="text|textUri"
|
||||
android:hint="@string/settings_advanced_remote_provisioning_url"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintWidth_max="@dimen/text_input_max_width"
|
||||
app:layout_constraintTop_toBottomOf="@id/remote_provisioning_label"
|
||||
app:layout_constraintStart_toStartOf="@id/remote_provisioning_label"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<!-- TODO: apply button ? -->
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/tertiary_button_label_style"
|
||||
android:id="@+id/show_config_file"
|
||||
android:onClick="@{() -> viewModel.downloadAndApplyRemoteProvisioning()}"
|
||||
android:enabled="@{viewModel.remoteProvisioningUrl.length() != 0, default=false}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/tertiary_button_background"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/settings_advanced_download_apply_remote_provisioning"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/remote_provisioning"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -261,6 +261,7 @@
|
|||
<string name="settings_advanced_title">Paramètres avancés</string>
|
||||
<string name="settings_advanced_keep_alive_service_title">Garder l\'app en vie via un Service</string>
|
||||
<string name="settings_advanced_remote_provisioning_url">URL de configuration distante</string>
|
||||
<string name="settings_advanced_download_apply_remote_provisioning">Télécharger & appliquer</string>
|
||||
|
||||
<!-- Account profile & settings -->
|
||||
<string name="manage_account_title">Votre compte</string>
|
||||
|
|
|
|||
|
|
@ -296,6 +296,7 @@
|
|||
<string name="settings_advanced_title">Advanced settings</string>
|
||||
<string name="settings_advanced_keep_alive_service_title">Keep app alive using Service</string>
|
||||
<string name="settings_advanced_remote_provisioning_url">Remote provisioning URL</string>
|
||||
<string name="settings_advanced_download_apply_remote_provisioning">Download & apply</string>
|
||||
|
||||
<!-- Account profile & settings -->
|
||||
<string name="manage_account_title">Manage account</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue