Merge "Alert user when saving empty SIP profile."
diff --git a/sip/res/values/strings.xml b/sip/res/values/strings.xml
index b220d17..6ac7c8d 100644
--- a/sip/res/values/strings.xml
+++ b/sip/res/values/strings.xml
@@ -133,6 +133,8 @@
<!-- Hint to hide the advanced settings section. [CHAR LIMIT=NONE] -->
<string name="advanced_settings_hide">▽ Touch to hide all</string>
+ <!-- Text in an alert dialog telling the user that all input fields can not be left blank. [CHAR LIMIT=NONE] -->
+ <string name="all_empty_alert">Enter details of new SIP account.</string>
<!-- Text in an alert dialog telling the user that some input field (name of which is also part of the strings being translated above) is required and can not be left blank. [CHAR LIMIT=NONE] -->
<string name="empty_alert"><xliff:g id="input_field_name" example="Username, Password...">%s</xliff:g> is required and can\'t be left blank.</string>
<!-- Showing that port number is out of range in an alert dialog. [CHAR LIMIT=NONE] -->
diff --git a/sip/src/com/android/services/telephony/sip/SipEditor.java b/sip/src/com/android/services/telephony/sip/SipEditor.java
index 6304220..6ba78c9 100644
--- a/sip/src/com/android/services/telephony/sip/SipEditor.java
+++ b/sip/src/com/android/services/telephony/sip/SipEditor.java
@@ -342,9 +342,12 @@
}
}
- if (allEmpty || !mUpdateRequired) {
+ if (!mUpdateRequired) {
finish();
return;
+ } else if (allEmpty) {
+ showAlert(getString(R.string.all_empty_alert));
+ return;
} else if (firstEmptyFieldTitle != null) {
showAlert(getString(R.string.empty_alert, firstEmptyFieldTitle));
return;