diff --git a/Makefile b/Makefile
index 803312d11..05ff76077 100644
--- a/Makefile
+++ b/Makefile
@@ -36,10 +36,10 @@ BUILD_UPNP=1
BUILD_REMOTE_PROVISIONING=1
BUILD_X264=1
BUILD_AMRNB=full # 0, light or full
-BUILD_AMRWB=0
+BUILD_AMRWB=1
BUILD_GPLV3_ZRTP=1
BUILD_SILK=1
-BUILD_G729=0
+BUILD_G729=1
BUILD_TUNNEL=0
BUILD_WEBRTC_AECM=1
BUILD_OPUS=1
diff --git a/res/layout/setup_wizard.xml b/res/layout/setup_wizard.xml
index 3c4ecbc37..1d3274c50 100644
--- a/res/layout/setup_wizard.xml
+++ b/res/layout/setup_wizard.xml
@@ -97,7 +97,6 @@
android:id="@+id/setup_password_confirm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@id/setup_password"
android:hint="@string/setup_password_confirm_hint"
android:inputType="textPassword"
android:paddingLeft="10dp"
diff --git a/res/values-FR/strings.xml b/res/values-FR/strings.xml
index 782a275b1..96f3f1bcc 100644
--- a/res/values-FR/strings.xml
+++ b/res/values-FR/strings.xml
@@ -384,6 +384,7 @@
Télécharger ma configuration
Cet assistant va télécharger une configuration existante.
addresse où télécharger la configuration
+ Votre nom d\'utilisateur sera %s (les majuscules sont interdites). Acceptez-vous ?
Accepter
Refuser
diff --git a/res/values-RU/strings.xml b/res/values-RU/strings.xml
index 23f635e57..5c13eb260 100755
--- a/res/values-RU/strings.xml
+++ b/res/values-RU/strings.xml
@@ -439,6 +439,7 @@
Download provisioning
This assistant will download an existing configuration.
provisioning url
+ Your username will be %s (uppercase characters are not allowed). Do you accept ?
Accept
Deny
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 138b4ad83..5b70909ba 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -439,6 +439,7 @@
Download provisioning
This assistant will download an existing configuration.
provisioning url
+ Your username will be %s (uppercase characters are not allowed). Do you accept ?
Accept
Deny
diff --git a/src/org/linphone/PreferencesMigrator.java b/src/org/linphone/PreferencesMigrator.java
index bff4478aa..db2dd2f91 100644
--- a/src/org/linphone/PreferencesMigrator.java
+++ b/src/org/linphone/PreferencesMigrator.java
@@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCoreException;
-import org.linphone.mediastream.Log;
import android.content.Context;
import android.content.SharedPreferences;
diff --git a/src/org/linphone/setup/WizardFragment.java b/src/org/linphone/setup/WizardFragment.java
index 9f30ebb52..230ed4360 100644
--- a/src/org/linphone/setup/WizardFragment.java
+++ b/src/org/linphone/setup/WizardFragment.java
@@ -18,6 +18,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
import java.net.URL;
+import java.util.Locale;
import java.util.regex.Pattern;
import org.linphone.LinphoneManager;
@@ -26,11 +27,15 @@ import org.linphone.R;
import android.accounts.Account;
import android.accounts.AccountManager;
+import android.app.AlertDialog;
import android.content.Context;
+import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.text.Editable;
+import android.text.InputFilter;
+import android.text.Spanned;
import android.text.TextWatcher;
import android.util.Patterns;
import android.view.LayoutInflater;
@@ -57,6 +62,9 @@ public class WizardFragment extends Fragment {
private boolean confirmPasswordOk = false;
private ImageView createAccount;
private TextView errorMessage;
+ private char[] acceptedChars = new char[]{ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '_', '-' };
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@@ -65,6 +73,20 @@ public class WizardFragment extends Fragment {
username = (EditText) view.findViewById(R.id.setup_username);
ImageView usernameOkIV = (ImageView) view.findViewById(R.id.setup_username_ok);
addXMLRPCUsernameHandler(username, usernameOkIV);
+ InputFilter filter = new InputFilter(){
+ @Override
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
+ if (end > start) {
+ for (int index = start; index < end; index++) {
+ if (!new String(acceptedChars).contains(String.valueOf(source.charAt(index)))) {
+ return "";
+ }
+ }
+ }
+ return null;
+ }
+ };
+ username.setFilters(new InputFilter[] { filter });
password = (EditText) view.findViewById(R.id.setup_password);
passwordConfirm = (EditText) view.findViewById(R.id.setup_password_confirm);
@@ -85,7 +107,19 @@ public class WizardFragment extends Fragment {
createAccount.setEnabled(false);
createAccount.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
- createAccount(username.getText().toString(), password.getText().toString(), email.getText().toString(), false);
+ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ builder.setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ createAccount(username.getText().toString().toLowerCase(Locale.getDefault()), password.getText().toString(), email.getText().toString(), false);
+ }
+ });
+ builder.setNegativeButton(R.string.button_cancel, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ }
+ });
+ builder.setMessage(getString(R.string.setup_confirm_username).replace("%s", username.getText().toString().toLowerCase(Locale.getDefault())));
+ AlertDialog dialog = builder.create();
+ dialog.show();
}
});
@@ -228,22 +262,20 @@ public class WizardFragment extends Fragment {
private void addXMLRPCUsernameHandler(final EditText field, final ImageView icon) {
field.addTextChangedListener(new TextWatcher() {
- public void afterTextChanged(Editable arg0) {
+ public void afterTextChanged(Editable s) {
}
- public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
- public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
- {
+ public void onTextChanged(CharSequence s, int start, int count, int after) {
usernameOk = false;
- if (isUsernameCorrect(field.getText().toString()))
- {
- isUsernameRegistred(field.getText().toString(), icon);
- }
- else {
+ String username = field.getText().toString().toLowerCase(Locale.getDefault());
+ if (isUsernameCorrect(username)) {
+ isUsernameRegistred(username, icon);
+ } else {
errorMessage.setText(R.string.wizard_username_incorrect);
icon.setImageResource(R.drawable.wizard_notok);
}
@@ -253,15 +285,15 @@ public class WizardFragment extends Fragment {
private void addXMLRPCEmailHandler(final EditText field, final ImageView icon) {
field.addTextChangedListener(new TextWatcher() {
- public void afterTextChanged(Editable arg0) {
+ public void afterTextChanged(Editable s) {
}
- public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
- public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
+ public void onTextChanged(CharSequence s, int start, int count, int after)
{
emailOk = false;
if (isEmailCorrect(field.getText().toString())) {
@@ -280,15 +312,15 @@ public class WizardFragment extends Fragment {
private void addXMLRPCPasswordHandler(final EditText field1, final ImageView icon) {
TextWatcher passwordListener = new TextWatcher() {
- public void afterTextChanged(Editable arg0) {
+ public void afterTextChanged(Editable s) {
}
- public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
- public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
+ public void onTextChanged(CharSequence s, int start, int count, int after)
{
passwordOk = false;
if (isPasswordCorrect(field1.getText().toString())) {
@@ -309,15 +341,15 @@ public class WizardFragment extends Fragment {
private void addXMLRPCConfirmPasswordHandler(final EditText field1, final EditText field2, final ImageView icon) {
TextWatcher passwordListener = new TextWatcher() {
- public void afterTextChanged(Editable arg0) {
+ public void afterTextChanged(Editable s) {
}
- public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
- public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
+ public void onTextChanged(CharSequence s, int start, int count, int after)
{
confirmPasswordOk = false;
if (field1.getText().toString().equals(field2.getText().toString())) {