Adding prefix dial on login

This commit is contained in:
Erwan Croze 2016-10-20 15:07:42 +02:00
parent 087d8f49fb
commit a1dc1a7132
4 changed files with 17 additions and 9 deletions

View file

@ -27,6 +27,7 @@ import org.linphone.compatibility.Compatibility;
import org.linphone.core.LinphoneAccountCreator;
import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneProxyConfig;
import org.linphone.mediastream.Log;
import android.app.AlertDialog;
import android.app.Fragment;
@ -168,8 +169,9 @@ public class LinphoneLoginFragment extends Fragment implements CompoundButton.On
apply.setEnabled(true);
return;
}
AssistantActivity.instance().linphoneLogIn(login.getText().toString(), password.getText().toString(), null, null, getResources().getBoolean(R.bool.assistant_account_validation_mandatory));
apply.setEnabled(true);
accountCreator.setUsername(login.getText().toString());
accountCreator.setPassword(password.getText().toString());
accountCreator.isAccountUsed();
}
private LinphoneAccountCreator.Status getPhoneNumberStatus() {
@ -310,26 +312,32 @@ public class LinphoneLoginFragment extends Fragment implements CompoundButton.On
@Override
public void onAccountCreatorIsAccountUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
if (status.equals(LinphoneAccountCreator.Status.AccountExist) || status.equals(LinphoneAccountCreator.Status.AccountExistWithAlias)) {
String phone = accountCreator.getPhoneNumber();
String dial = null;
if (phone != null && phone.length() > 0)
dial = accountCreator.getPrefix(phone);
AssistantActivity.instance().linphoneLogIn(login.getText().toString(), password.getText().toString(), dial, null, getResources().getBoolean(R.bool.assistant_account_validation_mandatory));
} else {
apply.setEnabled(true);
LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForStatus(status), AssistantActivity.instance());
}
}
@Override
public void onAccountCreatorAccountCreated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
}
@Override
public void onAccountCreatorAccountActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
}
@Override
public void onAccountCreatorAccountLinkedWithPhoneNumber(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
}
@Override
public void onAccountCreatorPhoneNumberLinkActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
}
@Override

@ -1 +1 @@
Subproject commit e82e6080ffbfc5bccab6c04060071d3891badc0b
Subproject commit 7e428aeacbfcf991845a8e4bf0b5e0dd28c4cae3

@ -1 +1 @@
Subproject commit a25069edd014d2b8aebb96fdecc1487a6b4d7965
Subproject commit 08ff74f6fe16c3dcafac66c48b6df149142f3616

@ -1 +1 @@
Subproject commit 5529671088b6711b90c5abc21d972a3d20e5f124
Subproject commit 36554835ff3b775cc88f3fb18b9fc980c8c2b858