Do not save account if username and/or domain not provided
This commit is contained in:
parent
1105425508
commit
d0c0d1c433
3 changed files with 32 additions and 19 deletions
|
@ -20,7 +20,7 @@
|
||||||
<bool name="exit_button_on_dialer">false</bool>
|
<bool name="exit_button_on_dialer">false</bool>
|
||||||
|
|
||||||
<bool name="hide_camera_settings">false</bool>
|
<bool name="hide_camera_settings">false</bool>
|
||||||
<bool name="replace_wizard_with_old_interface">false</bool>
|
<bool name="replace_wizard_with_old_interface">true</bool>
|
||||||
<bool name="hide_wizard">false</bool>
|
<bool name="hide_wizard">false</bool>
|
||||||
<string name="setup_forced_proxy"></string>
|
<string name="setup_forced_proxy"></string>
|
||||||
<bool name="setup_cancel_move_to_back">false</bool>
|
<bool name="setup_cancel_move_to_back">false</bool>
|
||||||
|
|
|
@ -495,9 +495,16 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
||||||
}
|
}
|
||||||
setListPreferenceValues(pref, entries, values);
|
setListPreferenceValues(pref, entries, values);
|
||||||
|
|
||||||
pref.setSummary(mPrefs.getAccountTransportString(n));
|
if (! isNewAccount) {
|
||||||
pref.setDefaultValue(mPrefs.getAccountTransportKey(n));
|
pref.setSummary(mPrefs.getAccountTransportString(n));
|
||||||
pref.setValueIndex(entries.indexOf(mPrefs.getAccountTransportString(n)));
|
pref.setDefaultValue(mPrefs.getAccountTransportKey(n));
|
||||||
|
pref.setValueIndex(entries.indexOf(mPrefs.getAccountTransportString(n)));
|
||||||
|
} else {
|
||||||
|
|
||||||
|
pref.setSummary(getString(R.string.pref_transport_udp));
|
||||||
|
pref.setDefaultValue(getString(R.string.pref_transport_udp));
|
||||||
|
pref.setValueIndex(entries.indexOf(getString(R.string.pref_transport_udp)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setListPreferenceValues(ListPreference pref, List<CharSequence> entries, List<CharSequence> values) {
|
private static void setListPreferenceValues(ListPreference pref, List<CharSequence> entries, List<CharSequence> values) {
|
||||||
|
|
|
@ -283,6 +283,12 @@ public class LinphonePreferences {
|
||||||
* @throws LinphoneCoreException
|
* @throws LinphoneCoreException
|
||||||
*/
|
*/
|
||||||
public void saveNewAccount() throws LinphoneCoreException {
|
public void saveNewAccount() throws LinphoneCoreException {
|
||||||
|
|
||||||
|
if (tempUsername == null || tempUsername.length() < 1 || tempDomain == null || tempDomain.length() < 1) {
|
||||||
|
Log.w("Skipping account save: username or domain not provided");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String identity = "sip:" + tempUsername + "@" + tempDomain;
|
String identity = "sip:" + tempUsername + "@" + tempDomain;
|
||||||
String proxy = "sip:";
|
String proxy = "sip:";
|
||||||
if (tempProxy == null) {
|
if (tempProxy == null) {
|
||||||
|
|
Loading…
Reference in a new issue