diff --git a/.project b/.project index 7ce4f487d..f9c163d50 100644 --- a/.project +++ b/.project @@ -1,33 +1,33 @@ - - - linphone-android - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - + + + linphone-android + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/libs/armeabi-v7a/liblinphone.so b/libs/armeabi-v7a/liblinphone.so new file mode 100644 index 000000000..78ea1bceb Binary files /dev/null and b/libs/armeabi-v7a/liblinphone.so differ diff --git a/libs/armeabi/liblinphone.so b/libs/armeabi/liblinphone.so index 6514cc7ec..4df89d27c 100755 Binary files a/libs/armeabi/liblinphone.so and b/libs/armeabi/liblinphone.so differ diff --git a/res/raw/linphonerc b/res/raw/linphonerc index 2713fb211..5bc29692c 100644 --- a/res/raw/linphonerc +++ b/res/raw/linphonerc @@ -30,6 +30,7 @@ ringer_dev_id=ANDROID SND: Android Sound card capture_dev_id=ANDROID SND: Android Sound card remote_ring=/data/data/org.linphone/files/ringback.wav local_ring=/data/data/org.linphone/files/oldphone_mono.wav -ec_delay=200 +ec_delay=250 +ec_tail_len=300 diff --git a/res/values/strings.xml b/res/values/strings.xml index 764fff541..f802d269a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1,5 +1,6 @@ + ILBC codec not avalaible on old phone Echo cancellation pref_echo_cancellation_key If set cellular call are redirected to voip when possible @@ -52,7 +53,7 @@ Yes No Never remind me -%s, do you want to return to the settings page ? +%s, do you want to go to the settings page ? No initial config found, do you want to return to the settings page ? Cannot initiate a new call because a call is already engaged History diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index bfd8e8710..60d1daa0a 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -16,7 +16,7 @@ + android:title="@string/pref_codec_speex8" android:defaultValue="true"> - + diff --git a/src/org/linphone/LinphonePreferencesActivity.java b/src/org/linphone/LinphonePreferencesActivity.java index 965e8f8a3..d90bf308f 100644 --- a/src/org/linphone/LinphonePreferencesActivity.java +++ b/src/org/linphone/LinphonePreferencesActivity.java @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package org.linphone; -import android.os.Build; + import android.os.Bundle; import android.preference.PreferenceActivity; import android.util.Log; @@ -29,8 +29,23 @@ public class LinphonePreferencesActivity extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + boolean enableIlbc=false; + if (LinphoneService.isready()) { + enableIlbc = LinphoneService.instance().getLinphoneCore().findPayloadType("iLBC", 8000)!=null?true:false;; + if (enableIlbc && !getPreferenceManager().getSharedPreferences().contains(getString(R.string.pref_echo_cancellation_key))) { + getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(R.string.pref_echo_cancellation_key), true).commit(); + } + if (!enableIlbc) { + getPreferenceManager().getSharedPreferences().edit().putBoolean(getString(R.string.pref_codec_ilbc_key), false).commit(); + } + + } // Load the preferences from an XML resource addPreferencesFromResource(R.xml.preferences); + if (enableIlbc) { + getPreferenceScreen().findPreference(getString(R.string.pref_codec_ilbc_key)).setEnabled(enableIlbc); + } + } @Override diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index 72c5e5ee2..33b2ae6e2 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -92,7 +92,7 @@ public class LinphoneService extends Service implements LinphoneCoreListener { super.onCreate(); theLinphone = this; - mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotification = new Notification(R.drawable.status_level , "" , System.currentTimeMillis()); @@ -254,7 +254,49 @@ public class LinphoneService extends Service implements LinphoneCoreListener { boolean lIsDebug = mPref.getBoolean(getString(R.string.pref_debug_key), false); LinphoneCoreFactory.instance().setDebugMode(lIsDebug); - + try { + //codec config + PayloadType lPt = mLinphoneCore.findPayloadType("speex", 32000); + if (lPt !=null) { + boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex32_key),false); + mLinphoneCore.enablePayloadType(lPt, enable); + } + lPt = mLinphoneCore.findPayloadType("speex", 16000); + if (lPt !=null) { + boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex16_key),false); + mLinphoneCore.enablePayloadType(lPt, enable); + } + lPt = mLinphoneCore.findPayloadType("speex", 8000); + if (lPt !=null) { + boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex8_key),false); + mLinphoneCore.enablePayloadType(lPt, enable); + } + lPt = mLinphoneCore.findPayloadType("iLBC", 8000); + if (lPt !=null) { + boolean enable= mPref.getBoolean(getString(R.string.pref_codec_ilbc_key),false); + mLinphoneCore.enablePayloadType(lPt, enable); + } + lPt = mLinphoneCore.findPayloadType("GSM", 8000); + if (lPt !=null) { + boolean enable= mPref.getBoolean(getString(R.string.pref_codec_gsm_key),false); + mLinphoneCore.enablePayloadType(lPt, enable); + } + lPt = mLinphoneCore.findPayloadType("PCMU", 8000); + if (lPt !=null) { + boolean enable= mPref.getBoolean(getString(R.string.pref_codec_pcmu_key),false); + mLinphoneCore.enablePayloadType(lPt, enable); + } + lPt = mLinphoneCore.findPayloadType("PCMA", 8000); + if (lPt !=null) { + boolean enable= mPref.getBoolean(getString(R.string.pref_codec_pcma_key),false); + mLinphoneCore.enablePayloadType(lPt, enable); + } + + + mLinphoneCore.enableEchoCancellation(mPref.getBoolean(getString(R.string.pref_echo_cancellation_key),false)); + } catch (LinphoneCoreException e) { + throw new LinphoneConfigException(getString(R.string.wrong_settings),e); + } //1 read proxy config from preferences String lUserName = mPref.getString(getString(R.string.pref_username_key), null); if (lUserName == null || lUserName.length()==0) { @@ -316,43 +358,7 @@ public class LinphoneService extends Service implements LinphoneCoreListener { } - //codec config - PayloadType lPt = mLinphoneCore.findPayloadType("speex", 32000); - if (lPt !=null) { - boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex32_key),false); - mLinphoneCore.enablePayloadType(lPt, enable); - } - lPt = mLinphoneCore.findPayloadType("speex", 16000); - if (lPt !=null) { - boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex16_key),false); - mLinphoneCore.enablePayloadType(lPt, enable); - } - lPt = mLinphoneCore.findPayloadType("speex", 8000); - if (lPt !=null) { - boolean enable= mPref.getBoolean(getString(R.string.pref_codec_speex8_key),false); - mLinphoneCore.enablePayloadType(lPt, enable); - } - lPt = mLinphoneCore.findPayloadType("GSM", 8000); - if (lPt !=null) { - boolean enable= mPref.getBoolean(getString(R.string.pref_codec_gsm_key),false); - mLinphoneCore.enablePayloadType(lPt, enable); - } - lPt = mLinphoneCore.findPayloadType("PCMU", 8000); - if (lPt !=null) { - boolean enable= mPref.getBoolean(getString(R.string.pref_codec_pcmu_key),false); - mLinphoneCore.enablePayloadType(lPt, enable); - } - lPt = mLinphoneCore.findPayloadType("PCMA", 8000); - if (lPt !=null) { - boolean enable= mPref.getBoolean(getString(R.string.pref_codec_pcma_key),false); - mLinphoneCore.enablePayloadType(lPt, enable); - } - - if (!mPref.contains(getString(R.string.pref_echo_cancellation_key)) && Integer.parseInt(Build.VERSION.SDK) > 4 /*donuts*/) { - mPref.edit().putBoolean(getString(R.string.pref_echo_cancellation_key), true).commit(); - } - - mLinphoneCore.enableEchoCancellation(mPref.getBoolean(getString(R.string.pref_echo_cancellation_key),false)); + //init network state ConnectivityManager lConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); diff --git a/submodules/linphone b/submodules/linphone index 94fdd26f2..94b38f943 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 94fdd26f225d63a2be2fb2bb1ef4e27275431ac7 +Subproject commit 94b38f943d37072154c55094ed2a6d7b4cecbe0e