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
|
@ -2,7 +2,7 @@
|
|||
<resources>
|
||||
<!-- Tutorial settings -->
|
||||
<bool name="show_tutorials_instead_of_app">false</bool> <!-- Be careful ! Setting this to true prevent the app from working ! It will only display tutorial activities -->
|
||||
|
||||
|
||||
<!-- Push notification settings -->
|
||||
<bool name="enable_push_id">true</bool>
|
||||
<string name="push_sender_id">622464153529</string>
|
||||
|
@ -18,9 +18,9 @@
|
|||
<bool name="replace_chat_by_about">false</bool>
|
||||
<bool name="display_about_in_settings">true</bool>
|
||||
<bool name="exit_button_on_dialer">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>
|
||||
<string name="setup_forced_proxy"></string>
|
||||
<bool name="setup_cancel_move_to_back">false</bool>
|
||||
|
@ -33,13 +33,13 @@
|
|||
<bool name="hide_accounts">false</bool>
|
||||
<bool name="display_account_wizard_at_first_start">true</bool>
|
||||
<bool name="use_linphone_server_ports">true</bool>
|
||||
|
||||
|
||||
<bool name="use_android_native_contact_edit_interface">false</bool>
|
||||
<!-- The following settings are only usefull if use_android_native_contact_edit_interface = false -->
|
||||
<bool name="hide_phone_numbers_in_editor">false</bool>
|
||||
<bool name="hide_sip_addresses_in_editor">false</bool>
|
||||
<bool name="forbid_empty_new_contact_in_editor">true</bool>
|
||||
|
||||
|
||||
<bool name="disable_animations">false</bool>
|
||||
<bool name="show_statusbar_only_on_dialer">true</bool>
|
||||
<bool name="lock_statusbar">false</bool>
|
||||
|
@ -48,13 +48,13 @@
|
|||
<bool name="never_display_sip_addresses">false</bool> <!-- To use only with the above setting set to true -->
|
||||
<bool name="display_messages_time_and_status">true</bool> <!-- Used to show the time of each message arrival -->
|
||||
<bool name="display_time_aside">false</bool> <!-- if display_messages_time = true, display time on the side of the message instead of below -->
|
||||
|
||||
|
||||
<bool name="enable_linphone_friends">false</bool>
|
||||
|
||||
|
||||
<bool name="display_call_stats">true</bool>
|
||||
<bool name="show_current_calls_above_video">false</bool>
|
||||
<bool name="disable_options_in_call">false</bool>
|
||||
|
||||
|
||||
<!-- Behavior Settings -->
|
||||
<bool name="pre_fill_email_in_wizard">true</bool> <!-- Set the email field of the wizard with one of the gmail account registered on the device -->
|
||||
<bool name="allow_chat_multiline">false</bool>
|
||||
|
@ -71,23 +71,23 @@
|
|||
<bool name="intercept_outgoing_gsm_calls">false</bool>
|
||||
<bool name="automatically_start_intercepted_outgoing_gsm_call">true</bool>
|
||||
<bool name="use_linphonecore_ringing">false</bool>
|
||||
|
||||
|
||||
<!-- This settings handle the behavior of the view waiting for the remote provisioning configuration to be done -->
|
||||
<bool name="display_sms_remote_provisioning_activity">false</bool>
|
||||
<bool name="forbid_app_usage_until_remote_provisioning_completed">false</bool>
|
||||
<bool name="display_confirmation_popup_after_first_configuration">false</bool>
|
||||
|
||||
|
||||
<bool name="hash_images_as_name_before_upload">true</bool>
|
||||
|
||||
|
||||
<bool name="enable_log_collect">false</bool>
|
||||
<bool name="disable_every_log">false</bool>
|
||||
<bool name="disable_all_security_features_for_markets">false</bool> <!-- Disable TLS/SRTP/ZRTP -->
|
||||
<bool name="disable_all_patented_codecs_for_markets">false</bool> <!-- Disable MPEG4/H264 -->
|
||||
|
||||
|
||||
<string name="about_bugreport_email">linphone-android@belledonne-communications.com</string>
|
||||
<string name="temp_photo_name">linphone-android-photo-temp.jpg</string>
|
||||
<string name="temp_photo_name_with_date">linphone-android-photo-%s.jpg</string>
|
||||
|
||||
|
||||
<bool name="enable_call_notification">true</bool>
|
||||
</resources>
|
||||
|
||||
|
||||
|
|
|
@ -495,9 +495,16 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
|||
}
|
||||
setListPreferenceValues(pref, entries, values);
|
||||
|
||||
pref.setSummary(mPrefs.getAccountTransportString(n));
|
||||
pref.setDefaultValue(mPrefs.getAccountTransportKey(n));
|
||||
pref.setValueIndex(entries.indexOf(mPrefs.getAccountTransportString(n)));
|
||||
if (! isNewAccount) {
|
||||
pref.setSummary(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) {
|
||||
|
|
|
@ -283,6 +283,12 @@ public class LinphonePreferences {
|
|||
* @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 proxy = "sip:";
|
||||
if (tempProxy == null) {
|
||||
|
@ -785,11 +791,11 @@ public class LinphonePreferences {
|
|||
public void sendDTMFsAsSipInfo(boolean use) {
|
||||
getLc().setUseSipInfoForDtmfs(use);
|
||||
}
|
||||
|
||||
|
||||
public String getVoiceMailUri() {
|
||||
return getConfig().getString("app", "voice_mail", null);
|
||||
}
|
||||
|
||||
|
||||
public void setVoiceMailUri(String uri) {
|
||||
getConfig().setString("app", "voice_mail", uri);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue