Changes for assistant : fixed SHA-256, improved logs & use of xml default configs
This commit is contained in:
parent
aeb92f6b28
commit
2d3744fdbd
10 changed files with 125 additions and 30 deletions
|
@ -31,9 +31,11 @@ import android.widget.RelativeLayout;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import org.linphone.LinphoneManager;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.AccountCreator;
|
import org.linphone.core.AccountCreator;
|
||||||
import org.linphone.core.AccountCreatorListenerStub;
|
import org.linphone.core.AccountCreatorListenerStub;
|
||||||
|
import org.linphone.core.Core;
|
||||||
import org.linphone.core.DialPlan;
|
import org.linphone.core.DialPlan;
|
||||||
import org.linphone.core.tools.Log;
|
import org.linphone.core.tools.Log;
|
||||||
|
|
||||||
|
@ -70,7 +72,6 @@ public class AccountConnectionAssistantActivity extends AssistantActivity {
|
||||||
new View.OnClickListener() {
|
new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
mAccountCreator.setDomain(getString(R.string.default_domain));
|
|
||||||
mConnect.setEnabled(false);
|
mConnect.setEnabled(false);
|
||||||
|
|
||||||
if (mUsernameConnectionSwitch.isChecked()) {
|
if (mUsernameConnectionSwitch.isChecked()) {
|
||||||
|
@ -83,7 +84,9 @@ public class AccountConnectionAssistantActivity extends AssistantActivity {
|
||||||
|
|
||||||
AccountCreator.Status status = mAccountCreator.recoverAccount();
|
AccountCreator.Status status = mAccountCreator.recoverAccount();
|
||||||
if (status != AccountCreator.Status.RequestOk) {
|
if (status != AccountCreator.Status.RequestOk) {
|
||||||
Log.e("[Account Connection] recoverAccount returned " + status);
|
Log.e(
|
||||||
|
"[Account Connection Assistant] recoverAccount returned "
|
||||||
|
+ status);
|
||||||
mConnect.setEnabled(true);
|
mConnect.setEnabled(true);
|
||||||
showGenericErrorDialog(status);
|
showGenericErrorDialog(status);
|
||||||
}
|
}
|
||||||
|
@ -202,7 +205,9 @@ public class AccountConnectionAssistantActivity extends AssistantActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onRecoverAccount(
|
public void onRecoverAccount(
|
||||||
AccountCreator creator, AccountCreator.Status status, String resp) {
|
AccountCreator creator, AccountCreator.Status status, String resp) {
|
||||||
Log.i("[Account Connection] onRecoverAccount status is " + status);
|
Log.i(
|
||||||
|
"[Account Connection Assistant] onRecoverAccount status is "
|
||||||
|
+ status);
|
||||||
if (status.equals(AccountCreator.Status.RequestOk)) {
|
if (status.equals(AccountCreator.Status.RequestOk)) {
|
||||||
Intent intent =
|
Intent intent =
|
||||||
new Intent(
|
new Intent(
|
||||||
|
@ -216,6 +221,11 @@ public class AccountConnectionAssistantActivity extends AssistantActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Core core = LinphoneManager.getCore();
|
||||||
|
if (core != null) {
|
||||||
|
reloadLinphoneAccountCreatorConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,6 +33,7 @@ import org.linphone.R;
|
||||||
import org.linphone.activities.DialerActivity;
|
import org.linphone.activities.DialerActivity;
|
||||||
import org.linphone.activities.LinphoneGenericActivity;
|
import org.linphone.activities.LinphoneGenericActivity;
|
||||||
import org.linphone.core.AccountCreator;
|
import org.linphone.core.AccountCreator;
|
||||||
|
import org.linphone.core.Config;
|
||||||
import org.linphone.core.Core;
|
import org.linphone.core.Core;
|
||||||
import org.linphone.core.DialPlan;
|
import org.linphone.core.DialPlan;
|
||||||
import org.linphone.core.Factory;
|
import org.linphone.core.Factory;
|
||||||
|
@ -104,22 +105,52 @@ public abstract class AssistantActivity extends LinphoneGenericActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reloadAccountCreatorConfig(String path) {
|
||||||
|
Core core = LinphoneManager.getCore();
|
||||||
|
if (core != null) {
|
||||||
|
core.loadConfigFromXml(path);
|
||||||
|
if (mAccountCreator != null) {
|
||||||
|
// Below two settings are applied to account creator when it is built.
|
||||||
|
// Reloading Core config after won't change the account creator configuration,
|
||||||
|
// hence the manual reload
|
||||||
|
Config config = LinphonePreferences.instance().getConfig();
|
||||||
|
mAccountCreator.setDomain(config.getString("assistant", "domain", null));
|
||||||
|
mAccountCreator.setAlgorithm(config.getString("assistant", "algorithm", null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void reloadDefaultAccountCreatorConfig() {
|
||||||
|
Log.i("[Assistant] Reloading configuration with default");
|
||||||
|
reloadAccountCreatorConfig(LinphonePreferences.instance().getDefaultDynamicConfigFile());
|
||||||
|
}
|
||||||
|
|
||||||
|
void reloadLinphoneAccountCreatorConfig() {
|
||||||
|
Log.i("[Assistant] Reloading configuration with specifics");
|
||||||
|
reloadAccountCreatorConfig(LinphonePreferences.instance().getLinphoneDynamicConfigFile());
|
||||||
|
}
|
||||||
|
|
||||||
void createProxyConfigAndLeaveAssistant() {
|
void createProxyConfigAndLeaveAssistant() {
|
||||||
Core core = LinphoneManager.getCore();
|
Core core = LinphoneManager.getCore();
|
||||||
boolean useLinphoneDefaultValues =
|
boolean useLinphoneDefaultValues =
|
||||||
getString(R.string.default_domain).equals(mAccountCreator.getDomain());
|
getString(R.string.default_domain).equals(mAccountCreator.getDomain());
|
||||||
if (useLinphoneDefaultValues) {
|
if (useLinphoneDefaultValues) {
|
||||||
|
Log.i("[Assistant] Default domain found, reloading configuration");
|
||||||
core.loadConfigFromXml(LinphonePreferences.instance().getLinphoneDynamicConfigFile());
|
core.loadConfigFromXml(LinphonePreferences.instance().getLinphoneDynamicConfigFile());
|
||||||
|
} else {
|
||||||
|
Log.i("[Assistant] Third party domain found, keeping default values");
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyConfig proxyConfig = mAccountCreator.createProxyConfig();
|
ProxyConfig proxyConfig = mAccountCreator.createProxyConfig();
|
||||||
|
|
||||||
if (useLinphoneDefaultValues) {
|
if (useLinphoneDefaultValues) {
|
||||||
// Restore default values
|
// Restore default values
|
||||||
|
Log.i("[Assistant] Restoring default assistant configuration");
|
||||||
core.loadConfigFromXml(LinphonePreferences.instance().getDefaultDynamicConfigFile());
|
core.loadConfigFromXml(LinphonePreferences.instance().getDefaultDynamicConfigFile());
|
||||||
} else {
|
} else {
|
||||||
// If this isn't a sip.linphone.org account, disable push notifications and enable
|
// If this isn't a sip.linphone.org account, disable push notifications and enable
|
||||||
// service notification, otherwise incoming calls won't work (most probably)
|
// service notification, otherwise incoming calls won't work (most probably)
|
||||||
|
Log.w("[Assistant] Unknown domain used, push probably won't work, enable service mode");
|
||||||
LinphonePreferences.instance().setServiceNotificationVisibility(true);
|
LinphonePreferences.instance().setServiceNotificationVisibility(true);
|
||||||
LinphoneContext.instance().getNotificationManager().startForeground();
|
LinphoneContext.instance().getNotificationManager().startForeground();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,11 @@ import android.view.View;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import org.linphone.LinphoneManager;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.AccountCreator;
|
import org.linphone.core.AccountCreator;
|
||||||
import org.linphone.core.AccountCreatorListenerStub;
|
import org.linphone.core.AccountCreatorListenerStub;
|
||||||
|
import org.linphone.core.Core;
|
||||||
import org.linphone.core.tools.Log;
|
import org.linphone.core.tools.Log;
|
||||||
|
|
||||||
public class EmailAccountCreationAssistantActivity extends AssistantActivity {
|
public class EmailAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
|
@ -161,12 +163,13 @@ public class EmailAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
enableButtonsAndFields(false);
|
enableButtonsAndFields(false);
|
||||||
mAccountCreator.setDomain(getString(R.string.default_domain));
|
|
||||||
|
|
||||||
AccountCreator.Status status = mAccountCreator.isAccountExist();
|
AccountCreator.Status status = mAccountCreator.isAccountExist();
|
||||||
if (status != AccountCreator.Status.RequestOk) {
|
if (status != AccountCreator.Status.RequestOk) {
|
||||||
enableButtonsAndFields(true);
|
enableButtonsAndFields(true);
|
||||||
Log.e("[Email Account Creation] isAccountExists returned " + status);
|
Log.e(
|
||||||
|
"[Email Account Creation Assistant] isAccountExists returned "
|
||||||
|
+ status);
|
||||||
showGenericErrorDialog(status);
|
showGenericErrorDialog(status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,7 +180,9 @@ public class EmailAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
new AccountCreatorListenerStub() {
|
new AccountCreatorListenerStub() {
|
||||||
public void onIsAccountExist(
|
public void onIsAccountExist(
|
||||||
AccountCreator creator, AccountCreator.Status status, String resp) {
|
AccountCreator creator, AccountCreator.Status status, String resp) {
|
||||||
Log.i("[Email Account Creation] onIsAccountExist status is " + status);
|
Log.i(
|
||||||
|
"[Email Account Creation Assistant] onIsAccountExist status is "
|
||||||
|
+ status);
|
||||||
if (status.equals(AccountCreator.Status.AccountExist)
|
if (status.equals(AccountCreator.Status.AccountExist)
|
||||||
|| status.equals(AccountCreator.Status.AccountExistWithAlias)) {
|
|| status.equals(AccountCreator.Status.AccountExistWithAlias)) {
|
||||||
showAccountAlreadyExistsDialog();
|
showAccountAlreadyExistsDialog();
|
||||||
|
@ -185,7 +190,9 @@ public class EmailAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
} else if (status.equals(AccountCreator.Status.AccountNotExist)) {
|
} else if (status.equals(AccountCreator.Status.AccountNotExist)) {
|
||||||
status = mAccountCreator.createAccount();
|
status = mAccountCreator.createAccount();
|
||||||
if (status != AccountCreator.Status.RequestOk) {
|
if (status != AccountCreator.Status.RequestOk) {
|
||||||
Log.e("[Email Account Creation] createAccount returned " + status);
|
Log.e(
|
||||||
|
"[Email Account Creation Assistant] createAccount returned "
|
||||||
|
+ status);
|
||||||
enableButtonsAndFields(true);
|
enableButtonsAndFields(true);
|
||||||
showGenericErrorDialog(status);
|
showGenericErrorDialog(status);
|
||||||
}
|
}
|
||||||
|
@ -198,7 +205,9 @@ public class EmailAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onCreateAccount(
|
public void onCreateAccount(
|
||||||
AccountCreator creator, AccountCreator.Status status, String resp) {
|
AccountCreator creator, AccountCreator.Status status, String resp) {
|
||||||
Log.i("[Email Account Creation] onCreateAccount status is " + status);
|
Log.i(
|
||||||
|
"[Email Account Creation Assistant] onCreateAccount status is "
|
||||||
|
+ status);
|
||||||
if (status.equals(AccountCreator.Status.AccountCreated)) {
|
if (status.equals(AccountCreator.Status.AccountCreated)) {
|
||||||
startActivity(
|
startActivity(
|
||||||
new Intent(
|
new Intent(
|
||||||
|
@ -210,6 +219,11 @@ public class EmailAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Core core = LinphoneManager.getCore();
|
||||||
|
if (core != null) {
|
||||||
|
reloadLinphoneAccountCreatorConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableButtonsAndFields(boolean enable) {
|
private void enableButtonsAndFields(boolean enable) {
|
||||||
|
|
|
@ -52,7 +52,9 @@ public class EmailAccountValidationAssistantActivity extends AssistantActivity {
|
||||||
|
|
||||||
AccountCreator.Status status = mAccountCreator.isAccountActivated();
|
AccountCreator.Status status = mAccountCreator.isAccountActivated();
|
||||||
if (status != AccountCreator.Status.RequestOk) {
|
if (status != AccountCreator.Status.RequestOk) {
|
||||||
Log.e("[Email Account Validation] activateAccount returned " + status);
|
Log.e(
|
||||||
|
"[Email Account Validation Assistant] activateAccount returned "
|
||||||
|
+ status);
|
||||||
mFinishCreation.setEnabled(true);
|
mFinishCreation.setEnabled(true);
|
||||||
showGenericErrorDialog(status);
|
showGenericErrorDialog(status);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +67,7 @@ public class EmailAccountValidationAssistantActivity extends AssistantActivity {
|
||||||
public void onIsAccountActivated(
|
public void onIsAccountActivated(
|
||||||
AccountCreator creator, AccountCreator.Status status, String resp) {
|
AccountCreator creator, AccountCreator.Status status, String resp) {
|
||||||
Log.i(
|
Log.i(
|
||||||
"[Email Account Validation] onIsAccountActivated status is "
|
"[Email Account Validation Assistant] onIsAccountActivated status is "
|
||||||
+ status);
|
+ status);
|
||||||
if (status.equals(AccountCreator.Status.AccountActivated)) {
|
if (status.equals(AccountCreator.Status.AccountActivated)) {
|
||||||
createProxyConfigAndLeaveAssistant();
|
createProxyConfigAndLeaveAssistant();
|
||||||
|
|
|
@ -27,8 +27,11 @@ import android.widget.EditText;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import org.linphone.LinphoneManager;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
|
import org.linphone.core.Core;
|
||||||
import org.linphone.core.TransportType;
|
import org.linphone.core.TransportType;
|
||||||
|
import org.linphone.core.tools.Log;
|
||||||
|
|
||||||
public class GenericConnectionAssistantActivity extends AssistantActivity implements TextWatcher {
|
public class GenericConnectionAssistantActivity extends AssistantActivity implements TextWatcher {
|
||||||
private TextView mLogin;
|
private TextView mLogin;
|
||||||
|
@ -60,6 +63,12 @@ public class GenericConnectionAssistantActivity extends AssistantActivity implem
|
||||||
mDomain = findViewById(R.id.assistant_domain);
|
mDomain = findViewById(R.id.assistant_domain);
|
||||||
mDomain.addTextChangedListener(this);
|
mDomain.addTextChangedListener(this);
|
||||||
mTransport = findViewById(R.id.assistant_transports);
|
mTransport = findViewById(R.id.assistant_transports);
|
||||||
|
|
||||||
|
Core core = LinphoneManager.getCore();
|
||||||
|
if (core != null) {
|
||||||
|
Log.i("[Generic Connection Assistant] Reloading configuration with default");
|
||||||
|
reloadDefaultAccountCreatorConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureAccount() {
|
private void configureAccount() {
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class OpenH264DownloadAssistantActivity extends AssistantActivity {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
mYes.setEnabled(false);
|
mYes.setEnabled(false);
|
||||||
mNo.setEnabled(false);
|
mNo.setEnabled(false);
|
||||||
Log.e("[OpenH264 Downloader] Start download");
|
Log.e("[OpenH264 Downloader Assistant] Start download");
|
||||||
mProgress.setVisibility(View.VISIBLE);
|
mProgress.setVisibility(View.VISIBLE);
|
||||||
mHelper.downloadCodec();
|
mHelper.downloadCodec();
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ public class OpenH264DownloadAssistantActivity extends AssistantActivity {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
mYes.setEnabled(false);
|
mYes.setEnabled(false);
|
||||||
mNo.setEnabled(false);
|
mNo.setEnabled(false);
|
||||||
Log.e("[OpenH264 Downloader] Download refused");
|
Log.e("[OpenH264 Downloader Assistant] Download refused");
|
||||||
goToLinphoneActivity();
|
goToLinphoneActivity();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -96,7 +96,7 @@ public class OpenH264DownloadAssistantActivity extends AssistantActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void OnError(String s) {
|
public void OnError(String s) {
|
||||||
Log.e("[OpenH264 Downloader] " + s);
|
Log.e("[OpenH264 Downloader Assistant] " + s);
|
||||||
mYes.setEnabled(true);
|
mYes.setEnabled(true);
|
||||||
mNo.setEnabled(true);
|
mNo.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,11 @@ import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import org.linphone.LinphoneManager;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.AccountCreator;
|
import org.linphone.core.AccountCreator;
|
||||||
import org.linphone.core.AccountCreatorListenerStub;
|
import org.linphone.core.AccountCreatorListenerStub;
|
||||||
|
import org.linphone.core.Core;
|
||||||
import org.linphone.core.DialPlan;
|
import org.linphone.core.DialPlan;
|
||||||
import org.linphone.core.tools.Log;
|
import org.linphone.core.tools.Log;
|
||||||
|
|
||||||
|
@ -74,11 +76,12 @@ public class PhoneAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
} else {
|
} else {
|
||||||
mAccountCreator.setUsername(mAccountCreator.getPhoneNumber());
|
mAccountCreator.setUsername(mAccountCreator.getPhoneNumber());
|
||||||
}
|
}
|
||||||
mAccountCreator.setDomain(getString(R.string.default_domain));
|
|
||||||
|
|
||||||
AccountCreator.Status status = mAccountCreator.isAccountExist();
|
AccountCreator.Status status = mAccountCreator.isAccountExist();
|
||||||
if (status != AccountCreator.Status.RequestOk) {
|
if (status != AccountCreator.Status.RequestOk) {
|
||||||
Log.e("[Phone Account Creation] isAccountExists returned " + status);
|
Log.e(
|
||||||
|
"[Phone Account Creation Assistant] isAccountExists returned "
|
||||||
|
+ status);
|
||||||
enableButtonsAndFields(true);
|
enableButtonsAndFields(true);
|
||||||
showGenericErrorDialog(status);
|
showGenericErrorDialog(status);
|
||||||
}
|
}
|
||||||
|
@ -167,7 +170,9 @@ public class PhoneAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
new AccountCreatorListenerStub() {
|
new AccountCreatorListenerStub() {
|
||||||
public void onIsAccountExist(
|
public void onIsAccountExist(
|
||||||
AccountCreator creator, AccountCreator.Status status, String resp) {
|
AccountCreator creator, AccountCreator.Status status, String resp) {
|
||||||
Log.i("[Phone Account Creation] onIsAccountExist status is " + status);
|
Log.i(
|
||||||
|
"[Phone Account Creation Assistant] onIsAccountExist status is "
|
||||||
|
+ status);
|
||||||
if (status.equals(AccountCreator.Status.AccountExist)
|
if (status.equals(AccountCreator.Status.AccountExist)
|
||||||
|| status.equals(AccountCreator.Status.AccountExistWithAlias)) {
|
|| status.equals(AccountCreator.Status.AccountExistWithAlias)) {
|
||||||
showAccountAlreadyExistsDialog();
|
showAccountAlreadyExistsDialog();
|
||||||
|
@ -175,7 +180,9 @@ public class PhoneAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
} else if (status.equals(AccountCreator.Status.AccountNotExist)) {
|
} else if (status.equals(AccountCreator.Status.AccountNotExist)) {
|
||||||
status = mAccountCreator.createAccount();
|
status = mAccountCreator.createAccount();
|
||||||
if (status != AccountCreator.Status.RequestOk) {
|
if (status != AccountCreator.Status.RequestOk) {
|
||||||
Log.e("[Phone Account Creation] createAccount returned " + status);
|
Log.e(
|
||||||
|
"[Phone Account Creation Assistant] createAccount returned "
|
||||||
|
+ status);
|
||||||
enableButtonsAndFields(true);
|
enableButtonsAndFields(true);
|
||||||
showGenericErrorDialog(status);
|
showGenericErrorDialog(status);
|
||||||
}
|
}
|
||||||
|
@ -188,7 +195,9 @@ public class PhoneAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onCreateAccount(
|
public void onCreateAccount(
|
||||||
AccountCreator creator, AccountCreator.Status status, String resp) {
|
AccountCreator creator, AccountCreator.Status status, String resp) {
|
||||||
Log.i("[Phone Account Creation] onCreateAccount status is " + status);
|
Log.i(
|
||||||
|
"[Phone Account Creation Assistant] onCreateAccount status is "
|
||||||
|
+ status);
|
||||||
if (status.equals(AccountCreator.Status.AccountCreated)) {
|
if (status.equals(AccountCreator.Status.AccountCreated)) {
|
||||||
startActivity(
|
startActivity(
|
||||||
new Intent(
|
new Intent(
|
||||||
|
@ -200,6 +209,11 @@ public class PhoneAccountCreationAssistantActivity extends AssistantActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Core core = LinphoneManager.getCore();
|
||||||
|
if (core != null) {
|
||||||
|
reloadLinphoneAccountCreatorConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class PhoneAccountLinkingAssistantActivity extends AssistantActivity {
|
||||||
int proxyConfigIndex = getIntent().getExtras().getInt("AccountNumber");
|
int proxyConfigIndex = getIntent().getExtras().getInt("AccountNumber");
|
||||||
Core core = LinphoneManager.getCore();
|
Core core = LinphoneManager.getCore();
|
||||||
if (core == null) {
|
if (core == null) {
|
||||||
Log.e("[Account Linking] Core not available");
|
Log.e("[Account Linking Assistant] Core not available");
|
||||||
unexpectedError();
|
unexpectedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,12 +66,12 @@ public class PhoneAccountLinkingAssistantActivity extends AssistantActivity {
|
||||||
|
|
||||||
Address identity = mProxyConfig.getIdentityAddress();
|
Address identity = mProxyConfig.getIdentityAddress();
|
||||||
if (identity == null) {
|
if (identity == null) {
|
||||||
Log.e("[Account Linking] Proxy doesn't have an identity address");
|
Log.e("[Account Linking Assistant] Proxy doesn't have an identity address");
|
||||||
unexpectedError();
|
unexpectedError();
|
||||||
}
|
}
|
||||||
if (!mProxyConfig.getDomain().equals(getString(R.string.default_domain))) {
|
if (!mProxyConfig.getDomain().equals(getString(R.string.default_domain))) {
|
||||||
Log.e(
|
Log.e(
|
||||||
"[Account Linking] Can't link account on domain "
|
"[Account Linking Assistant] Can't link account on domain "
|
||||||
+ mProxyConfig.getDomain());
|
+ mProxyConfig.getDomain());
|
||||||
unexpectedError();
|
unexpectedError();
|
||||||
}
|
}
|
||||||
|
@ -79,18 +79,18 @@ public class PhoneAccountLinkingAssistantActivity extends AssistantActivity {
|
||||||
|
|
||||||
AuthInfo authInfo = mProxyConfig.findAuthInfo();
|
AuthInfo authInfo = mProxyConfig.findAuthInfo();
|
||||||
if (authInfo == null) {
|
if (authInfo == null) {
|
||||||
Log.e("[Account Linking] Auth info not found");
|
Log.e("[Account Linking Assistant] Auth info not found");
|
||||||
unexpectedError();
|
unexpectedError();
|
||||||
}
|
}
|
||||||
mAccountCreator.setHa1(authInfo.getHa1());
|
mAccountCreator.setHa1(authInfo.getHa1());
|
||||||
|
|
||||||
mAccountCreator.setDomain(getString(R.string.default_domain));
|
|
||||||
} else {
|
} else {
|
||||||
Log.e("[Account Linking] Proxy config index out of bounds: " + proxyConfigIndex);
|
Log.e(
|
||||||
|
"[Account Linking Assistant] Proxy config index out of bounds: "
|
||||||
|
+ proxyConfigIndex);
|
||||||
unexpectedError();
|
unexpectedError();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e("[Account Linking] Proxy config index not found");
|
Log.e("[Account Linking Assistant] Proxy config index not found");
|
||||||
unexpectedError();
|
unexpectedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,9 @@ public class PhoneAccountLinkingAssistantActivity extends AssistantActivity {
|
||||||
|
|
||||||
AccountCreator.Status status = mAccountCreator.isAliasUsed();
|
AccountCreator.Status status = mAccountCreator.isAliasUsed();
|
||||||
if (status != AccountCreator.Status.RequestOk) {
|
if (status != AccountCreator.Status.RequestOk) {
|
||||||
Log.e("[Phone Account Linking] isAliasUsed returned " + status);
|
Log.e(
|
||||||
|
"[Phone Account Linking Assistant] isAliasUsed returned "
|
||||||
|
+ status);
|
||||||
enableButtonsAndFields(true);
|
enableButtonsAndFields(true);
|
||||||
showGenericErrorDialog(status);
|
showGenericErrorDialog(status);
|
||||||
}
|
}
|
||||||
|
@ -178,11 +180,15 @@ public class PhoneAccountLinkingAssistantActivity extends AssistantActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onIsAliasUsed(
|
public void onIsAliasUsed(
|
||||||
AccountCreator creator, AccountCreator.Status status, String resp) {
|
AccountCreator creator, AccountCreator.Status status, String resp) {
|
||||||
Log.i("[Phone Account Linking] onIsAliasUsed status is " + status);
|
Log.i(
|
||||||
|
"[Phone Account Linking Assistant] onIsAliasUsed status is "
|
||||||
|
+ status);
|
||||||
if (status.equals(AccountCreator.Status.AliasNotExist)) {
|
if (status.equals(AccountCreator.Status.AliasNotExist)) {
|
||||||
status = mAccountCreator.linkAccount();
|
status = mAccountCreator.linkAccount();
|
||||||
if (status != AccountCreator.Status.RequestOk) {
|
if (status != AccountCreator.Status.RequestOk) {
|
||||||
Log.e("[Phone Account Linking] linkAccount returned " + status);
|
Log.e(
|
||||||
|
"[Phone Account Linking Assistant] linkAccount returned "
|
||||||
|
+ status);
|
||||||
enableButtonsAndFields(true);
|
enableButtonsAndFields(true);
|
||||||
showGenericErrorDialog(status);
|
showGenericErrorDialog(status);
|
||||||
}
|
}
|
||||||
|
@ -200,7 +206,9 @@ public class PhoneAccountLinkingAssistantActivity extends AssistantActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onLinkAccount(
|
public void onLinkAccount(
|
||||||
AccountCreator creator, AccountCreator.Status status, String resp) {
|
AccountCreator creator, AccountCreator.Status status, String resp) {
|
||||||
Log.i("[Phone Account Linking] onLinkAccount status is " + status);
|
Log.i(
|
||||||
|
"[Phone Account Linking Assistant] onLinkAccount status is "
|
||||||
|
+ status);
|
||||||
if (status.equals(AccountCreator.Status.RequestOk)) {
|
if (status.equals(AccountCreator.Status.RequestOk)) {
|
||||||
Intent intent =
|
Intent intent =
|
||||||
new Intent(
|
new Intent(
|
||||||
|
@ -214,6 +222,11 @@ public class PhoneAccountLinkingAssistantActivity extends AssistantActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Core core = LinphoneManager.getCore();
|
||||||
|
if (core != null) {
|
||||||
|
reloadLinphoneAccountCreatorConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
<entry name="x3dh_server_url" overwrite="true"></entry>
|
<entry name="x3dh_server_url" overwrite="true"></entry>
|
||||||
</section>
|
</section>
|
||||||
<section name="assistant">
|
<section name="assistant">
|
||||||
|
<entry name="domain" overwrite="true"></entry>
|
||||||
<entry name="algorithm" overwrite="true">MD5</entry>
|
<entry name="algorithm" overwrite="true">MD5</entry>
|
||||||
<entry name="password_max_length" overwrite="true">-1</entry>
|
<entry name="password_max_length" overwrite="true">-1</entry>
|
||||||
<entry name="password_min_length" overwrite="true">0</entry>
|
<entry name="password_min_length" overwrite="true">0</entry>
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
<entry name="x3dh_server_url" overwrite="true">https://lime.linphone.org/lime-server/lime-server.php</entry>
|
<entry name="x3dh_server_url" overwrite="true">https://lime.linphone.org/lime-server/lime-server.php</entry>
|
||||||
</section>
|
</section>
|
||||||
<section name="assistant">
|
<section name="assistant">
|
||||||
|
<entry name="domain" overwrite="true">sip.linphone.org</entry>
|
||||||
<entry name="algorithm" overwrite="true">SHA-256</entry>
|
<entry name="algorithm" overwrite="true">SHA-256</entry>
|
||||||
<entry name="password_max_length" overwrite="true">-1</entry>
|
<entry name="password_max_length" overwrite="true">-1</entry>
|
||||||
<entry name="password_min_length" overwrite="true">1</entry>
|
<entry name="password_min_length" overwrite="true">1</entry>
|
||||||
|
|
Loading…
Reference in a new issue