fix crash on simulator when setting display name
This commit is contained in:
parent
b9af736651
commit
26713913fb
3 changed files with 8 additions and 5 deletions
|
@ -35,10 +35,8 @@ import org.linphone.core.LinphoneProxyConfig;
|
|||
import org.linphone.core.LinphoneCore.GeneralState;
|
||||
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.ConnectivityManager;
|
||||
|
@ -253,7 +251,8 @@ public class LinphoneService extends Service implements LinphoneCoreListener {
|
|||
}
|
||||
//init network state
|
||||
ConnectivityManager lConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
mLinphoneCore.setNetworkStateReachable(lConnectivityManager.getActiveNetworkInfo().getState() ==NetworkInfo.State.CONNECTED);
|
||||
NetworkInfo lInfo = lConnectivityManager.getActiveNetworkInfo();
|
||||
mLinphoneCore.setNetworkStateReachable( lInfo !=null? lConnectivityManager.getActiveNetworkInfo().getState() ==NetworkInfo.State.CONNECTED:false);
|
||||
|
||||
} catch (LinphoneCoreException e) {
|
||||
throw new LinphoneConfigException(getString(R.string.wrong_settings),e);
|
||||
|
|
|
@ -29,13 +29,17 @@ public class LinphoneAddressImpl implements LinphoneAddress {
|
|||
private native String getUserName(long ptr);
|
||||
private native String getDomain(long ptr);
|
||||
private native String toUri(long ptr);
|
||||
private native String setDisplayName(long ptr,String name);
|
||||
private native void setDisplayName(long ptr,String name);
|
||||
private native String toString(long ptr);
|
||||
|
||||
|
||||
protected LinphoneAddressImpl(String username,String domain,String displayName) {
|
||||
nativePtr = newLinphoneAddressImpl("sip:"+username+"@"+domain, displayName);
|
||||
}
|
||||
protected LinphoneAddressImpl(long aNativePtr,boolean javaOwnPtr) {
|
||||
nativePtr = aNativePtr;
|
||||
ownPtr=javaOwnPtr;
|
||||
}
|
||||
protected LinphoneAddressImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
ownPtr=false;
|
||||
|
|
|
@ -177,7 +177,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
public LinphoneAddress interpretUrl(String destination) throws LinphoneCoreException {
|
||||
long lAddress = interpretUrl(nativePtr,destination);
|
||||
if (lAddress != 0) {
|
||||
return new LinphoneAddressImpl(lAddress);
|
||||
return new LinphoneAddressImpl(lAddress,true);
|
||||
} else {
|
||||
throw new LinphoneCoreException("Cannot interpret ["+destination+"]");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue