Set country call prefix if able when configuring proxy config + fixed issue when deleting account
This commit is contained in:
parent
6ae75e34b9
commit
dec9442a47
7 changed files with 20 additions and 7 deletions
|
@ -18,7 +18,7 @@
|
|||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
|
||||
<!-- Needed to be able to detect a GSM call and thus pause any active SIP call -->
|
||||
<!-- Needed to be able to detect a GSM call and thus pause any active SIP call, and auto fill the phone number field in assistant -->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<!-- Needed to be able to pick images from SD card to share in chat message -->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
|
|
@ -122,6 +122,13 @@ public abstract class AssistantActivity extends LinphoneGenericActivity
|
|||
Log.e("[Assistant] Account creator couldn't create proxy config");
|
||||
// TODO: display error message
|
||||
} else {
|
||||
if (proxyConfig.getDialPrefix() == null) {
|
||||
DialPlan dialPlan = getDialPlanForCurrentCountry();
|
||||
if (dialPlan != null) {
|
||||
proxyConfig.setDialPrefix(dialPlan.getCountryCallingCode());
|
||||
}
|
||||
}
|
||||
|
||||
LinphonePreferences.instance().firstLaunchSuccessful();
|
||||
goToLinphoneActivity();
|
||||
}
|
||||
|
|
|
@ -70,7 +70,6 @@ public class GenericConnectionAssistantActivity extends AssistantActivity implem
|
|||
mAccountCreator.setDomain(mDomain.getText().toString());
|
||||
mAccountCreator.setPassword(mPassword.getText().toString());
|
||||
mAccountCreator.setDisplayName(mDisplayName.getText().toString());
|
||||
// TODO: add support for user-id in account creator
|
||||
|
||||
switch (mTransport.getCheckedRadioButtonId()) {
|
||||
case R.id.transport_udp:
|
||||
|
|
|
@ -44,7 +44,6 @@ class AsyncContactsLoader extends AsyncTask<Void, Void, AsyncContactsLoader.Asyn
|
|||
@SuppressLint("InlinedApi")
|
||||
public static final String[] PROJECTION = {
|
||||
ContactsContract.Data.CONTACT_ID,
|
||||
ContactsContract.Contacts.LOOKUP_KEY,
|
||||
ContactsContract.Contacts.DISPLAY_NAME_PRIMARY,
|
||||
ContactsContract.Data.MIMETYPE,
|
||||
ContactsContract.Contacts.STARRED,
|
||||
|
@ -128,8 +127,6 @@ class AsyncContactsLoader extends AsyncTask<Void, Void, AsyncContactsLoader.Asyn
|
|||
String id = c.getString(c.getColumnIndex(ContactsContract.Data.CONTACT_ID));
|
||||
boolean starred =
|
||||
c.getInt(c.getColumnIndex(ContactsContract.Contacts.STARRED)) == 1;
|
||||
String lookupKey =
|
||||
c.getString(c.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
|
||||
|
||||
LinphoneContact contact = androidContactsCache.get(id);
|
||||
if (contact == null) {
|
||||
|
|
|
@ -155,6 +155,7 @@ public class AccountSettingsFragment extends SettingsFragment {
|
|||
mExpire.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
|
||||
mPrefix = mRootView.findViewById(R.id.pref_prefix);
|
||||
mPrefix.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
|
||||
mAvpfInterval = mRootView.findViewById(R.id.pref_avpf_rr_interval);
|
||||
mAvpfInterval.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
|
@ -537,10 +538,19 @@ public class AccountSettingsFragment extends SettingsFragment {
|
|||
core.removeAuthInfo(mAuthInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// Set a new default proxy config if the current one has been removed
|
||||
if (core != null && core.getDefaultProxyConfig() == null) {
|
||||
ProxyConfig[] proxyConfigs = core.getProxyConfigList();
|
||||
if (proxyConfigs.length > 0) {
|
||||
core.setDefaultProxyConfig(proxyConfigs[0]);
|
||||
}
|
||||
}
|
||||
|
||||
((SettingsActivity) getActivity())
|
||||
.getSideMenuFragment()
|
||||
.displayAccountsInSideMenu();
|
||||
((SettingsActivity) getActivity()).popBackStack();
|
||||
((SettingsActivity) getActivity()).goBack();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -89,7 +89,6 @@ public class SettingsActivity extends MainActivity {
|
|||
|
||||
@Override
|
||||
public void goBack() {
|
||||
// 1 is for the empty fragment on tablets
|
||||
if (!isTablet()) {
|
||||
if (popBackStack()) {
|
||||
showTopBarWithTitle(getString(R.string.settings));
|
||||
|
|
|
@ -81,6 +81,7 @@ public class LinphoneService extends Service {
|
|||
Toast.makeText(LinphoneService.this, message, Toast.LENGTH_SHORT).show();
|
||||
|
||||
if (state == Call.State.IncomingReceived) {
|
||||
Toast.makeText(LinphoneService.this, "Incoming call received, answering it automatically", Toast.LENGTH_LONG).show();
|
||||
// For this sample we will automatically answer incoming calls
|
||||
CallParams params = getCore().createCallParams(call);
|
||||
params.enableVideo(true);
|
||||
|
|
Loading…
Reference in a new issue