Fix AccountCreator leak, fix bug on assistant

This commit is contained in:
Erwan Croze 2016-10-19 15:43:30 +02:00
parent 81aeec2e49
commit 1edbeff4c6
17 changed files with 262 additions and 208 deletions

View file

@ -301,10 +301,8 @@ uninstall:
\tadb uninstall $(PACKAGE_NAME) \tadb uninstall $(PACKAGE_NAME)
release: java-clean build copy-libs update-project release: java-clean build copy-libs update-project
\tpatch -p1 < release.patch
\tcat ant.properties | grep version.name > default.properties \tcat ant.properties | grep version.name > default.properties
\tant release \tant release
\tpatch -Rp1 < release.patch
generate-sdk: liblinphone-android-sdk generate-sdk: liblinphone-android-sdk

View file

@ -26,6 +26,22 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<TextView
android:id="@+id/send_phone_number"
style="@style/font6"
android:paddingTop="10dp"
android:gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="@string/assistant_create_account_part_3"
style="@style/font11"
android:paddingTop="10dp"
android:gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<EditText <EditText
android:id="@+id/assistant_code" android:id="@+id/assistant_code"
android:background="@drawable/resizable_textfield" android:background="@drawable/resizable_textfield"

View file

@ -18,7 +18,25 @@
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<TextView <TextView
android:text="@string/assistant_validate_account" android:text="@string/assistant_validate_account_1"
style="@style/font11"
android:paddingTop="10dp"
android:gravity="center"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/send_email"
style="@style/font6"
android:paddingTop="10dp"
android:gravity="center_horizontal"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="@string/assistant_validate_account_2"
style="@style/font11" style="@style/font11"
android:paddingTop="10dp" android:paddingTop="10dp"
android:gravity="center" android:gravity="center"

View file

@ -79,26 +79,26 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toLeftOf="@id/delete" android:layout_toLeftOf="@id/delete"
android:layout_marginLeft="10dp"> android:layout_marginLeft="10dp">
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
android:lines="1" android:lines="1"
style="@style/font6" style="@style/font6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true"/> android:layout_alignParentTop="true"/>
<TextView <TextView
android:id="@+id/contactOrganization" android:id="@+id/contactOrganization"
style="@style/font9" style="@style/font9"
android:singleLine="true" android:singleLine="true"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/> android:layout_alignParentBottom="true"/>
</RelativeLayout> </RelativeLayout>
<ImageView <ImageView
android:id="@+id/friendStatus" android:id="@+id/friendStatus"
android:visibility="gone" android:visibility="gone"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -115,14 +115,13 @@
android:visibility="gone" android:visibility="gone"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_alignParentRight="true" android:layout_toLeftOf="@id/delete"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_marginRight="20dp" android:layout_marginRight="10dp"
android:scaleType="centerInside" android:scaleType="centerInside"
android:src="@drawable/linphone_user" /> android:src="@drawable/linphone_user" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>

View file

@ -52,8 +52,8 @@
<string name="assistant_create_account">Créer un compte</string> <string name="assistant_create_account">Créer un compte</string>
<string name="assistant_link_account">Associer un compte</string> <string name="assistant_link_account">Associer un compte</string>
<string name="assistant_finish">Terminer la configuration</string> <string name="assistant_finish">Terminer la configuration</string>
<string name="assistant_validate_account">Votre compte a été créé. Vérifiez vos emails pour valider votre compte. <string name="assistant_validate_account_1">Votre compte a été créé. Vérifiez vos emails pour valider votre compte:</string>
Lorsque cela est fait, cliquez sur le bouton pour continuer.</string> <string name="assistant_validate_account_2">Lorsque cela est fait, cliquez sur le bouton pour continuer.</string>
<string name="assistant_welcome_desc">Cet assistant va vous guider pour réaliser des appels à l\'aide d\'un compte SIP.</string> <string name="assistant_welcome_desc">Cet assistant va vous guider pour réaliser des appels à l\'aide d\'un compte SIP.</string>
<string name="assistant_linphone_login_desc">Entrez le nom d\'utilisateur et mot de passe de votre compte Linphone.</string> <string name="assistant_linphone_login_desc">Entrez le nom d\'utilisateur et mot de passe de votre compte Linphone.</string>
<string name="assistant_login_desc">Entrer votre nom d\'utilisateur et mot de passe ainsi que votre domaine SIP</string> <string name="assistant_login_desc">Entrer votre nom d\'utilisateur et mot de passe ainsi que votre domaine SIP</string>
@ -64,7 +64,8 @@ Lorsque cela est fait, cliquez sur le bouton pour continuer.</string>
<string name="assistant_login_generic">Utiliser un compte SIP</string> <string name="assistant_login_generic">Utiliser un compte SIP</string>
<string name="assistant_remote_provisioning">Télécharger la configuration</string> <string name="assistant_remote_provisioning">Télécharger la configuration</string>
<string name="assistant_create_account_part_1">Merci de confirmer votre code de pays et de rentrer votre numéro de téléphone</string> <string name="assistant_create_account_part_1">Merci de confirmer votre code de pays et de rentrer votre numéro de téléphone</string>
<string name="assistant_create_account_part_2">Nous vous avons envoyé un SMS avec un code de validation.\n\nPour complèter la vérification de votre numéro de téléphone, veuillez entrer les 4 chiffres du code en dessous:\n</string> <string name="assistant_create_account_part_2">Nous vous avons envoyé un SMS avec un code de validation au numéro :</string>
<string name="assistant_create_account_part_3">Pour complèter la vérification de votre numéro de téléphone, veuillez entrer les 4 chiffres du code en dessous:\n</string>
<string name="assistant_display_name_optional">Nom d\'affichage (optionnel)</string> <string name="assistant_display_name_optional">Nom d\'affichage (optionnel)</string>
<string name="assistant_linphone_account">Utiliser un compte Linphone</string> <string name="assistant_linphone_account">Utiliser un compte Linphone</string>
<string name="assistant_generic_account">Utiliser un compte SIP</string> <string name="assistant_generic_account">Utiliser un compte SIP</string>

View file

@ -69,7 +69,8 @@
<string name="assistant_continue">Continue</string> <string name="assistant_continue">Continue</string>
<string name="assistant_activate">Activate your account</string> <string name="assistant_activate">Activate your account</string>
<string name="assistant_finish">Finish configuration</string> <string name="assistant_finish">Finish configuration</string>
<string name="assistant_validate_account">Your account is created. Please check your mails to validate your account. Once it is done, come back here and click on the button.</string> <string name="assistant_validate_account_1">Your account is created. Please check your mails to validate your account:</string>
<string name="assistant_validate_account_2">Once it is done, come back here and click on the button.</string>
<string name="assistant_welcome_desc">This assistant will help you configure and use your SIP account.</string> <string name="assistant_welcome_desc">This assistant will help you configure and use your SIP account.</string>
<string name="assistant_linphone_login_desc">Please enter your username and password of Linphone account</string> <string name="assistant_linphone_login_desc">Please enter your username and password of Linphone account</string>
<string name="assistant_login_desc">Please enter your username and password with your SIP domain</string> <string name="assistant_login_desc">Please enter your username and password with your SIP domain</string>
@ -80,7 +81,8 @@
<string name="assistant_login_generic">Use SIP account</string> <string name="assistant_login_generic">Use SIP account</string>
<string name="assistant_remote_provisioning">Fetch remote configuration</string> <string name="assistant_remote_provisioning">Fetch remote configuration</string>
<string name="assistant_create_account_part_1">Please confirm your country code and enter your phone number</string> <string name="assistant_create_account_part_1">Please confirm your country code and enter your phone number</string>
<string name="assistant_create_account_part_2">We have sent you a SMS with a validation code.\n\nTo complete your phone number verification, please enter the 4 digit code below:\n</string> <string name="assistant_create_account_part_2">We have sent you a SMS with a validation code to your phone number:</string>
<string name="assistant_create_account_part_3">To complete your phone number verification, please enter the 4 digit code below:\n</string>
<string name="assistant_create_account_part_email">Please enter an username, email and password for your Linphone account</string> <string name="assistant_create_account_part_email">Please enter an username, email and password for your Linphone account</string>
<string name="assistant_display_name_optional">Display name (optional)</string> <string name="assistant_display_name_optional">Display name (optional)</string>
<string name="assistant_linphone_account">Use your Linphone account</string> <string name="assistant_linphone_account">Use your Linphone account</string>

View file

@ -184,7 +184,7 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
String value = newValue.toString(); String value = newValue.toString();
preference.setSummary(value); preference.setSummary(value);
if (isNewAccount) { if (isNewAccount) {
//TODO accpunt builder ste prefix builder.setPrefix(value);
} else { } else {
mPrefs.setPrefix(n, value); mPrefs.setPrefix(n, value);
} }
@ -357,7 +357,6 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
if(!isNewAccount){ if(!isNewAccount){
String prefixValue = mPrefs.getPrefix(n); String prefixValue = mPrefs.getPrefix(n);
prefix.setText(prefixValue); prefix.setText(prefixValue);
prefix.setOnPreferenceChangeListener(prefixChangedListener);
} }
CheckBoxPreference avpf = (CheckBoxPreference) advanced.getPreference(5); CheckBoxPreference avpf = (CheckBoxPreference) advanced.getPreference(5);

View file

@ -568,7 +568,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
holder.delete.setChecked(false); holder.delete.setChecked(false);
} }
} else { } else {
holder.delete.setVisibility(View.GONE); holder.delete.setVisibility(View.INVISIBLE);
} }
/*LinphoneFriend[] friends = LinphoneManager.getLc().getFriendList(); /*LinphoneFriend[] friends = LinphoneManager.getLc().getFriendList();

View file

@ -211,6 +211,7 @@ public class ContactsManager extends ContentObserver {
for (LinphoneNumberOrAddress noa: c.getNumbersOrAddresses()) { for (LinphoneNumberOrAddress noa: c.getNumbersOrAddresses()) {
String normalized = null; String normalized = null;
if (lpc != null) { if (lpc != null) {
lpc.setDialPrefix("");
normalized = lpc.normalizePhoneNumber(noa.getValue()); normalized = lpc.normalizePhoneNumber(noa.getValue());
} }
String alias = c.getPresenceModelForUri(noa.getValue()); String alias = c.getPresenceModelForUri(noa.getValue());

View file

@ -32,7 +32,6 @@ import org.linphone.assistant.AssistantActivity;
import org.linphone.assistant.RemoteProvisioningLoginActivity; import org.linphone.assistant.RemoteProvisioningLoginActivity;
import org.linphone.compatibility.Compatibility; import org.linphone.compatibility.Compatibility;
import org.linphone.core.CallDirection; import org.linphone.core.CallDirection;
import org.linphone.core.LinphoneAccountCreator;
import org.linphone.core.LinphoneAddress; import org.linphone.core.LinphoneAddress;
import org.linphone.core.LinphoneAuthInfo; import org.linphone.core.LinphoneAuthInfo;
import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall;
@ -98,7 +97,7 @@ import android.widget.Toast;
/** /**
* @author Sylvain Berfini * @author Sylvain Berfini
*/ */
public class LinphoneActivity extends Activity implements OnClickListener, ContactPicked, ActivityCompat.OnRequestPermissionsResultCallback, LinphoneAccountCreator.LinphoneAccountCreatorListener { public class LinphoneActivity extends Activity implements OnClickListener, ContactPicked, ActivityCompat.OnRequestPermissionsResultCallback {
public static final String PREF_FIRST_LAUNCH = "pref_first_launch"; public static final String PREF_FIRST_LAUNCH = "pref_first_launch";
private static final int SETTINGS_ACTIVITY = 123; private static final int SETTINGS_ACTIVITY = 123;
private static final int CALL_ACTIVITY = 19; private static final int CALL_ACTIVITY = 19;
@ -230,7 +229,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
if(state.equals(RegistrationState.RegistrationOk) && LinphonePreferences.instance().getLinkPopupTime() != ""){ if(state.equals(RegistrationState.RegistrationOk) && LinphonePreferences.instance().getLinkPopupTime() != ""){
if(getResources().getBoolean(R.bool.use_phone_number_validation)) { if(getResources().getBoolean(R.bool.use_phone_number_validation)) {
if (LinphonePreferences.instance().getLinkPopupTime() == null || (LinphonePreferences.instance().getLinkPopupTime() != null)){ if (LinphonePreferences.instance().getLinkPopupTime() == null || (LinphonePreferences.instance().getLinkPopupTime() != null)){
isAccountWithAlias(); LinphoneManager.getInstance().isAccountWithAlias();
} }
} }
} }
@ -625,14 +624,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
startActivity(new Intent(LinphoneActivity.this, AssistantActivity.class)); startActivity(new Intent(LinphoneActivity.this, AssistantActivity.class));
} }
public void displayLinkPhoneNumber() {
LinphoneAccountCreator accountCreator;
accountCreator = LinphoneCoreFactory.instance().createAccountCreator(LinphoneManager.getLc(), LinphonePreferences.instance().getXmlrpcUrl());
accountCreator.setDomain(getResources().getString(R.string.default_domain));
accountCreator.setListener(this);
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(LinphonePreferences.instance().getDefaultAccountIndex()));
accountCreator.isAccountLinked();
}
public void displayInapp() { public void displayInapp() {
startActivity(new Intent(LinphoneActivity.this, InAppPurchaseActivity.class)); startActivity(new Intent(LinphoneActivity.this, InAppPurchaseActivity.class));
@ -1705,19 +1697,6 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
} }
} }
private void isAccountWithAlias(){
if(LinphoneManager.getLc().getDefaultProxyConfig() != null) {
LinphoneAccountCreator accountCreator;
accountCreator = LinphoneCoreFactory.instance().createAccountCreator(LinphoneManager.getLc(), LinphonePreferences.instance().getXmlrpcUrl());
accountCreator.setDomain(getResources().getString(R.string.default_domain));
accountCreator.setListener(this);
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(LinphonePreferences.instance().getDefaultAccountIndex()));
accountCreator.isAccountUsed();
} else {
LinphonePreferences.instance().setLinkPopupTime(null);
}
}
//Inapp Purchase //Inapp Purchase
private void isTrialAccount() { private void isTrialAccount() {
if(LinphoneManager.getLc().getDefaultProxyConfig() != null && LinphonePreferences.instance().getInappPopupTime() != null) { if(LinphoneManager.getLc().getDefaultProxyConfig() != null && LinphonePreferences.instance().getInappPopupTime() != null) {
@ -1793,75 +1772,6 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
} }
return -1; return -1;
} }
private void askLinkWithPhoneNumber(){
long now = Calendar.getInstance().getTimeInMillis();
long newDate = now + (getResources().getInteger(R.integer.popup_time_interval)*60);
if (LinphonePreferences.instance().getLinkPopupTime() != null && Long.parseLong(LinphonePreferences.instance().getLinkPopupTime()) > now) {
return;
} else {
LinphonePreferences.instance().setLinkPopupTime(String.valueOf(newDate));
}
final Dialog dialog = displayDialog(String.format(getResources().getString(R.string.link_account_popup), LinphoneManager.getLc().getDefaultProxyConfig().getAddress().asStringUriOnly()));
Button delete = (Button) dialog.findViewById(R.id.delete_button);
delete.setText(getResources().getString(R.string.link));
Button cancel = (Button) dialog.findViewById(R.id.cancel);
cancel.setText(getResources().getString(R.string.maybe_later));
delete.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
displayLinkPhoneNumber();
dialog.dismiss();
}
});
LinphonePreferences.instance().setLinkPopupTime(String.valueOf(newDate));
cancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
dialog.show();
}
@Override
public void onAccountCreatorIsAccountUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
if (status.equals(LinphoneAccountCreator.Status.AccountExist)) {
accountCreator.isAccountLinked();
}
}
@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
public void onAccountCreatorIsAccountActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {}
@Override
public void onAccountCreatorPhoneAccountRecovered(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {}
@Override
public void onAccountCreatorIsAccountLinked(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
if (status.equals(LinphoneAccountCreator.Status.AccountNotLinked)) {
askLinkWithPhoneNumber();
}
}
@Override
public void onAccountCreatorIsPhoneNumberUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
}
} }
interface ContactPicked { interface ContactPicked {

View file

@ -30,11 +30,13 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import org.linphone.core.CallDirection; import org.linphone.core.CallDirection;
import org.linphone.core.LinphoneAccountCreator;
import org.linphone.core.LinphoneAddress; import org.linphone.core.LinphoneAddress;
import org.linphone.core.LinphoneBuffer; import org.linphone.core.LinphoneBuffer;
import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall;
@ -77,6 +79,7 @@ import org.linphone.tools.OpenH264DownloadHelper;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.ContentResolver; import android.content.ContentResolver;
@ -99,6 +102,8 @@ import android.preference.CheckBoxPreference;
import android.provider.Settings; import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException; import android.provider.Settings.SettingNotFoundException;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.view.View;
import android.widget.Button;
import android.widget.Toast; import android.widget.Toast;
/** /**
@ -116,7 +121,7 @@ import android.widget.Toast;
* @author Guillaume Beraudo * @author Guillaume Beraudo
* *
*/ */
public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessage.LinphoneChatMessageListener { public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessage.LinphoneChatMessageListener, LinphoneAccountCreator.LinphoneAccountCreatorListener {
private static LinphoneManager instance; private static LinphoneManager instance;
private Context mServiceContext; private Context mServiceContext;
@ -138,6 +143,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
private IntentFilter mKeepAliveIntentFilter; private IntentFilter mKeepAliveIntentFilter;
private Handler mHandler = new Handler(); private Handler mHandler = new Handler();
private WakeLock mIncallWakeLock; private WakeLock mIncallWakeLock;
private LinphoneAccountCreator accountCreator;
private static List<LinphoneChatMessage> mPendingChatFileMessage; private static List<LinphoneChatMessage> mPendingChatFileMessage;
private static LinphoneChatMessage mUploadPendingFileMessage; private static LinphoneChatMessage mUploadPendingFileMessage;
@ -482,12 +488,12 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
} }
} }
} }
LinphoneProxyConfig lpc = getLc().getDefaultProxyConfig(); LinphoneProxyConfig lpc = getLc().getDefaultProxyConfig();
if (lpc != null) { if (lpc != null) {
to = lpc.normalizePhoneNumber(to); to = lpc.normalizePhoneNumber(to);
} }
LinphoneAddress lAddress; LinphoneAddress lAddress;
try { try {
lAddress = mLc.interpretUrl(to); lAddress = mLc.interpretUrl(to);
@ -664,11 +670,11 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
public void restartLinphoneCore() { public void restartLinphoneCore() {
destroyLinphoneCore(); destroyLinphoneCore();
startLibLinphone(mServiceContext); startLibLinphone(mServiceContext);
/* /*
You cannot receive this through components declared in manifests, only You cannot receive this through components declared in manifests, only
by explicitly registering for it with Context.registerReceiver(). This is a protected intent that can only by explicitly registering for it with Context.registerReceiver(). This is a protected intent that can only
be sent by the system. be sent by the system.
*/ */
mServiceContext.registerReceiver(mKeepAliveReceiver, mKeepAliveIntentFilter); mServiceContext.registerReceiver(mKeepAliveReceiver, mKeepAliveIntentFilter);
sExited = false; sExited = false;
} }
@ -702,7 +708,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
Log.e(e, "Cannot start linphone"); Log.e(e, "Cannot start linphone");
} }
} }
private void initPushNotificationsService() { private void initPushNotificationsService() {
try { try {
Class<?> GCMRegistrar = Class.forName("com.google.android.gcm.GCMRegistrar"); Class<?> GCMRegistrar = Class.forName("com.google.android.gcm.GCMRegistrar");
@ -736,7 +742,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
prefMigrator.migrateRemoteProvisioningUriIfNeeded(); prefMigrator.migrateRemoteProvisioningUriIfNeeded();
prefMigrator.migrateSharingServerUrlIfNeeded(); prefMigrator.migrateSharingServerUrlIfNeeded();
prefMigrator.doPresenceMigrationIfNeeded(); prefMigrator.doPresenceMigrationIfNeeded();
if (prefMigrator.isMigrationNeeded()) { if (prefMigrator.isMigrationNeeded()) {
prefMigrator.doMigration(); prefMigrator.doMigration();
} }
@ -761,7 +767,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
} catch (NameNotFoundException e) { } catch (NameNotFoundException e) {
Log.e(e, "cannot get version name"); Log.e(e, "cannot get version name");
} }
mLc.setRingback(mRingbackSoundFile); mLc.setRingback(mRingbackSoundFile);
mLc.setRootCA(mLinphoneRootCaFile); mLc.setRootCA(mLinphoneRootCaFile);
mLc.setPlayFile(mPauseSoundFile); mLc.setPlayFile(mPauseSoundFile);
@ -786,11 +792,11 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
initPushNotificationsService(); initPushNotificationsService();
} }
/* /*
You cannot receive this through components declared in manifests, only You cannot receive this through components declared in manifests, only
by explicitly registering for it with Context.registerReceiver(). This is a protected intent that can only by explicitly registering for it with Context.registerReceiver(). This is a protected intent that can only
be sent by the system. be sent by the system.
*/ */
mKeepAliveIntentFilter = new IntentFilter(Intent.ACTION_SCREEN_ON); mKeepAliveIntentFilter = new IntentFilter(Intent.ACTION_SCREEN_ON);
mKeepAliveIntentFilter.addAction(Intent.ACTION_SCREEN_OFF); mKeepAliveIntentFilter.addAction(Intent.ACTION_SCREEN_OFF);
mKeepAliveReceiver = new KeepAliveReceiver(); mKeepAliveReceiver = new KeepAliveReceiver();
@ -799,6 +805,10 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
updateNetworkReachability(); updateNetworkReachability();
resetCameraFromPreferences(); resetCameraFromPreferences();
accountCreator = LinphoneCoreFactory.instance().createAccountCreator(LinphoneManager.getLc(), LinphonePreferences.instance().getXmlrpcUrl());
accountCreator.setDomain(getString(R.string.default_domain));
accountCreator.setListener(this);
} }
private void copyAssetsFromPackage() throws IOException { private void copyAssetsFromPackage() throws IOException {
@ -888,7 +898,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
mLastNetworkType=curtype; mLastNetworkType=curtype;
} }
} }
if (mLc.isNetworkReachable()) { if (mLc.isNetworkReachable()) {
// When network isn't available, push informations might not be set. This should fix the issue. // When network isn't available, push informations might not be set. This should fix the issue.
LinphonePreferences prefs = LinphonePreferences.instance(); LinphonePreferences prefs = LinphonePreferences.instance();
@ -1053,16 +1063,16 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
} }
return null; return null;
} }
public void setAudioManagerInCallMode() { public void setAudioManagerInCallMode() {
if (mAudioManager.getMode() == AudioManager.MODE_IN_COMMUNICATION) { if (mAudioManager.getMode() == AudioManager.MODE_IN_COMMUNICATION) {
Log.w("[AudioManager] already in MODE_IN_COMMUNICATION, skipping..."); Log.w("[AudioManager] already in MODE_IN_COMMUNICATION, skipping...");
return; return;
} }
Log.d("[AudioManager] Mode: MODE_IN_COMMUNICATION"); Log.d("[AudioManager] Mode: MODE_IN_COMMUNICATION");
mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION); mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
} }
@SuppressLint("Wakelock") @SuppressLint("Wakelock")
public void callState(final LinphoneCore lc,final LinphoneCall call, final State state, final String message) { public void callState(final LinphoneCore lc,final LinphoneCall call, final State state, final String message) {
Log.i("New call state [",state,"]"); Log.i("New call state [",state,"]");
@ -1245,7 +1255,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
if (res == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) mAudioFocused=true; if (res == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) mAudioFocused=true;
} }
} }
public void enableDeviceRingtone(boolean use) { public void enableDeviceRingtone(boolean use) {
if (use) { if (use) {
mLc.setRing(null); mLc.setRing(null);
@ -1260,7 +1270,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
routeAudioToSpeaker(); routeAudioToSpeaker();
return; return;
} }
if (mR.getBoolean(R.bool.allow_ringing_while_early_media)) { if (mR.getBoolean(R.bool.allow_ringing_while_early_media)) {
routeAudioToSpeaker(); // Need to be able to ear the ringtone during the early media routeAudioToSpeaker(); // Need to be able to ear the ringtone during the early media
} }
@ -1432,8 +1442,52 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
return incomingPending ? currentCall : null; return incomingPending ? currentCall : null;
} }
public void displayLinkPhoneNumber() {
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(LinphonePreferences.instance().getDefaultAccountIndex()));
accountCreator.isAccountLinked();
}
public void isAccountWithAlias(){
if(LinphoneManager.getLc().getDefaultProxyConfig() != null) {
accountCreator.setUsername(LinphonePreferences.instance().getAccountUsername(LinphonePreferences.instance().getDefaultAccountIndex()));
accountCreator.isAccountUsed();
} else {
LinphonePreferences.instance().setLinkPopupTime(null);
}
}
private void askLinkWithPhoneNumber(){
long now = Calendar.getInstance().getTimeInMillis();
long newDate = now + (LinphoneActivity.instance().getResources().getInteger(R.integer.popup_time_interval)*60);
if (LinphonePreferences.instance().getLinkPopupTime() != null && Long.parseLong(LinphonePreferences.instance().getLinkPopupTime()) > now) {
return;
} else {
LinphonePreferences.instance().setLinkPopupTime(String.valueOf(newDate));
}
final Dialog dialog = LinphoneActivity.instance().displayDialog(String.format(getString(R.string.link_account_popup), LinphoneManager.getLc().getDefaultProxyConfig().getAddress().asStringUriOnly()));
Button delete = (Button) dialog.findViewById(R.id.delete_button);
delete.setText(getString(R.string.link));
Button cancel = (Button) dialog.findViewById(R.id.cancel);
cancel.setText(getString(R.string.maybe_later));
delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LinphoneManager.getInstance().displayLinkPhoneNumber();
dialog.dismiss();
}
});
LinphonePreferences.instance().setLinkPopupTime(String.valueOf(newDate));
cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
dialog.show();
}
@SuppressWarnings("serial") @SuppressWarnings("serial")
public static class LinphoneConfigException extends LinphoneException { public static class LinphoneConfigException extends LinphoneException {
@ -1546,12 +1600,12 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
mAudioManager.abandonAudioFocus(null); mAudioManager.abandonAudioFocus(null);
Log.i("Set audio mode on 'Normal'"); Log.i("Set audio mode on 'Normal'");
} }
@Override @Override
public void friendListCreated(LinphoneCore lc, LinphoneFriendList list) { public void friendListCreated(LinphoneCore lc, LinphoneFriendList list) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
public void friendListRemoved(LinphoneCore lc, LinphoneFriendList list) { public void friendListRemoved(LinphoneCore lc, LinphoneFriendList list) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
@ -1560,12 +1614,48 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
public void authInfoRequested(LinphoneCore lc, String realm, public void authInfoRequested(LinphoneCore lc, String realm,
String username, String domain) { String username, String domain) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
public void authenticationRequested(LinphoneCore lc, public void authenticationRequested(LinphoneCore lc,
LinphoneAuthInfo authInfo, AuthMethod method) { LinphoneAuthInfo authInfo, AuthMethod method) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
}
@Override
public void onAccountCreatorIsAccountUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
if (status.equals(LinphoneAccountCreator.Status.AccountExist)) {
accountCreator.isAccountLinked();
}
}
@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
public void onAccountCreatorIsAccountActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {}
@Override
public void onAccountCreatorPhoneAccountRecovered(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {}
@Override
public void onAccountCreatorIsAccountLinked(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
if (status.equals(LinphoneAccountCreator.Status.AccountNotLinked)) {
askLinkWithPhoneNumber();
}
}
@Override
public void onAccountCreatorIsPhoneNumberUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
} }
} }

View file

@ -551,12 +551,13 @@ private static AssistantActivity instance;
progress.show(); progress.show();
} }
public void displayAssistantConfirm(String username, String password) { public void displayAssistantConfirm(String username, String password, String email) {
CreateAccountActivationFragment fragment = new CreateAccountActivationFragment(); CreateAccountActivationFragment fragment = new CreateAccountActivationFragment();
newAccount = true; newAccount = true;
Bundle extras = new Bundle(); Bundle extras = new Bundle();
extras.putString("Username", username); extras.putString("Username", username);
extras.putString("Password", password); extras.putString("Password", password);
extras.putString("Email", email);
fragment.setArguments(extras); fragment.setArguments(extras);
changeFragment(fragment); changeFragment(fragment);
@ -582,7 +583,8 @@ private static AssistantActivity instance;
public void isAccountVerified(String username) { public void isAccountVerified(String username) {
Toast.makeText(this, getString(R.string.assistant_account_validated), Toast.LENGTH_LONG).show(); Toast.makeText(this, getString(R.string.assistant_account_validated), Toast.LENGTH_LONG).show();
launchEchoCancellerCalibration(true); hideKeyboard();
success();
} }
public void isEchoCalibrationFinished() { public void isEchoCalibrationFinished() {

View file

@ -20,91 +20,106 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import org.linphone.LinphoneManager; import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences; import org.linphone.LinphonePreferences;
import org.linphone.R; import org.linphone.R;
import org.linphone.core.LinphoneXmlRpcRequest; import org.linphone.core.LinphoneAccountCreator;
import org.linphone.core.LinphoneXmlRpcRequest.LinphoneXmlRpcRequestListener; import org.linphone.core.LinphoneAccountCreator.LinphoneAccountCreatorListener;
import org.linphone.core.LinphoneXmlRpcRequestImpl; import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneXmlRpcSession; import org.linphone.mediastream.Log;
import org.linphone.core.LinphoneXmlRpcSessionImpl;
import android.app.Fragment; import android.app.Fragment;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
/** /**
* @author Sylvain Berfini * @author Sylvain Berfini
*/ */
public class CreateAccountActivationFragment extends Fragment implements LinphoneXmlRpcRequestListener { public class CreateAccountActivationFragment extends Fragment implements OnClickListener, LinphoneAccountCreatorListener {
private String username, password; private String username, password;
private Handler mHandler = new Handler();
private Button checkAccount; private Button checkAccount;
private LinphoneXmlRpcSession xmlRpcSession; private TextView email;
private LinphoneXmlRpcRequest xmlRpcRequest; private LinphoneAccountCreator accountCreator;
private Runnable runNotOk, runOk, runNotReachable;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.assistant_account_creation_email_activation, container, false); View view = inflater.inflate(R.layout.assistant_account_creation_email_activation, container, false);
accountCreator = LinphoneCoreFactory.instance().createAccountCreator(LinphoneManager.getLc()
, LinphonePreferences.instance().getXmlrpcUrl());
accountCreator.setDomain(getResources().getString(R.string.default_domain));
accountCreator.setListener(this);
username = getArguments().getString("Username"); username = getArguments().getString("Username");
password = getArguments().getString("Password"); password = getArguments().getString("Password");
checkAccount = (Button) view.findViewById(R.id.assistant_check); accountCreator.setUsername(username);
checkAccount.setOnClickListener(new OnClickListener() { accountCreator.setPassword(password);
@Override
public void onClick(View v) {
checkAccount.setEnabled(false);
isAccountVerified(username);
}
});
runNotOk = new Runnable() { email = (TextView) view.findViewById(R.id.send_email);
public void run() { email.setText(getArguments().getString("Email"));
checkAccount.setEnabled(true);
Toast.makeText(getActivity(), getString(R.string.assistant_account_not_validated), Toast.LENGTH_LONG).show(); checkAccount = (Button) view.findViewById(R.id.assistant_check);
} checkAccount.setOnClickListener(this);
};
runOk = new Runnable() {
public void run() {
checkAccount.setEnabled(true);
AssistantActivity.instance().saveCreatedAccount(username, password, null, null, getString(R.string.default_domain),null);
AssistantActivity.instance().isAccountVerified(username);
}
};
runNotReachable = new Runnable() {
public void run() {
Toast.makeText(getActivity(), getString(R.string.wizard_server_unavailable), Toast.LENGTH_LONG).show();
}
};
xmlRpcSession = new LinphoneXmlRpcSessionImpl(LinphoneManager.getLcIfManagerNotDestroyedOrNull(), LinphonePreferences.instance().getXmlrpcUrl());
xmlRpcRequest = new LinphoneXmlRpcRequestImpl("check_account_validated", LinphoneXmlRpcRequest.ArgType.Int);
xmlRpcRequest.setListener(this);
return view; return view;
} }
@Override @Override
public void onXmlRpcRequestResponse(LinphoneXmlRpcRequest request) { public void onClick(View v) {
if (request.getStatus() == LinphoneXmlRpcRequest.Status.Ok) { switch (v.getId()) {
int response = request.getIntResponse(); case R.id.assistant_check: {
if (response != 1) { checkAccount.setEnabled(false);
mHandler.post(runNotOk); accountCreator.isAccountActivated();
} else { break;
mHandler.post(runOk);
} }
} else if (request.getStatus() == LinphoneXmlRpcRequest.Status.Failed) {
mHandler.post(runNotReachable);
} }
} }
private void isAccountVerified(final String username) { @Override
xmlRpcRequest.addStringArg(username + "@" + getString(R.string.default_domain)); public void onAccountCreatorIsAccountUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
xmlRpcSession.sendRequest(xmlRpcRequest); }
@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
public void onAccountCreatorIsAccountActivated(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
if (status.equals(LinphoneAccountCreator.Status.AccountNotActivated)) {
Toast.makeText(getActivity(), getString(R.string.assistant_account_not_validated), Toast.LENGTH_LONG).show();
} else if (status.equals(LinphoneAccountCreator.Status.AccountActivated)) {
AssistantActivity.instance().saveCreatedAccount(username, password, null, null, getString(R.string.default_domain), null);
AssistantActivity.instance().isAccountVerified(username);
} else {
Toast.makeText(getActivity(), getString(R.string.wizard_server_unavailable), Toast.LENGTH_LONG).show();
}
checkAccount.setEnabled(true);
}
@Override
public void onAccountCreatorPhoneAccountRecovered(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
}
@Override
public void onAccountCreatorIsAccountLinked(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
}
@Override
public void onAccountCreatorIsPhoneNumberUsed(LinphoneAccountCreator accountCreator, LinphoneAccountCreator.Status status) {
} }
} }

View file

@ -41,7 +41,7 @@ import android.widget.Toast;
public class CreateAccountCodeActivationFragment extends Fragment implements LinphoneAccountCreatorListener { public class CreateAccountCodeActivationFragment extends Fragment implements LinphoneAccountCreatorListener {
private String username, phone, dialcode; private String username, phone, dialcode;
private TextView title; private TextView title, phonenumber;
private EditText code; private EditText code;
private boolean recoverAccount = false, linkAccount = false; private boolean recoverAccount = false, linkAccount = false;
private int code_length; private int code_length;
@ -78,6 +78,9 @@ public class CreateAccountCodeActivationFragment extends Fragment implements Lin
title.setText(getString(R.string.assistant_linphone_account)); title.setText(getString(R.string.assistant_linphone_account));
} }
phonenumber = (TextView) view.findViewById(R.id.send_phone_number);
phonenumber.setText(phone);
code = (EditText) view.findViewById(R.id.assistant_code); code = (EditText) view.findViewById(R.id.assistant_code);
code.addTextChangedListener(new TextWatcher() { code.addTextChangedListener(new TextWatcher() {
@Override @Override

View file

@ -32,7 +32,6 @@ import org.linphone.core.LinphoneAccountCreator.LinphoneAccountCreatorListener;
import org.linphone.core.LinphoneAccountCreator.Status; import org.linphone.core.LinphoneAccountCreator.Status;
import org.linphone.core.LinphoneCoreFactory; import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneProxyConfig; import org.linphone.core.LinphoneProxyConfig;
import org.w3c.dom.Text;
import android.accounts.Account; import android.accounts.Account;
import android.accounts.AccountManager; import android.accounts.AccountManager;
@ -152,7 +151,6 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
AssistantActivity.instance().country = c; AssistantActivity.instance().country = c;
selectCountry.setText(c.name); selectCountry.setText(c.name);
} }
LinphoneUtils.setCountry(c, dialCode, selectCountry, countryCode);
//Allow user to enter a username instead use the phone number as username //Allow user to enter a username instead use the phone number as username
if (getResources().getBoolean(R.bool.assistant_allow_username)) { if (getResources().getBoolean(R.bool.assistant_allow_username)) {
@ -320,7 +318,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
if (linkAccount) { if (linkAccount) {
addAlias(); addAlias();
} else { } else {
if (getUsername().length() > 0) { if (!getResources().getBoolean(R.bool.isTablet) || getUsername().length() > 0) {
accountCreator.isAccountUsed(); accountCreator.isAccountUsed();
} else { } else {
LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForStatus(Status.UsernameTooShort) LinphoneUtils.displayErrorAlert(LinphoneUtils.errorForStatus(Status.UsernameTooShort)
@ -601,7 +599,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
if (status.equals(Status.AccountCreated)) { if (status.equals(Status.AccountCreated)) {
if (useEmail.isChecked() || !getResources().getBoolean(R.bool.use_phone_number_validation)) { if (useEmail.isChecked() || !getResources().getBoolean(R.bool.use_phone_number_validation)) {
AssistantActivity.instance().displayAssistantConfirm(getUsername() AssistantActivity.instance().displayAssistantConfirm(getUsername()
, passwordEdit.getText().toString()); , passwordEdit.getText().toString(), emailEdit.getText().toString());
} else { } else {
AssistantActivity.instance().displayAssistantCodeConfirm(getUsername() AssistantActivity.instance().displayAssistantCodeConfirm(getUsername()
, phoneNumberEdit.getText().toString() , phoneNumberEdit.getText().toString()

View file

@ -40,6 +40,7 @@ import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewDebug;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.CheckBox; import android.widget.CheckBox;
@ -103,13 +104,16 @@ public class LinphoneLoginFragment extends Fragment implements CompoundButton.On
if(getResources().getBoolean(R.bool.use_phone_number_validation)){ if(getResources().getBoolean(R.bool.use_phone_number_validation)){
getActivity().getApplicationContext(); getActivity().getApplicationContext();
//Automatically get the country code from the phone //Automatically get the country code from the phone
TelephonyManager tm = (TelephonyManager) getActivity().getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); TelephonyManager tm =
(TelephonyManager) getActivity().getApplicationContext().getSystemService(
Context.TELEPHONY_SERVICE);
String countryIso = tm.getNetworkCountryIso(); String countryIso = tm.getNetworkCountryIso();
LinphoneProxyConfig proxyConfig = LinphoneManager.getLc().createProxyConfig(); LinphoneProxyConfig proxyConfig = LinphoneManager.getLc().createProxyConfig();
countryCode = proxyConfig.lookupCCCFromIso(countryIso.toUpperCase()); countryCode = proxyConfig.lookupCCCFromIso(countryIso.toUpperCase());
AssistantActivity.Country c = AssistantActivity.instance().getCountryListAdapter() AssistantActivity.Country c = AssistantActivity.instance().getCountryListAdapter()
.getCountryFromCountryCode(dialCode.getText().toString()); .getCountryFromCountryCode(String.valueOf(countryCode));
if (c != null) { if (c != null) {
AssistantActivity.instance().country = c; AssistantActivity.instance().country = c;
selectCountry.setText(c.name); selectCountry.setText(c.name);
@ -124,8 +128,6 @@ public class LinphoneLoginFragment extends Fragment implements CompoundButton.On
phoneNumberEdit.setText(previousPhone); phoneNumberEdit.setText(previousPhone);
} }
LinphoneUtils.setCountry(AssistantActivity.instance().country, dialCode, selectCountry, countryCode);
//Allow user to enter a username instead use the phone number as username //Allow user to enter a username instead use the phone number as username
if(getResources().getBoolean(R.bool.assistant_allow_username) ) { if(getResources().getBoolean(R.bool.assistant_allow_username) ) {
useUsername.setVisibility(View.VISIBLE); useUsername.setVisibility(View.VISIBLE);

@ -1 +1 @@
Subproject commit a5a65227b36d0cfb6d4b34b93521986bc371b685 Subproject commit 5529671088b6711b90c5abc21d972a3d20e5f124