Fix minor issue in settings display + added two custom param related to remote provisioning

This commit is contained in:
Sylvain Berfini 2014-02-26 15:26:05 +01:00
parent 7d0405e4f3
commit de5318f089
3 changed files with 27 additions and 8 deletions

View file

@ -29,6 +29,8 @@
<bool name="hide_linphone_accounts_wizard">false</bool> <bool name="hide_linphone_accounts_wizard">false</bool>
<bool name="hide_generic_accounts_wizard">false</bool> <bool name="hide_generic_accounts_wizard">false</bool>
<bool name="hide_remote_provisioning_in_wizard">false</bool> <bool name="hide_remote_provisioning_in_wizard">false</bool>
<bool name="remove_remote_provisioning_after_success">true</bool>
<bool name="show_login_wizard_after_remote_provisioning_without_credentials">true</bool>
<bool name="hide_accounts">false</bool> <bool name="hide_accounts">false</bool>
<bool name="display_account_wizard_at_first_start">true</bool> <bool name="display_account_wizard_at_first_start">true</bool>
<bool name="use_linphone_server_ports">true</bool> <bool name="use_linphone_server_ports">true</bool>

View file

@ -1464,5 +1464,17 @@ public class LinphoneManager implements LinphoneCoreListener {
public void configuringStatus(LinphoneCore lc, public void configuringStatus(LinphoneCore lc,
RemoteProvisioningState state, String message) { RemoteProvisioningState state, String message) {
Log.d("Remote provisioning status = " + state.toString() + " (" + message + ")"); Log.d("Remote provisioning status = " + state.toString() + " (" + message + ")");
if (state == RemoteProvisioningState.ConfiguringSuccessful) {
if (mR.getBoolean(R.bool.remove_remote_provisioning_after_success)) {
LinphonePreferences.instance().setRemoteProvisioningUrl(null);
}
if (mR.getBoolean(R.bool.show_login_wizard_after_remote_provisioning_without_credentials)) {
if (lc.getProxyConfigList() == null || lc.getProxyConfigList().length == 0) {
}
}
}
} }
} }

View file

@ -42,6 +42,7 @@ import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.preference.CheckBoxPreference; import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.ListPreference; import android.preference.ListPreference;
import android.preference.Preference; import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener; import android.preference.Preference.OnPreferenceChangeListener;
@ -222,14 +223,18 @@ public class SettingsFragment extends PreferencesListFragment implements EcCalib
} }
private void setPreferenceDefaultValueAndSummary(int pref, String value) { private void setPreferenceDefaultValueAndSummary(int pref, String value) {
findPreference(getString(pref)).setDefaultValue(value); EditTextPreference etPref = (EditTextPreference) findPreference(getString(pref));
findPreference(getString(pref)).setSummary(value); etPref.setText(value);
etPref.setSummary(value);
} }
private void initTunnelSettings() { private void initTunnelSettings() {
setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_host_key, mPrefs.getTunnelHost()); setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_host_key, mPrefs.getTunnelHost());
setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_port_key, String.valueOf(mPrefs.getTunnelPort())); setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_port_key, String.valueOf(mPrefs.getTunnelPort()));
setPreferenceDefaultValueAndSummary(R.string.pref_tunnel_mode_key, mPrefs.getTunnelMode()); ListPreference tunnelModePref = (ListPreference) findPreference(getString(R.string.pref_tunnel_mode_key));
String tunnelMode = mPrefs.getTunnelMode();
tunnelModePref.setSummary(tunnelMode);
tunnelModePref.setValue(tunnelMode);
} }
private void setTunnelPreferencesListener() { private void setTunnelPreferencesListener() {
@ -375,7 +380,7 @@ public class SettingsFragment extends PreferencesListFragment implements EcCalib
key = getString(R.string.pref_media_encryption_key_srtp); key = getString(R.string.pref_media_encryption_key_srtp);
else if (value.toString().equals(getString(R.string.media_encryption_zrtp))) else if (value.toString().equals(getString(R.string.media_encryption_zrtp)))
key = getString(R.string.pref_media_encryption_key_zrtp); key = getString(R.string.pref_media_encryption_key_zrtp);
pref.setDefaultValue(key); pref.setValue(key);
} }
private void initializePreferredVideoSizePreferences(ListPreference pref) { private void initializePreferredVideoSizePreferences(ListPreference pref) {
@ -627,14 +632,14 @@ public class SettingsFragment extends PreferencesListFragment implements EcCalib
randomPort.setChecked(mPrefs.isUsingRandomPort()); randomPort.setChecked(mPrefs.isUsingRandomPort());
// Disable sip port choice if port is random // Disable sip port choice if port is random
Preference sipPort = findPreference(getString(R.string.pref_sip_port_key)); EditTextPreference sipPort = (EditTextPreference) findPreference(getString(R.string.pref_sip_port_key));
sipPort.setEnabled(!randomPort.isChecked()); sipPort.setEnabled(!randomPort.isChecked());
sipPort.setSummary(mPrefs.getSipPort()); sipPort.setSummary(mPrefs.getSipPort());
sipPort.setDefaultValue(mPrefs.getSipPort()); sipPort.setText(mPrefs.getSipPort());
Preference stun = findPreference(getString(R.string.pref_stun_server_key)); EditTextPreference stun = (EditTextPreference) findPreference(getString(R.string.pref_stun_server_key));
stun.setSummary(mPrefs.getStunServer()); stun.setSummary(mPrefs.getStunServer());
stun.setDefaultValue(mPrefs.getStunServer()); stun.setText(mPrefs.getStunServer());
((CheckBoxPreference) findPreference(getString(R.string.pref_push_notification_key))).setChecked(mPrefs.isPushNotificationEnabled()); ((CheckBoxPreference) findPreference(getString(R.string.pref_push_notification_key))).setChecked(mPrefs.isPushNotificationEnabled());
((CheckBoxPreference) findPreference(getString(R.string.pref_ipv6_key))).setChecked(mPrefs.isUsingIpv6()); ((CheckBoxPreference) findPreference(getString(R.string.pref_ipv6_key))).setChecked(mPrefs.isUsingIpv6());