From 573ad6c8899edc199f2396ca5f709e61c643100a Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 19 Sep 2012 11:48:48 +0200 Subject: [PATCH 01/60] Fix LC iterate issue --- src/org/linphone/LinphoneManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index f20ebba61..b96f98bb6 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -807,8 +807,12 @@ public final class LinphoneManager implements LinphoneCoreListener { try { mTimer.cancel(); mLc.destroy(); + } + catch (RuntimeException e) { + e.printStackTrace(); + } + finally { mServiceContext.unregisterReceiver(instance.mKeepAliveReceiver); - } finally { mLc = null; instance = null; } From 4e53b4c9056d2c77188e68ccd409b4437fcb51b6 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 21 Sep 2012 16:23:10 +0200 Subject: [PATCH 02/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index e93d9096f..9b514a8ef 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit e93d9096ff433d3195c177e4c767881406e71d88 +Subproject commit 9b514a8efb44fbc6fd73a2dda8acb4a776e91089 From 36c1cf10803f7e19fb5d3a04997593cc73ec51a5 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 19 Sep 2012 17:24:38 +0200 Subject: [PATCH 03/60] Add JNI to access call statistics. --- src/org/linphone/LinphoneManager.java | 4 + src/org/linphone/core/LinphoneCallImpl.java | 15 ++++ .../linphone/core/LinphoneCallStatsImpl.java | 83 +++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 src/org/linphone/core/LinphoneCallStatsImpl.java diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index b96f98bb6..a6b19e7eb 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -56,6 +56,8 @@ import org.linphone.core.LinphoneAddress; import org.linphone.core.LinphoneAuthInfo; import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall.State; +import org.linphone.core.LinphoneCallStats; +import org.linphone.core.LinphoneCallStats.MediaType; import org.linphone.core.LinphoneChatRoom; import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCore.EcCalibratorStatus; @@ -1033,6 +1035,8 @@ public final class LinphoneManager implements LinphoneCoreListener { mListenerDispatcher.onCallStateChanged(call, state, message); } + public void callStatsUpdated(final LinphoneCore lc, final LinphoneCall call, final LinphoneCallStats stats) {} + public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call, boolean encrypted, String authenticationToken) { mListenerDispatcher.onCallEncryptionChanged(call, encrypted, authenticationToken); diff --git a/src/org/linphone/core/LinphoneCallImpl.java b/src/org/linphone/core/LinphoneCallImpl.java index 27ed253ef..12af1d345 100644 --- a/src/org/linphone/core/LinphoneCallImpl.java +++ b/src/org/linphone/core/LinphoneCallImpl.java @@ -23,6 +23,9 @@ class LinphoneCallImpl implements LinphoneCall { protected final long nativePtr; boolean ownPtr = false; + private LinphoneCallStats audioStats; + private LinphoneCallStats videoStats; + native private void finalize(long nativePtr); native private long getCallLog(long nativePtr); private native boolean isIncoming(long nativePtr); @@ -58,6 +61,18 @@ class LinphoneCallImpl implements LinphoneCall { return null; } } + public void setAudioStats(LinphoneCallStats stats) { + audioStats = stats; + } + public void setVideoStats(LinphoneCallStats stats) { + videoStats = stats; + } + public LinphoneCallStats getAudioStats() { + return audioStats; + } + public LinphoneCallStats getVideoStats() { + return videoStats; + } public CallDirection getDirection() { return isIncoming(nativePtr)?CallDirection.Incoming:CallDirection.Outgoing; } diff --git a/src/org/linphone/core/LinphoneCallStatsImpl.java b/src/org/linphone/core/LinphoneCallStatsImpl.java new file mode 100644 index 000000000..ffc19eddc --- /dev/null +++ b/src/org/linphone/core/LinphoneCallStatsImpl.java @@ -0,0 +1,83 @@ +/* +LinPhoneCallStatsImpl.java +Copyright (C) 2010 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +package org.linphone.core; + + +class LinphoneCallStatsImpl implements LinphoneCallStats { + private int mediaType; + private float senderLossRate; + private float receiverLossRate; + private float senderInterarrivalJitter; + private float receiverInterarrivalJitter; + private float roundTripDelay; + private long latePacketsCumulativeNumber; + private float jitterBufferSize; + + private native int getMediaType(long nativeStatsPtr); + private native float getSenderLossRate(long nativeStatsPtr); + private native float getReceiverLossRate(long nativeStatsPtr); + private native float getSenderInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr); + private native float getReceiverInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr); + private native float getRoundTripDelay(long nativeStatsPtr); + private native long getLatePacketsCumulativeNumber(long nativeStatsPtr, long nativeCallPtr); + private native float getJitterBufferSize(long nativeStatsPtr); + + protected LinphoneCallStatsImpl(long nativeCallPtr, long nativeStatsPtr) { + mediaType = getMediaType(nativeStatsPtr); + senderLossRate = getSenderLossRate(nativeStatsPtr); + receiverLossRate = getReceiverLossRate(nativeStatsPtr); + senderInterarrivalJitter = getSenderInterarrivalJitter(nativeStatsPtr, nativeCallPtr); + receiverInterarrivalJitter = getReceiverInterarrivalJitter(nativeStatsPtr, nativeCallPtr); + roundTripDelay = getRoundTripDelay(nativeStatsPtr); + latePacketsCumulativeNumber = getLatePacketsCumulativeNumber(nativeStatsPtr, nativeCallPtr); + jitterBufferSize = getJitterBufferSize(nativeStatsPtr); + } + + public MediaType getMediaType() { + return MediaType.fromInt(mediaType); + } + + public float getSenderLossRate() { + return senderLossRate; + } + + public float getReceiverLossRate() { + return receiverLossRate; + } + + public float getSenderInterarrivalJitter() { + return senderInterarrivalJitter; + } + + public float getReceiverInterarrivalJitter() { + return receiverInterarrivalJitter; + } + + public float getRoundTripDelay() { + return roundTripDelay; + } + + public long getLatePacketsCumulativeNumber() { + return latePacketsCumulativeNumber; + } + + public float getJitterBufferSize() { + return jitterBufferSize; + } +} From f761b3ed5b7c01991ceaa2e9c60a0c33f193be58 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 2 Oct 2012 09:28:13 +0200 Subject: [PATCH 04/60] update linphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 9b514a8ef..da86c6924 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 9b514a8efb44fbc6fd73a2dda8acb4a776e91089 +Subproject commit da86c692414095b3e25822ebd73f85bde678f5ce From f4100653f1b1e85592fcdd90c531a1810e878b09 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 2 Oct 2012 11:08:19 +0200 Subject: [PATCH 05/60] update linphone submodule --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index da86c6924..2b7af371f 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit da86c692414095b3e25822ebd73f85bde678f5ce +Subproject commit 2b7af371f94040941cfae5d1364751eb8963a7f7 From 038e2fc30b9c26b25302f6707faaa1bbc44065ab Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 4 Oct 2012 17:07:28 +0200 Subject: [PATCH 06/60] Added DTMF listener --- .classpath | 3 +-- build.xml | 4 ++-- src/org/linphone/LinphoneManager.java | 11 ++++++++++- src/org/linphone/LinphoneSimpleListener.java | 4 ++++ submodules/linphone | 2 +- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.classpath b/.classpath index 902041fc9..f4e4d7517 100644 --- a/.classpath +++ b/.classpath @@ -4,8 +4,7 @@ - - + diff --git a/build.xml b/build.xml index 1e18ac78e..db69a1e7c 100644 --- a/build.xml +++ b/build.xml @@ -1048,10 +1048,10 @@ - + diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index a6b19e7eb..2dbdffcd1 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -49,6 +49,7 @@ import java.util.TimerTask; import org.linphone.LinphoneSimpleListener.LinphoneOnAudioChangedListener; import org.linphone.LinphoneSimpleListener.LinphoneOnAudioChangedListener.AudioState; +import org.linphone.LinphoneSimpleListener.LinphoneOnDTMFReceivedListener; import org.linphone.LinphoneSimpleListener.LinphoneOnTextReceivedListener; import org.linphone.LinphoneSimpleListener.LinphoneServiceListener; import org.linphone.core.CallDirection; @@ -57,7 +58,6 @@ import org.linphone.core.LinphoneAuthInfo; import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCallStats; -import org.linphone.core.LinphoneCallStats.MediaType; import org.linphone.core.LinphoneChatRoom; import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCore.EcCalibratorStatus; @@ -908,6 +908,11 @@ public final class LinphoneManager implements LinphoneCoreListener { public void setOnTextReceivedListener(LinphoneOnTextReceivedListener listener) { textReceivedListener = listener; } + + private LinphoneOnDTMFReceivedListener dtmfReceivedListener; + public void setOnDTMFReceivedListener(LinphoneOnDTMFReceivedListener listener) { + dtmfReceivedListener = listener; + } public void displayWarning(LinphoneCore lc, String message) {} public void authInfoRequested(LinphoneCore lc, String realm, String username) {} @@ -921,6 +926,10 @@ public final class LinphoneManager implements LinphoneCoreListener { if (textReceivedListener != null) textReceivedListener.onTextReceived(from, message); } + public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) { + if (dtmfReceivedListener != null) + dtmfReceivedListener.onDTMFReceived(call, dtmf); + } public String getLastLcStatusMessage() { diff --git a/src/org/linphone/LinphoneSimpleListener.java b/src/org/linphone/LinphoneSimpleListener.java index 87d27980c..0a10cebf1 100644 --- a/src/org/linphone/LinphoneSimpleListener.java +++ b/src/org/linphone/LinphoneSimpleListener.java @@ -62,5 +62,9 @@ public interface LinphoneSimpleListener { public static interface LinphoneOnTextReceivedListener extends LinphoneSimpleListener { void onTextReceived(LinphoneAddress from, String message); } + + public static interface LinphoneOnDTMFReceivedListener extends LinphoneSimpleListener { + void onDTMFReceived(LinphoneCall call, int dtmf); + } } diff --git a/submodules/linphone b/submodules/linphone index 2b7af371f..7e541dc76 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 2b7af371f94040941cfae5d1364751eb8963a7f7 +Subproject commit 7e541dc76ac34aba16cbe2656493b3573c1d9afb From 6344e9eabcc020519dc200803fb0804801e92b8f Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 15 Oct 2012 16:46:42 +0200 Subject: [PATCH 07/60] Updated liblinphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 7e541dc76..18c23b44e 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 7e541dc76ac34aba16cbe2656493b3573c1d9afb +Subproject commit 18c23b44ea6875bbed2779e5392defc3f8ce0dfb From b4576a003604819bf3ec72d7fa0c625c43134375 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 16 Oct 2012 16:50:39 +0200 Subject: [PATCH 08/60] Update linphone submodule for echo canceller. --- .classpath | 1 + src/org/linphone/LinphoneManager.java | 2 + .../linphone/core/LinphoneAddressImpl.java | 100 --- .../linphone/core/LinphoneAuthInfoImpl.java | 56 -- src/org/linphone/core/LinphoneCallImpl.java | 183 ----- .../linphone/core/LinphoneCallLogImpl.java | 59 -- .../linphone/core/LinphoneCallParamsImpl.java | 68 -- .../linphone/core/LinphoneCallStatsImpl.java | 83 -- .../linphone/core/LinphoneChatRoomImpl.java | 37 - .../core/LinphoneCoreFactoryImpl.java | 182 ----- src/org/linphone/core/LinphoneCoreImpl.java | 737 ------------------ src/org/linphone/core/LinphoneFriendImpl.java | 80 -- .../core/LinphoneProxyConfigImpl.java | 146 ---- src/org/linphone/core/Log.java | 112 --- src/org/linphone/core/PayloadTypeImpl.java | 45 -- .../tutorials/AndroidTutorialNotifier.java | 50 -- .../TutorialBuddyStatusActivity.java | 109 --- .../tutorials/TutorialChatRoomActivity.java | 98 --- .../tutorials/TutorialHelloWorldActivity.java | 98 --- .../TutorialRegistrationActivity.java | 103 --- src/org/linphone/core/video/VideoUtil.java | 42 - submodules/externals/exosip | 2 +- submodules/externals/openssl | 2 +- submodules/linphone | 2 +- 24 files changed, 6 insertions(+), 2391 deletions(-) delete mode 100644 src/org/linphone/core/LinphoneAddressImpl.java delete mode 100644 src/org/linphone/core/LinphoneAuthInfoImpl.java delete mode 100644 src/org/linphone/core/LinphoneCallImpl.java delete mode 100644 src/org/linphone/core/LinphoneCallLogImpl.java delete mode 100644 src/org/linphone/core/LinphoneCallParamsImpl.java delete mode 100644 src/org/linphone/core/LinphoneCallStatsImpl.java delete mode 100644 src/org/linphone/core/LinphoneChatRoomImpl.java delete mode 100644 src/org/linphone/core/LinphoneCoreFactoryImpl.java delete mode 100644 src/org/linphone/core/LinphoneCoreImpl.java delete mode 100644 src/org/linphone/core/LinphoneFriendImpl.java delete mode 100644 src/org/linphone/core/LinphoneProxyConfigImpl.java delete mode 100644 src/org/linphone/core/Log.java delete mode 100644 src/org/linphone/core/PayloadTypeImpl.java delete mode 100644 src/org/linphone/core/tutorials/AndroidTutorialNotifier.java delete mode 100644 src/org/linphone/core/tutorials/TutorialBuddyStatusActivity.java delete mode 100644 src/org/linphone/core/tutorials/TutorialChatRoomActivity.java delete mode 100644 src/org/linphone/core/tutorials/TutorialHelloWorldActivity.java delete mode 100644 src/org/linphone/core/tutorials/TutorialRegistrationActivity.java delete mode 100644 src/org/linphone/core/video/VideoUtil.java diff --git a/.classpath b/.classpath index f4e4d7517..2f426d651 100644 --- a/.classpath +++ b/.classpath @@ -4,6 +4,7 @@ + diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 2dbdffcd1..51fc3bd1b 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -66,6 +66,7 @@ import org.linphone.core.LinphoneCore.GlobalState; import org.linphone.core.LinphoneCore.MediaEncryption; import org.linphone.core.LinphoneCore.RegistrationState; import org.linphone.core.LinphoneCore.Transports; +import org.linphone.core.LinphoneChatMessage; import org.linphone.core.LinphoneCoreException; import org.linphone.core.LinphoneCoreFactory; import org.linphone.core.LinphoneCoreListener; @@ -926,6 +927,7 @@ public final class LinphoneManager implements LinphoneCoreListener { if (textReceivedListener != null) textReceivedListener.onTextReceived(from, message); } + public void messageReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneChatMessage message) {} public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) { if (dtmfReceivedListener != null) dtmfReceivedListener.onDTMFReceived(call, dtmf); diff --git a/src/org/linphone/core/LinphoneAddressImpl.java b/src/org/linphone/core/LinphoneAddressImpl.java deleted file mode 100644 index b9d290971..000000000 --- a/src/org/linphone/core/LinphoneAddressImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* -LinphoneAddressImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - - - -public class LinphoneAddressImpl implements LinphoneAddress { - protected final long nativePtr; - boolean ownPtr = false; - private native long newLinphoneAddressImpl(String uri,String displayName); - private native void delete(long ptr); - private native String getDisplayName(long ptr); - private native String getUserName(long ptr); - private native String getDomain(long ptr); - private native String toUri(long ptr); - private native void setDisplayName(long ptr,String name); - private native String toString(long ptr); - - protected LinphoneAddressImpl(String identity) { - nativePtr = newLinphoneAddressImpl(identity, null); - } - - 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; - } - protected void finalize() throws Throwable { - if (ownPtr) delete(nativePtr); - } - public String getDisplayName() { - return getDisplayName(nativePtr); - } - public String getDomain() { - return getDomain(nativePtr); - } - public String getUserName() { - return getUserName(nativePtr); - } - - public String toString() { - return toString(nativePtr); - } - public String toUri() { - return toUri(nativePtr); - } - public void setDisplayName(String name) { - setDisplayName(nativePtr,name); - } - public String asString() { - return toString(); - } - public String asStringUriOnly() { - return toUri(nativePtr); - } - public void clean() { - throw new RuntimeException("Not implemented"); - } - public String getPort() { - return String.valueOf(getPortInt()); - } - public int getPortInt() { - return getPortInt(); - } - public void setDomain(String domain) { - throw new RuntimeException("Not implemented"); - } - public void setPort(String port) { - throw new RuntimeException("Not implemented"); - } - public void setPortInt(int port) { - throw new RuntimeException("Not implemented"); - } - public void setUserName(String username) { - throw new RuntimeException("Not implemented"); - } - -} diff --git a/src/org/linphone/core/LinphoneAuthInfoImpl.java b/src/org/linphone/core/LinphoneAuthInfoImpl.java deleted file mode 100644 index 7f9e54dd2..000000000 --- a/src/org/linphone/core/LinphoneAuthInfoImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/* -LinphoneAuthInfoImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - -class LinphoneAuthInfoImpl implements LinphoneAuthInfo { - protected final long nativePtr; - private native long newLinphoneAuthInfo(String username, String userid, String passwd, String ha1,String realm); - private native void delete(long ptr); - protected LinphoneAuthInfoImpl(String username,String password, String realm) { - nativePtr = newLinphoneAuthInfo(username,null,password,null,realm); - } - protected void finalize() throws Throwable { - delete(nativePtr); - } - public String getPassword() { - // TODO Auto-generated method stub - throw new RuntimeException("not implemeneted yet"); - } - public String getRealm() { - // TODO Auto-generated method stub - throw new RuntimeException("not implemeneted yet"); - } - public String getUsername() { - // TODO Auto-generated method stub - throw new RuntimeException("not implemeneted yet"); - } - public void setPassword(String password) { - // TODO Auto-generated method stub - throw new RuntimeException("not implemeneted yet"); - - } - public void setRealm(String realm) { - // TODO Auto-generated method stub - throw new RuntimeException("not implemeneted yet"); - } - public void setUsername(String username) { - // TODO Auto-generated method stub - throw new RuntimeException("not implemeneted yet"); - } -} diff --git a/src/org/linphone/core/LinphoneCallImpl.java b/src/org/linphone/core/LinphoneCallImpl.java deleted file mode 100644 index 12af1d345..000000000 --- a/src/org/linphone/core/LinphoneCallImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -/* -LinphoneCallImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - - -class LinphoneCallImpl implements LinphoneCall { - - protected final long nativePtr; - boolean ownPtr = false; - private LinphoneCallStats audioStats; - private LinphoneCallStats videoStats; - - native private void finalize(long nativePtr); - native private long getCallLog(long nativePtr); - private native boolean isIncoming(long nativePtr); - native private long getRemoteAddress(long nativePtr); - native private int getState(long nativePtr); - private native long getCurrentParamsCopy(long nativePtr); - private native long getRemoteParams(long nativePtr); - private native void enableCamera(long nativePtr, boolean enabled); - private native boolean cameraEnabled(long nativePtr); - private native void enableEchoCancellation(long nativePtr,boolean enable); - private native boolean isEchoCancellationEnabled(long nativePtr) ; - private native void enableEchoLimiter(long nativePtr,boolean enable); - private native boolean isEchoLimiterEnabled(long nativePtr); - private native Object getReplacedCall(long nativePtr); - private native int getDuration(long nativePtr); - private native float getCurrentQuality(long nativePtr); - private native float getAverageQuality(long nativePtr); - - /* - * This method must always be called from JNI, nothing else. - */ - private LinphoneCallImpl(long aNativePtr) { - nativePtr = aNativePtr; - } - protected void finalize() throws Throwable { - finalize(nativePtr); - } - public LinphoneCallLog getCallLog() { - long lNativePtr = getCallLog(nativePtr); - if (lNativePtr!=0) { - return new LinphoneCallLogImpl(lNativePtr); - } else { - return null; - } - } - public void setAudioStats(LinphoneCallStats stats) { - audioStats = stats; - } - public void setVideoStats(LinphoneCallStats stats) { - videoStats = stats; - } - public LinphoneCallStats getAudioStats() { - return audioStats; - } - public LinphoneCallStats getVideoStats() { - return videoStats; - } - public CallDirection getDirection() { - return isIncoming(nativePtr)?CallDirection.Incoming:CallDirection.Outgoing; - } - public LinphoneAddress getRemoteAddress() { - long lNativePtr = getRemoteAddress(nativePtr); - if (lNativePtr!=0) { - return new LinphoneAddressImpl(lNativePtr); - } else { - return null; - } - } - public State getState() { - return LinphoneCall.State.fromInt(getState(nativePtr)); - } - public LinphoneCallParams getCurrentParamsCopy() { - return new LinphoneCallParamsImpl(getCurrentParamsCopy(nativePtr)); - } - public LinphoneCallParams getRemoteParams() { - return new LinphoneCallParamsImpl(getRemoteParams(nativePtr)); - } - public void enableCamera(boolean enabled) { - enableCamera(nativePtr, enabled); - } - public boolean cameraEnabled() { - return cameraEnabled(nativePtr); - } - - @Override - public boolean equals(Object call) { - if (this == call) return true; - if (call == null) return false; - if (!(call instanceof LinphoneCallImpl)) return false; - return nativePtr == ((LinphoneCallImpl)call).nativePtr; - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + (int) (nativePtr ^ (nativePtr >>> 32)); - return result; - } - public void enableEchoCancellation(boolean enable) { - enableEchoCancellation(nativePtr,enable); - - } - public boolean isEchoCancellationEnabled() { - return isEchoCancellationEnabled(nativePtr); - } - public void enableEchoLimiter(boolean enable) { - enableEchoLimiter(nativePtr,enable); - } - public boolean isEchoLimiterEnabled() { - return isEchoLimiterEnabled(nativePtr); - } - public LinphoneCall getReplacedCall(){ - return (LinphoneCall)getReplacedCall(nativePtr); - } - - public int getDuration() { - return getDuration(nativePtr); - } - public float getAverageQuality() { - return getAverageQuality(nativePtr); - } - public float getCurrentQuality() { - return getCurrentQuality(nativePtr); - } - - private native String getAuthenticationToken(long nativePtr); - public String getAuthenticationToken(){ - return getAuthenticationToken(nativePtr); - } - - private native boolean isAuthenticationTokenVerified(long nativePtr); - public boolean isAuthenticationTokenVerified(){ - return isAuthenticationTokenVerified(nativePtr); - } - - private native boolean setAuthenticationTokenVerified(long nativePtr, boolean verified); - public void setAuthenticationTokenVerified(boolean verified){ - setAuthenticationTokenVerified(nativePtr, verified); - } - - public boolean isInConference() { - LinphoneCallParamsImpl params = new LinphoneCallParamsImpl(getCurrentParamsCopy(nativePtr)); - return params.localConferenceMode(); - } - - @Override - public String toString() { - return "Call " + nativePtr; - } - - private native float getPlayVolume(long nativePtr); - public float getPlayVolume() { - return getPlayVolume(nativePtr); - } - - private native void takeSnapshot(long nativePtr, String path); - public void takeSnapshot(String path) { - takeSnapshot(nativePtr, path); - } - - private native void zoomVideo(long nativePtr, float factor, float cx, float cy); - public void zoomVideo(float factor, float cx, float cy) { - zoomVideo(nativePtr, factor, cx, cy); - } -} diff --git a/src/org/linphone/core/LinphoneCallLogImpl.java b/src/org/linphone/core/LinphoneCallLogImpl.java deleted file mode 100644 index 895e27a38..000000000 --- a/src/org/linphone/core/LinphoneCallLogImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -LinPhoneCallLogImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - - -class LinphoneCallLogImpl implements LinphoneCallLog { - - protected final long nativePtr; - - private native long getFrom(long nativePtr); - private native long getTo(long nativePtr); - private native boolean isIncoming(long nativePtr); - LinphoneCallLogImpl(long aNativePtr) { - nativePtr = aNativePtr; - } - - - public CallDirection getDirection() { - return isIncoming(nativePtr)?CallDirection.Incoming:CallDirection.Outgoing; - } - - public LinphoneAddress getFrom() { - return new LinphoneAddressImpl(getFrom(nativePtr)); - } - - public LinphoneAddress getTo() { - return new LinphoneAddressImpl(getTo(nativePtr)); - } - public CallStatus getStatus() { - throw new RuntimeException("not implemented yet"); - } - @Override - public String getStartDate() { - // TODO Auto-generated method stub - return null; - } - @Override - public int getCallDuration() { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/src/org/linphone/core/LinphoneCallParamsImpl.java b/src/org/linphone/core/LinphoneCallParamsImpl.java deleted file mode 100644 index bb7e9b1ab..000000000 --- a/src/org/linphone/core/LinphoneCallParamsImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -LinphoneCallParamsImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - -import org.linphone.core.LinphoneCore.MediaEncryption; - -public class LinphoneCallParamsImpl implements LinphoneCallParams { - protected final long nativePtr; - - public LinphoneCallParamsImpl(long nativePtr) { - this.nativePtr = nativePtr; - } - - private native void enableVideo(long nativePtr, boolean b); - private native boolean getVideoEnabled(long nativePtr); - private native void audioBandwidth(long nativePtr, int bw); - private native void setMediaEncryption(long nativePtr, int menc); - private native int getMediaEncryption(long nativePtr); - private native void destroy(long nativePtr); - - - public boolean getVideoEnabled() { - return getVideoEnabled(nativePtr); - } - - public void setVideoEnabled(boolean b) { - enableVideo(nativePtr, b); - } - - @Override - protected void finalize() throws Throwable { - destroy(nativePtr); - super.finalize(); - } - - public void setAudioBandwidth(int value) { - audioBandwidth(nativePtr, value); - } - - public MediaEncryption getMediaEncryption() { - return MediaEncryption.fromInt(getMediaEncryption(nativePtr)); - } - - public void setMediaEnctyption(MediaEncryption menc) { - setMediaEncryption(nativePtr, menc.mValue); - } - - private native boolean localConferenceMode(long nativePtr); - public boolean localConferenceMode() { - return localConferenceMode(nativePtr); - } -} diff --git a/src/org/linphone/core/LinphoneCallStatsImpl.java b/src/org/linphone/core/LinphoneCallStatsImpl.java deleted file mode 100644 index ffc19eddc..000000000 --- a/src/org/linphone/core/LinphoneCallStatsImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -LinPhoneCallStatsImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - - -class LinphoneCallStatsImpl implements LinphoneCallStats { - private int mediaType; - private float senderLossRate; - private float receiverLossRate; - private float senderInterarrivalJitter; - private float receiverInterarrivalJitter; - private float roundTripDelay; - private long latePacketsCumulativeNumber; - private float jitterBufferSize; - - private native int getMediaType(long nativeStatsPtr); - private native float getSenderLossRate(long nativeStatsPtr); - private native float getReceiverLossRate(long nativeStatsPtr); - private native float getSenderInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr); - private native float getReceiverInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr); - private native float getRoundTripDelay(long nativeStatsPtr); - private native long getLatePacketsCumulativeNumber(long nativeStatsPtr, long nativeCallPtr); - private native float getJitterBufferSize(long nativeStatsPtr); - - protected LinphoneCallStatsImpl(long nativeCallPtr, long nativeStatsPtr) { - mediaType = getMediaType(nativeStatsPtr); - senderLossRate = getSenderLossRate(nativeStatsPtr); - receiverLossRate = getReceiverLossRate(nativeStatsPtr); - senderInterarrivalJitter = getSenderInterarrivalJitter(nativeStatsPtr, nativeCallPtr); - receiverInterarrivalJitter = getReceiverInterarrivalJitter(nativeStatsPtr, nativeCallPtr); - roundTripDelay = getRoundTripDelay(nativeStatsPtr); - latePacketsCumulativeNumber = getLatePacketsCumulativeNumber(nativeStatsPtr, nativeCallPtr); - jitterBufferSize = getJitterBufferSize(nativeStatsPtr); - } - - public MediaType getMediaType() { - return MediaType.fromInt(mediaType); - } - - public float getSenderLossRate() { - return senderLossRate; - } - - public float getReceiverLossRate() { - return receiverLossRate; - } - - public float getSenderInterarrivalJitter() { - return senderInterarrivalJitter; - } - - public float getReceiverInterarrivalJitter() { - return receiverInterarrivalJitter; - } - - public float getRoundTripDelay() { - return roundTripDelay; - } - - public long getLatePacketsCumulativeNumber() { - return latePacketsCumulativeNumber; - } - - public float getJitterBufferSize() { - return jitterBufferSize; - } -} diff --git a/src/org/linphone/core/LinphoneChatRoomImpl.java b/src/org/linphone/core/LinphoneChatRoomImpl.java deleted file mode 100644 index 76874675d..000000000 --- a/src/org/linphone/core/LinphoneChatRoomImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* -LinphoneChatRoomImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - -class LinphoneChatRoomImpl implements LinphoneChatRoom { - protected final long nativePtr; - private native long getPeerAddress(long ptr); - private native void sendMessage(long ptr, String message); - - protected LinphoneChatRoomImpl(long aNativePtr) { - nativePtr = aNativePtr; - } - - public LinphoneAddress getPeerAddress() { - return new LinphoneAddressImpl(getPeerAddress(nativePtr)); - } - - public void sendMessage(String message) { - sendMessage(nativePtr,message); - } -} diff --git a/src/org/linphone/core/LinphoneCoreFactoryImpl.java b/src/org/linphone/core/LinphoneCoreFactoryImpl.java deleted file mode 100644 index 7d0be46e3..000000000 --- a/src/org/linphone/core/LinphoneCoreFactoryImpl.java +++ /dev/null @@ -1,182 +0,0 @@ -/* -LinphoneCoreFactoryImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; - -import org.linphone.mediastream.Version; - -import android.util.Log; - -public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory { - - private static boolean loadOptionalLibrary(String s) { - try { - System.loadLibrary(s); - return true; - } catch (Throwable e) { - Log.w("Unable to load optional library lib", s); - } - return false; - } - - static { - // FFMPEG (audio/video) - loadOptionalLibrary("avutil"); - loadOptionalLibrary("swscale"); - loadOptionalLibrary("avcore"); - - if (!hasNeonInCpuFeatures()) { - boolean noNeonLibrariesLoaded = loadOptionalLibrary("avcodecnoneon"); - if (!noNeonLibrariesLoaded) { - loadOptionalLibrary("avcodec"); - } - } else { - loadOptionalLibrary("avcodec"); - } - - // OPENSSL (cryptography) - // lin prefix avoids collision with libs in /system/lib - loadOptionalLibrary("lincrypto"); - loadOptionalLibrary("linssl"); - - // Secure RTP and key negotiation - loadOptionalLibrary("srtp"); - loadOptionalLibrary("zrtpcpp"); // GPLv3+ - - // Tunnel - loadOptionalLibrary("tunnelclient"); - - // g729 A implementation - loadOptionalLibrary("bcg729"); - - //Main library - if (!hasNeonInCpuFeatures()) { - try { - if (!isArmv7()) { - System.loadLibrary("linphonearmv5"); - } else { - System.loadLibrary("linphonenoneon"); - } - Log.w("linphone", "No-neon liblinphone loaded"); - } catch (UnsatisfiedLinkError ule) { - Log.w("linphone", "Failed to load no-neon liblinphone, loading neon liblinphone"); - System.loadLibrary("linphone"); - } - } else { - System.loadLibrary("linphone"); - } - - Version.dumpCapabilities(); - } - @Override - public LinphoneAuthInfo createAuthInfo(String username, String password, - String realm) { - return new LinphoneAuthInfoImpl(username,password,realm); - } - - @Override - public LinphoneAddress createLinphoneAddress(String username, - String domain, String displayName) { - return new LinphoneAddressImpl(username,domain,displayName); - } - - @Override - public LinphoneAddress createLinphoneAddress(String identity) { - return new LinphoneAddressImpl(identity); - } - - @Override - public LinphoneCore createLinphoneCore(LinphoneCoreListener listener, - String userConfig, String factoryConfig, Object userdata) - throws LinphoneCoreException { - try { - return new LinphoneCoreImpl(listener,new File(userConfig),new File(factoryConfig),userdata); - } catch (IOException e) { - throw new LinphoneCoreException("Cannot create LinphoneCore",e); - } - } - - @Override - public LinphoneCore createLinphoneCore(LinphoneCoreListener listener) throws LinphoneCoreException { - try { - return new LinphoneCoreImpl(listener); - } catch (IOException e) { - throw new LinphoneCoreException("Cannot create LinphoneCore",e); - } - } - - @Override - public LinphoneProxyConfig createProxyConfig(String identity, String proxy, - String route, boolean enableRegister) throws LinphoneCoreException { - return new LinphoneProxyConfigImpl(identity,proxy,route,enableRegister); - } - - @Override - public native void setDebugMode(boolean enable); - - @Override - public void setLogHandler(LinphoneLogHandler handler) { - //not implemented on Android - - } - - @Override - public LinphoneFriend createLinphoneFriend(String friendUri) { - return new LinphoneFriendImpl(friendUri); - } - - @Override - public LinphoneFriend createLinphoneFriend() { - return createLinphoneFriend(null); - } - - public static boolean hasNeonInCpuFeatures() - { - ProcessBuilder cmd; - boolean result = false; - - try { - String[] args = {"/system/bin/cat", "/proc/cpuinfo"}; - cmd = new ProcessBuilder(args); - - Process process = cmd.start(); - InputStream in = process.getInputStream(); - byte[] re = new byte[1024]; - while(in.read(re) != -1){ - String line = new String(re); - if (line.contains("Features")) { - result = line.contains("neon"); - break; - } - } - in.close(); - } catch(IOException ex){ - ex.printStackTrace(); - } - return result; - } - - public static boolean isArmv7() - { - return System.getProperty("os.arch").contains("armv7"); - } -} diff --git a/src/org/linphone/core/LinphoneCoreImpl.java b/src/org/linphone/core/LinphoneCoreImpl.java deleted file mode 100644 index c742ea313..000000000 --- a/src/org/linphone/core/LinphoneCoreImpl.java +++ /dev/null @@ -1,737 +0,0 @@ -/* -LinphoneCoreImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - -import java.io.File; -import java.io.IOException; - - -class LinphoneCoreImpl implements LinphoneCore { - - @SuppressWarnings("unused") - private final LinphoneCoreListener mListener; //to make sure to keep a reference on this object - private long nativePtr = 0; - private native long newLinphoneCore(LinphoneCoreListener listener,String userConfig,String factoryConfig,Object userdata); - private native void iterate(long nativePtr); - private native long getDefaultProxyConfig(long nativePtr); - - private native void setDefaultProxyConfig(long nativePtr,long proxyCfgNativePtr); - private native int addProxyConfig(LinphoneProxyConfig jprtoxyCfg,long nativePtr,long proxyCfgNativePtr); - private native void clearAuthInfos(long nativePtr); - - private native void clearProxyConfigs(long nativePtr); - private native void addAuthInfo(long nativePtr,long authInfoNativePtr); - private native Object invite(long nativePtr,String uri); - private native void terminateCall(long nativePtr, long call); - private native long getRemoteAddress(long nativePtr); - private native boolean isInCall(long nativePtr); - private native boolean isInComingInvitePending(long nativePtr); - private native void acceptCall(long nativePtr, long call); - private native long getCallLog(long nativePtr,int position); - private native int getNumberOfCallLogs(long nativePtr); - private native void delete(long nativePtr); - private native void setNetworkStateReachable(long nativePtr,boolean isReachable); - private native void setPlaybackGain(long nativeptr, float gain); - private native float getPlaybackGain(long nativeptr); - private native void muteMic(long nativePtr,boolean isMuted); - private native long interpretUrl(long nativePtr,String destination); - private native Object inviteAddress(long nativePtr,long to); - private native Object inviteAddressWithParams(long nativePtrLc,long to, long nativePtrParam); - private native void sendDtmf(long nativePtr,char dtmf); - private native void clearCallLogs(long nativePtr); - private native boolean isMicMuted(long nativePtr); - private native long findPayloadType(long nativePtr, String mime, int clockRate); - private native int enablePayloadType(long nativePtr, long payloadType, boolean enable); - private native void enableEchoCancellation(long nativePtr,boolean enable); - private native boolean isEchoCancellationEnabled(long nativePtr); - private native Object getCurrentCall(long nativePtr) ; - private native void playDtmf(long nativePtr,char dtmf,int duration); - private native void stopDtmf(long nativePtr); - private native void setVideoWindowId(long nativePtr, Object wid); - private native void setPreviewWindowId(long nativePtr, Object wid); - private native void setDeviceRotation(long nativePtr, int rotation); - private native void addFriend(long nativePtr,long friend); - private native void setPresenceInfo(long nativePtr,int minute_away, String alternative_contact,int status); - private native long createChatRoom(long nativePtr,String to); - private native void enableVideo(long nativePtr,boolean vcap_enabled,boolean display_enabled); - private native boolean isVideoEnabled(long nativePtr); - private native void setFirewallPolicy(long nativePtr, int enum_value); - private native int getFirewallPolicy(long nativePtr); - private native void setStunServer(long nativePtr, String stun_server); - private native String getStunServer(long nativePtr); - private native long createDefaultCallParams(long nativePtr); - private native int updateCall(long ptrLc, long ptrCall, long ptrParams); - private native void setUploadBandwidth(long nativePtr, int bw); - private native void setDownloadBandwidth(long nativePtr, int bw); - private native void setPreferredVideoSize(long nativePtr, int width, int heigth); - private native int[] getPreferredVideoSize(long nativePtr); - private native void setRing(long nativePtr, String path); - private native String getRing(long nativePtr); - private native void setRootCA(long nativePtr, String path); - private native long[] listVideoPayloadTypes(long nativePtr); - private native long[] getProxyConfigList(long nativePtr); - private native long[] listAudioPayloadTypes(long nativePtr); - private native void enableKeepAlive(long nativePtr,boolean enable); - private native boolean isKeepAliveEnabled(long nativePtr); - private native int startEchoCalibration(long nativePtr,Object data); - private native int getSignalingTransportPort(long nativePtr, int code); - private native void setSignalingTransportPorts(long nativePtr, int udp, int tcp, int tls); - private native void enableIpv6(long nativePtr,boolean enable); - private native void adjustSoftwareVolume(long nativePtr,int db); - private native int pauseCall(long nativePtr, long callPtr); - private native int pauseAllCalls(long nativePtr); - private native int resumeCall(long nativePtr, long callPtr); - private native void setUploadPtime(long nativePtr, int ptime); - private native void setDownloadPtime(long nativePtr, int ptime); - private native void setZrtpSecretsCache(long nativePtr, String file); - private native void enableEchoLimiter(long nativePtr2, boolean val); - private native int setVideoDevice(long nativePtr2, int id); - private native int getVideoDevice(long nativePtr2); - private native int getMediaEncryption(long nativePtr); - private native void setMediaEncryption(long nativePtr, int menc); - private native boolean isMediaEncryptionMandatory(long nativePtr); - private native void setMediaEncryptionMandatory(long nativePtr, boolean yesno); - - - LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException { - mListener=listener; - nativePtr = newLinphoneCore(listener,userConfig.getCanonicalPath(),factoryConfig.getCanonicalPath(),userdata); - } - LinphoneCoreImpl(LinphoneCoreListener listener) throws IOException { - mListener=listener; - nativePtr = newLinphoneCore(listener,null,null,null); - } - - protected void finalize() throws Throwable { - - } - - public synchronized void addAuthInfo(LinphoneAuthInfo info) { - isValid(); - addAuthInfo(nativePtr,((LinphoneAuthInfoImpl)info).nativePtr); - } - - - - public synchronized LinphoneProxyConfig getDefaultProxyConfig() { - isValid(); - long lNativePtr = getDefaultProxyConfig(nativePtr); - if (lNativePtr!=0) { - return new LinphoneProxyConfigImpl(lNativePtr); - } else { - return null; - } - } - - public synchronized LinphoneCall invite(String uri) { - isValid(); - return (LinphoneCall)invite(nativePtr,uri); - } - - public synchronized void iterate() { - isValid(); - iterate(nativePtr); - } - - public synchronized void setDefaultProxyConfig(LinphoneProxyConfig proxyCfg) { - isValid(); - setDefaultProxyConfig(nativePtr,((LinphoneProxyConfigImpl)proxyCfg).nativePtr); - } - public synchronized void addProxyConfig(LinphoneProxyConfig proxyCfg) throws LinphoneCoreException{ - isValid(); - if (addProxyConfig(proxyCfg,nativePtr,((LinphoneProxyConfigImpl)proxyCfg).nativePtr) !=0) { - throw new LinphoneCoreException("bad proxy config"); - } - } - public synchronized void clearAuthInfos() { - isValid(); - clearAuthInfos(nativePtr); - - } - public synchronized void clearProxyConfigs() { - isValid(); - clearProxyConfigs(nativePtr); - } - public synchronized void terminateCall(LinphoneCall aCall) { - isValid(); - if (aCall!=null)terminateCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr); - } - public synchronized LinphoneAddress getRemoteAddress() { - isValid(); - long ptr = getRemoteAddress(nativePtr); - if (ptr==0) { - return null; - } else { - return new LinphoneAddressImpl(ptr); - } - } - public synchronized boolean isIncall() { - isValid(); - return isInCall(nativePtr); - } - public synchronized boolean isInComingInvitePending() { - isValid(); - return isInComingInvitePending(nativePtr); - } - public synchronized void acceptCall(LinphoneCall aCall) { - isValid(); - acceptCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr); - - } - public synchronized LinphoneCallLog[] getCallLogs() { - isValid(); - LinphoneCallLog[] logs = new LinphoneCallLog[getNumberOfCallLogs(nativePtr)]; - for (int i=0;i < getNumberOfCallLogs(nativePtr);i++) { - logs[i] = new LinphoneCallLogImpl(getCallLog(nativePtr, i)); - } - return logs; - } - public synchronized void destroy() { - isValid(); - delete(nativePtr); - nativePtr = 0; - } - - private void isValid() { - if (nativePtr == 0) { - throw new RuntimeException("object already destroyed"); - } - } - public synchronized void setNetworkReachable(boolean isReachable) { - setNetworkStateReachable(nativePtr,isReachable); - } - public synchronized void setPlaybackGain(float gain) { - setPlaybackGain(nativePtr,gain); - - } - public synchronized float getPlaybackGain() { - return getPlaybackGain(nativePtr); - } - public synchronized void muteMic(boolean isMuted) { - muteMic(nativePtr,isMuted); - } - public synchronized LinphoneAddress interpretUrl(String destination) throws LinphoneCoreException { - long lAddress = interpretUrl(nativePtr,destination); - if (lAddress != 0) { - return new LinphoneAddressImpl(lAddress,true); - } else { - throw new LinphoneCoreException("Cannot interpret ["+destination+"]"); - } - } - public synchronized LinphoneCall invite(LinphoneAddress to) throws LinphoneCoreException { - LinphoneCall call = (LinphoneCall)inviteAddress(nativePtr,((LinphoneAddressImpl)to).nativePtr); - if (call!=null) { - return call; - } else { - throw new LinphoneCoreException("Unable to invite address " + to.asString()); - } - } - - public synchronized void sendDtmf(char number) { - sendDtmf(nativePtr,number); - } - public synchronized void clearCallLogs() { - clearCallLogs(nativePtr); - } - public synchronized boolean isMicMuted() { - return isMicMuted(nativePtr); - } - public synchronized PayloadType findPayloadType(String mime, int clockRate) { - isValid(); - long playLoadType = findPayloadType(nativePtr, mime, clockRate); - if (playLoadType == 0) { - return null; - } else { - return new PayloadTypeImpl(playLoadType); - } - } - public synchronized void enablePayloadType(PayloadType pt, boolean enable) - throws LinphoneCoreException { - isValid(); - if (enablePayloadType(nativePtr,((PayloadTypeImpl)pt).nativePtr,enable) != 0) { - throw new LinphoneCoreException("cannot enable payload type ["+pt+"]"); - } - - } - public synchronized void enableEchoCancellation(boolean enable) { - isValid(); - enableEchoCancellation(nativePtr, enable); - } - public synchronized boolean isEchoCancellationEnabled() { - isValid(); - return isEchoCancellationEnabled(nativePtr); - - } - - public synchronized LinphoneCall getCurrentCall() { - isValid(); - return (LinphoneCall)getCurrentCall(nativePtr); - } - - public int getPlayLevel() { - // TODO Auto-generated method stub - return 0; - } - public void setPlayLevel(int level) { - // TODO Auto-generated method stub - - } - public void enableSpeaker(boolean value) { - // TODO Auto-generated method stub - - } - public boolean isSpeakerEnabled() { - // TODO Auto-generated method stub - return false; - } - public synchronized void playDtmf(char number, int duration) { - playDtmf(nativePtr,number, duration); - - } - public synchronized void stopDtmf() { - stopDtmf(nativePtr); - } - - public synchronized void addFriend(LinphoneFriend lf) throws LinphoneCoreException { - addFriend(nativePtr,((LinphoneFriendImpl)lf).nativePtr); - - } - public synchronized void setPresenceInfo(int minute_away, String alternative_contact, - OnlineStatus status) { - setPresenceInfo(nativePtr,minute_away,alternative_contact,status.mValue); - - } - public synchronized LinphoneChatRoom createChatRoom(String to) { - return new LinphoneChatRoomImpl(createChatRoom(nativePtr,to)); - } - public synchronized void setPreviewWindow(Object w) { - setPreviewWindowId(nativePtr,w); - } - public synchronized void setVideoWindow(Object w) { - setVideoWindowId(nativePtr, w); - } - public synchronized void setDeviceRotation(int rotation) { - setDeviceRotation(nativePtr, rotation); - } - - public synchronized void enableVideo(boolean vcap_enabled, boolean display_enabled) { - enableVideo(nativePtr,vcap_enabled, display_enabled); - } - public synchronized boolean isVideoEnabled() { - return isVideoEnabled(nativePtr); - } - public synchronized FirewallPolicy getFirewallPolicy() { - return FirewallPolicy.fromInt(getFirewallPolicy(nativePtr)); - } - public synchronized String getStunServer() { - return getStunServer(nativePtr); - } - public synchronized void setFirewallPolicy(FirewallPolicy pol) { - setFirewallPolicy(nativePtr,pol.value()); - } - public synchronized void setStunServer(String stunServer) { - setStunServer(nativePtr,stunServer); - } - - public synchronized LinphoneCallParams createDefaultCallParameters() { - return new LinphoneCallParamsImpl(createDefaultCallParams(nativePtr)); - } - - public synchronized LinphoneCall inviteAddressWithParams(LinphoneAddress to, LinphoneCallParams params) throws LinphoneCoreException { - long ptrDestination = ((LinphoneAddressImpl)to).nativePtr; - long ptrParams =((LinphoneCallParamsImpl)params).nativePtr; - - LinphoneCall call = (LinphoneCall)inviteAddressWithParams(nativePtr, ptrDestination, ptrParams); - if (call!=null) { - return call; - } else { - throw new LinphoneCoreException("Unable to invite with params " + to.asString()); - } - } - - public synchronized int updateCall(LinphoneCall call, LinphoneCallParams params) { - long ptrCall = ((LinphoneCallImpl) call).nativePtr; - long ptrParams = params!=null ? ((LinphoneCallParamsImpl)params).nativePtr : 0; - - return updateCall(nativePtr, ptrCall, ptrParams); - } - public synchronized void setUploadBandwidth(int bw) { - setUploadBandwidth(nativePtr, bw); - } - - public synchronized void setDownloadBandwidth(int bw) { - setDownloadBandwidth(nativePtr, bw); - } - - public synchronized void setPreferredVideoSize(VideoSize vSize) { - setPreferredVideoSize(nativePtr, vSize.width, vSize.height); - } - - public synchronized VideoSize getPreferredVideoSize() { - int[] nativeSize = getPreferredVideoSize(nativePtr); - - VideoSize vSize = new VideoSize(); - vSize.width = nativeSize[0]; - vSize.height = nativeSize[1]; - return vSize; - } - public synchronized void setRing(String path) { - setRing(nativePtr, path); - } - public synchronized String getRing() { - return getRing(nativePtr); - } - - public synchronized void setRootCA(String path) { - setRootCA(nativePtr, path); - } - - public synchronized LinphoneProxyConfig[] getProxyConfigList() { - long[] typesPtr = getProxyConfigList(nativePtr); - if (typesPtr == null) return null; - - LinphoneProxyConfig[] proxies = new LinphoneProxyConfig[typesPtr.length]; - - for (int i=0; i < proxies.length; i++) { - proxies[i] = new LinphoneProxyConfigImpl(typesPtr[i]); - } - - return proxies; - } - - public synchronized PayloadType[] getVideoCodecs() { - long[] typesPtr = listVideoPayloadTypes(nativePtr); - if (typesPtr == null) return null; - - PayloadType[] codecs = new PayloadType[typesPtr.length]; - - for (int i=0; i < codecs.length; i++) { - codecs[i] = new PayloadTypeImpl(typesPtr[i]); - } - - return codecs; - } - public synchronized PayloadType[] getAudioCodecs() { - long[] typesPtr = listAudioPayloadTypes(nativePtr); - if (typesPtr == null) return null; - - PayloadType[] codecs = new PayloadType[typesPtr.length]; - - for (int i=0; i < codecs.length; i++) { - codecs[i] = new PayloadTypeImpl(typesPtr[i]); - } - - return codecs; - } - public synchronized boolean isNetworkReachable() { - throw new RuntimeException("Not implemented"); - } - public synchronized void enableKeepAlive(boolean enable) { - enableKeepAlive(nativePtr,enable); - - } - public synchronized boolean isKeepAliveEnabled() { - return isKeepAliveEnabled(nativePtr); - } - public synchronized void startEchoCalibration(Object data) throws LinphoneCoreException { - startEchoCalibration(nativePtr, data); - } - - public synchronized Transports getSignalingTransportPorts() { - Transports transports = new Transports(); - transports.udp = getSignalingTransportPort(nativePtr, 0); - transports.tcp = getSignalingTransportPort(nativePtr, 1); - transports.tls = getSignalingTransportPort(nativePtr, 3); - // See C struct LCSipTransports in linphonecore.h - // Code is the index in the structure - return transports; - } - public synchronized void setSignalingTransportPorts(Transports transports) { - setSignalingTransportPorts(nativePtr, transports.udp, transports.tcp, transports.tls); - } - - public synchronized void enableIpv6(boolean enable) { - enableIpv6(nativePtr,enable); - } - public synchronized void adjustSoftwareVolume(int i) { - adjustSoftwareVolume(nativePtr, i); - } - - public synchronized boolean pauseCall(LinphoneCall call) { - return 0 == pauseCall(nativePtr, ((LinphoneCallImpl) call).nativePtr); - } - public synchronized boolean resumeCall(LinphoneCall call) { - return 0 == resumeCall(nativePtr, ((LinphoneCallImpl) call).nativePtr); - } - public synchronized boolean pauseAllCalls() { - return 0 == pauseAllCalls(nativePtr); - } - public synchronized void setDownloadPtime(int ptime) { - setDownloadPtime(nativePtr,ptime); - - } - public synchronized void setUploadPtime(int ptime) { - setUploadPtime(nativePtr,ptime); - } - - public synchronized void setZrtpSecretsCache(String file) { - setZrtpSecretsCache(nativePtr,file); - } - public synchronized void enableEchoLimiter(boolean val) { - enableEchoLimiter(nativePtr,val); - } - public void setVideoDevice(int id) { - Log.i("Setting camera id :", id); - if (setVideoDevice(nativePtr, id) != 0) { - Log.e("Failed to set video device to id:", id); - } - } - public int getVideoDevice() { - return getVideoDevice(nativePtr); - } - - - private native void leaveConference(long nativePtr); - public synchronized void leaveConference() { - leaveConference(nativePtr); - } - - private native boolean enterConference(long nativePtr); - public synchronized boolean enterConference() { - return enterConference(nativePtr); - } - - private native boolean isInConference(long nativePtr); - public synchronized boolean isInConference() { - return isInConference(nativePtr); - } - - private native void terminateConference(long nativePtr); - public synchronized void terminateConference() { - terminateConference(nativePtr); - } - private native int getConferenceSize(long nativePtr); - public synchronized int getConferenceSize() { - return getConferenceSize(nativePtr); - } - private native int getCallsNb(long nativePtr); - public synchronized int getCallsNb() { - return getCallsNb(nativePtr); - } - private native void terminateAllCalls(long nativePtr); - public synchronized void terminateAllCalls() { - terminateAllCalls(nativePtr); - } - private native Object getCall(long nativePtr, int position); - public synchronized LinphoneCall[] getCalls() { - int size = getCallsNb(nativePtr); - LinphoneCall[] calls = new LinphoneCall[size]; - for (int i=0; i < size; i++) { - calls[i]=((LinphoneCall)getCall(nativePtr, i)); - } - return calls; - } - private native void addAllToConference(long nativePtr); - public synchronized void addAllToConference() { - addAllToConference(nativePtr); - - } - private native void addToConference(long nativePtr, long nativePtrLcall); - public synchronized void addToConference(LinphoneCall call) { - addToConference(nativePtr, getCallPtr(call)); - - } - private native void removeFromConference(long nativePtr, long nativeCallPtr); - public synchronized void removeFromConference(LinphoneCall call) { - removeFromConference(nativePtr,getCallPtr(call)); - } - - private long getCallPtr(LinphoneCall call) { - return ((LinphoneCallImpl)call).nativePtr; - } - - private long getCallParamsPtr(LinphoneCallParams callParams) { - return ((LinphoneCallParamsImpl)callParams).nativePtr; - } - - private native int transferCall(long nativePtr, long callPtr, String referTo); - public synchronized void transferCall(LinphoneCall call, String referTo) { - transferCall(nativePtr, getCallPtr(call), referTo); - } - - private native int transferCallToAnother(long nativePtr, long callPtr, long destPtr); - public synchronized void transferCallToAnother(LinphoneCall call, LinphoneCall dest) { - transferCallToAnother(nativePtr, getCallPtr(call), getCallPtr(dest)); - } - - private native Object findCallFromUri(long nativePtr, String uri); - @Override - public synchronized LinphoneCall findCallFromUri(String uri) { - return (LinphoneCall) findCallFromUri(nativePtr, uri); - } - - public synchronized MediaEncryption getMediaEncryption() { - return MediaEncryption.fromInt(getMediaEncryption(nativePtr)); - } - public synchronized boolean isMediaEncryptionMandatory() { - return isMediaEncryptionMandatory(nativePtr); - } - public synchronized void setMediaEncryption(MediaEncryption menc) { - setMediaEncryption(nativePtr, menc.mValue); - } - public synchronized void setMediaEncryptionMandatory(boolean yesno) { - setMediaEncryptionMandatory(nativePtr, yesno); - } - - private native int getMaxCalls(long nativePtr); - public synchronized int getMaxCalls() { - return getMaxCalls(nativePtr); - } - @Override - public boolean isMyself(String uri) { - LinphoneProxyConfig lpc = getDefaultProxyConfig(); - if (lpc == null) return false; - return uri.equals(lpc.getIdentity()); - } - - private native boolean soundResourcesLocked(long nativePtr); - public synchronized boolean soundResourcesLocked() { - return soundResourcesLocked(nativePtr); - } - - private native void setMaxCalls(long nativePtr, int max); - @Override - public synchronized void setMaxCalls(int max) { - setMaxCalls(nativePtr, max); - } - private native boolean isEchoLimiterEnabled(long nativePtr); - @Override - public synchronized boolean isEchoLimiterEnabled() { - return isEchoLimiterEnabled(nativePtr); - } - private native boolean mediaEncryptionSupported(long nativePtr, int menc); - @Override - public synchronized boolean mediaEncryptionSupported(MediaEncryption menc) { - return mediaEncryptionSupported(nativePtr,menc.mValue); - } - - private native void setPlayFile(long nativePtr, String path); - - @Override - public synchronized void setPlayFile(String path) { - setPlayFile(nativePtr, path); - } - - - private native void tunnelAddServerAndMirror(long nativePtr, String host, int port, int mirror, int ms); - @Override - public synchronized void tunnelAddServerAndMirror(String host, int port, int mirror, int ms) { - tunnelAddServerAndMirror(nativePtr, host, port, mirror, ms); - } - - private native void tunnelAutoDetect(long nativePtr); - @Override - public synchronized void tunnelAutoDetect() { - tunnelAutoDetect(nativePtr); - } - - private native void tunnelCleanServers(long nativePtr); - @Override - public synchronized void tunnelCleanServers() { - tunnelCleanServers(nativePtr); - } - - private native void tunnelEnable(long nativePtr, boolean enable); - @Override - public synchronized void tunnelEnable(boolean enable) { - tunnelEnable(nativePtr, enable); - } - - @Override - public native boolean isTunnelAvailable(); - - private native void acceptCallWithParams(long nativePtr, long aCall, - long params); - @Override - public synchronized void acceptCallWithParams(LinphoneCall aCall, - LinphoneCallParams params) throws LinphoneCoreException { - acceptCallWithParams(nativePtr, getCallPtr(aCall), getCallParamsPtr(params)); - } - - private native void acceptCallUpdate(long nativePtr, long aCall, long params); - @Override - public synchronized void acceptCallUpdate(LinphoneCall aCall, LinphoneCallParams params) - throws LinphoneCoreException { - acceptCallUpdate(nativePtr, getCallPtr(aCall), getCallParamsPtr(params)); - } - - private native void deferCallUpdate(long nativePtr, long aCall); - @Override - public synchronized void deferCallUpdate(LinphoneCall aCall) - throws LinphoneCoreException { - deferCallUpdate(nativePtr, getCallPtr(aCall)); - } - - private native void setVideoPolicy(long nativePtr, boolean autoInitiate, boolean autoAccept); - public synchronized void setVideoPolicy(boolean autoInitiate, boolean autoAccept) { - setVideoPolicy(nativePtr, autoInitiate, autoAccept); - } - private native void setUserAgent(long nativePtr, String name, String version); - @Override - public void setUserAgent(String name, String version) { - setUserAgent(nativePtr,name,version); - } - - private native void setCpuCountNative(int count); - public void setCpuCount(int count) - { - setCpuCountNative(count); - } - private native void tunnelSetHttpProxyNative(long nativePtr, String proxy_host, int port, String username, String password); - @Override - public void tunnelSetHttpProxy(String proxy_host, int port, - String username, String password) { - tunnelSetHttpProxyNative(nativePtr,proxy_host, port, username, password); - } - - private native void removeCallLog(long nativePtr, LinphoneCallLog log); - public void removeCallLog(LinphoneCallLog log) { - removeCallLog(nativePtr, log); - } - - private native int getMissedCallsCount(long nativePtr); - public int getMissedCallsCount() { - return getMissedCallsCount(nativePtr); - } - - private native void resetMissedCallsCount(long nativePtr); - public void resetMissedCallsCount() { - resetMissedCallsCount(nativePtr); - } - - private native void refreshRegisters(long nativePtr); - public void refreshRegisters() { - refreshRegisters(nativePtr); - } - @Override - public String getVersion() { - // TODO Auto-generated method stub - return null; - } -} diff --git a/src/org/linphone/core/LinphoneFriendImpl.java b/src/org/linphone/core/LinphoneFriendImpl.java deleted file mode 100644 index bae44679f..000000000 --- a/src/org/linphone/core/LinphoneFriendImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/* -LinphoneFriendImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - -class LinphoneFriendImpl implements LinphoneFriend { - protected final long nativePtr; - private native long newLinphoneFriend(String friendUri); - private native void setAddress(long nativePtr,long friend); - private native long getAddress(long nativePtr); - private native void setIncSubscribePolicy(long nativePtr,int enumValue); - private native int getIncSubscribePolicy(long nativePtr); - private native void enableSubscribes(long nativePtr,boolean value); - private native boolean isSubscribesEnabled(long nativePtr); - private native int getStatus(long nativePtr); - private native void edit(long nativePtr); - private native void done(long nativePtr); - - private native void delete(long ptr); - boolean ownPtr = false; - protected LinphoneFriendImpl() { - nativePtr = newLinphoneFriend(null); - } - protected LinphoneFriendImpl(String friendUri) { - nativePtr = newLinphoneFriend(friendUri); - } - protected LinphoneFriendImpl(long aNativePtr) { - nativePtr = aNativePtr; - ownPtr=false; - } - protected void finalize() throws Throwable { - if (ownPtr) delete(nativePtr); - } - public void setAddress(LinphoneAddress anAddress) { - this.setAddress(nativePtr, ((LinphoneAddressImpl)anAddress).nativePtr); - - } - public LinphoneAddress getAddress() { - return new LinphoneAddressImpl(getAddress(nativePtr)); - } - public void setIncSubscribePolicy(SubscribePolicy policy) { - setIncSubscribePolicy(nativePtr,policy.mValue); - - } - public SubscribePolicy getIncSubscribePolicy() { - return SubscribePolicy.fromInt(getIncSubscribePolicy(nativePtr)) ; - } - public void enableSubscribes(boolean enable) { - enableSubscribes(nativePtr, enable); - } - public boolean isSubscribesEnabled() { - return isSubscribesEnabled(nativePtr); - } - - public OnlineStatus getStatus() { - return OnlineStatus.fromInt(getStatus(nativePtr)); - } - public void edit() { - edit(nativePtr); - } - public void done() { - done(nativePtr); - } - -} diff --git a/src/org/linphone/core/LinphoneProxyConfigImpl.java b/src/org/linphone/core/LinphoneProxyConfigImpl.java deleted file mode 100644 index cf5b3a304..000000000 --- a/src/org/linphone/core/LinphoneProxyConfigImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -/* -LinphoneProxyConfigImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - -import org.linphone.core.LinphoneCore.RegistrationState; - - - - - -class LinphoneProxyConfigImpl implements LinphoneProxyConfig { - - protected final long nativePtr; - - private native int getState(long nativePtr); - private native void setExpires(long nativePtr, int delay); - - boolean ownPtr = false; - protected LinphoneProxyConfigImpl(String identity,String proxy,String route, boolean enableRegister) throws LinphoneCoreException { - nativePtr = newLinphoneProxyConfig(); - setIdentity(identity); - setProxy(proxy); - enableRegister(enableRegister); - ownPtr=true; - } - protected LinphoneProxyConfigImpl(long aNativePtr) { - nativePtr = aNativePtr; - ownPtr=false; - } - protected void finalize() throws Throwable { - //Log.e(LinphoneService.TAG,"fixme, should release underlying proxy config"); - if (ownPtr) delete(nativePtr); - } - private native long newLinphoneProxyConfig(); - private native void delete(long ptr); - - private native void edit(long ptr); - private native void done(long ptr); - - private native void setIdentity(long ptr,String identity); - private native String getIdentity(long ptr); - private native int setProxy(long ptr,String proxy); - private native String getProxy(long ptr); - - - private native void enableRegister(long ptr,boolean value); - private native boolean isRegisterEnabled(long ptr); - - private native boolean isRegistered(long ptr); - private native void setDialPrefix(long ptr, String prefix); - - private native String normalizePhoneNumber(long ptr,String number); - - private native String getDomain(long ptr); - - private native void setDialEscapePlus(long ptr, boolean value); - - private native String getRoute(long ptr); - private native int setRoute(long ptr,String uri); - private native void enablePublish(long ptr,boolean enable); - private native boolean publishEnabled(long ptr); - - - public void enableRegister(boolean value) { - enableRegister(nativePtr,value); - } - - public void done() { - done(nativePtr); - } - - public void edit() { - edit(nativePtr); - } - - public void setIdentity(String identity) throws LinphoneCoreException { - setIdentity(nativePtr,identity); - } - - public void setProxy(String proxyUri) throws LinphoneCoreException { - if (setProxy(nativePtr,proxyUri)!=0) { - throw new LinphoneCoreException("Bad proxy address ["+proxyUri+"]"); - } - } - public String normalizePhoneNumber(String number) { - return normalizePhoneNumber(nativePtr,number); - } - public void setDialPrefix(String prefix) { - setDialPrefix(nativePtr, prefix); - } - public String getDomain() { - return getDomain(nativePtr); - } - public void setDialEscapePlus(boolean value) { - setDialEscapePlus(nativePtr,value); - } - public String getIdentity() { - return getIdentity(nativePtr); - } - public String getProxy() { - return getProxy(nativePtr); - } - public boolean isRegistered() { - return isRegistered(nativePtr); - } - public boolean registerEnabled() { - return isRegisterEnabled(nativePtr); - } - public String getRoute() { - return getRoute(nativePtr); - } - public void setRoute(String routeUri) throws LinphoneCoreException { - if (setRoute(nativePtr, routeUri) != 0) { - throw new LinphoneCoreException("cannot set route ["+routeUri+"]"); - } - } - public void enablePublish(boolean enable) { - enablePublish(nativePtr,enable); - } - public RegistrationState getState() { - return RegistrationState.fromInt(getState(nativePtr)); - } - - public void setExpires(int delay) { - setExpires(nativePtr, delay); - } - public boolean publishEnabled() { - return publishEnabled(nativePtr); - } -} diff --git a/src/org/linphone/core/Log.java b/src/org/linphone/core/Log.java deleted file mode 100644 index b70b65931..000000000 --- a/src/org/linphone/core/Log.java +++ /dev/null @@ -1,112 +0,0 @@ -/* -Log.java -Copyright (C) 2011 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core; - -import static android.util.Log.DEBUG; -import static android.util.Log.ERROR; -import static android.util.Log.INFO; -import static android.util.Log.WARN; - -/** - * Convenient wrapper for Android logs. - * - * @author Guillaume Beraudo - */ -public final class Log { - - public static final String TAG = "Linphone"; - private static final boolean useIsLoggable = false; - - @SuppressWarnings(value="all") - private static boolean isLoggable(int level) { - return !useIsLoggable || android.util.Log.isLoggable(TAG, level); - } - - public static void i(Object...objects) { - if (isLoggable(INFO)) { - android.util.Log.i(TAG, toString(objects)); - } - } - public static void i(Throwable t, Object...objects) { - if (isLoggable(INFO)) { - android.util.Log.i(TAG, toString(objects), t); - } - } - - - public static void d(Object...objects) { - if (isLoggable(DEBUG)) { - android.util.Log.d(TAG, toString(objects)); - } - } - public static void d(Throwable t, Object...objects) { - if (isLoggable(DEBUG)) { - android.util.Log.d(TAG, toString(objects), t); - } - } - - public static void w(Object...objects) { - if (isLoggable(WARN)) { - android.util.Log.w(TAG, toString(objects)); - } - } - public static void w(Throwable t, Object...objects) { - if (isLoggable(WARN)) { - android.util.Log.w(TAG, toString(objects), t); - } - } - - public static void e(Object...objects) { - if (isLoggable(ERROR)) { - android.util.Log.e(TAG, toString(objects)); - } - } - public static void e(Throwable t, Object...objects) { - if (isLoggable(ERROR)) { - android.util.Log.e(TAG, toString(objects), t); - } - } - - /** - * @throws RuntimeException always throw after logging the error message. - */ - public static void f(Object...objects) { - if (isLoggable(ERROR)) { - android.util.Log.e(TAG, toString(objects)); - throw new RuntimeException("Fatal error : " + toString(objects)); - } - } - /** - * @throws RuntimeException always throw after logging the error message. - */ - public static void f(Throwable t, Object...objects) { - if (isLoggable(ERROR)) { - android.util.Log.e(TAG, toString(objects), t); - throw new RuntimeException("Fatal error : " + toString(objects), t); - } - } - - private static String toString(Object...objects) { - StringBuilder sb = new StringBuilder(); - for (Object o : objects) { - sb.append(o); - } - return sb.toString(); - } -} diff --git a/src/org/linphone/core/PayloadTypeImpl.java b/src/org/linphone/core/PayloadTypeImpl.java deleted file mode 100644 index 864b094ff..000000000 --- a/src/org/linphone/core/PayloadTypeImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -PayloadTypeImpl.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -package org.linphone.core; - -class PayloadTypeImpl implements PayloadType { - - protected final long nativePtr; - - private native String toString(long ptr); - private native String getMime(long ptr); - private native int getRate(long ptr); - - protected PayloadTypeImpl(long aNativePtr) { - nativePtr = aNativePtr; - } - - public int getRate() { - return getRate(nativePtr); - } - - public String getMime() { - return getMime(nativePtr); - } - - public String toString() { - return toString(nativePtr); - } -} diff --git a/src/org/linphone/core/tutorials/AndroidTutorialNotifier.java b/src/org/linphone/core/tutorials/AndroidTutorialNotifier.java deleted file mode 100644 index 7721f7dc1..000000000 --- a/src/org/linphone/core/tutorials/AndroidTutorialNotifier.java +++ /dev/null @@ -1,50 +0,0 @@ -/* -AndroidTutorialNotifier.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core.tutorials; - -import android.os.Handler; -import android.widget.TextView; - -/** - * Write notifications to a TextView widget. - * This is an helper class, not a test activity. - * - * @author Guillaume Beraudo - * - */ -class AndroidTutorialNotifier extends TutorialNotifier { - - private Handler mHandler; - private TextView outputTextView; - - public AndroidTutorialNotifier(Handler mHandler, final TextView outputTextView) { - this.mHandler = mHandler; - this.outputTextView = outputTextView; - } - - - @Override - public void notify(final String s) { - mHandler.post(new Runnable() { - public void run() { - outputTextView.setText(s + "\n" + outputTextView.getText()); - } - }); - } -} diff --git a/src/org/linphone/core/tutorials/TutorialBuddyStatusActivity.java b/src/org/linphone/core/tutorials/TutorialBuddyStatusActivity.java deleted file mode 100644 index 1bf4f981f..000000000 --- a/src/org/linphone/core/tutorials/TutorialBuddyStatusActivity.java +++ /dev/null @@ -1,109 +0,0 @@ -/* -TutorialBuddyStatusActivity.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core.tutorials; - -import org.linphone.R; -import org.linphone.core.LinphoneCoreException; - -import android.app.Activity; -import android.os.Bundle; -import android.os.Handler; -import android.view.View; -import android.widget.Button; -import android.widget.TextView; - -/** - * Activity for displaying and starting the BuddyStatus example on Android phone. - * - * @author Guillaume Beraudo - * - */ -public class TutorialBuddyStatusActivity extends Activity { - - private static final String defaultSipAddress = "sip:"; - private TextView sipAddressWidget; - private TextView mySipAddressWidget; - private TextView mySipPasswordWidget; - - private TutorialBuddyStatus tutorial; - private Handler mHandler = new Handler() ; - private Button buttonCall; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.hello_world); - sipAddressWidget = (TextView) findViewById(R.id.AddressId); - sipAddressWidget.setText(defaultSipAddress); - - mySipAddressWidget = (TextView) findViewById(R.id.MyAddressId); - mySipAddressWidget.setVisibility(View.VISIBLE); - mySipPasswordWidget = (TextView) findViewById(R.id.Password); - mySipPasswordWidget.setVisibility(TextView.VISIBLE); - - - // Output text to the outputText widget - final TextView outputText = (TextView) findViewById(R.id.OutputText); - final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText); - - - // Create BuddyStatus object - tutorial = new TutorialBuddyStatus(notifier); - - - - // Assign call action to call button - buttonCall = (Button) findViewById(R.id.CallButton); - buttonCall.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - TutorialLaunchingThread thread = new TutorialLaunchingThread(); - buttonCall.setEnabled(false); - thread.start(); - } - }); - - // Assign stop action to stop button - Button buttonStop = (Button) findViewById(R.id.ButtonStop); - buttonStop.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - tutorial.stopMainLoop(); - } - }); - } - - - private class TutorialLaunchingThread extends Thread { - @Override - public void run() { - super.run(); - try { - String myIdentity = mySipAddressWidget.getText().length()>0?mySipAddressWidget.getText().toString():null; - String myPassword = mySipPasswordWidget.getText().length()>0?mySipPasswordWidget.getText().toString():null; - tutorial.launchTutorial(sipAddressWidget.getText().toString(), myIdentity, myPassword); - mHandler.post(new Runnable() { - public void run() { - buttonCall.setEnabled(true); - } - }); - } catch (LinphoneCoreException e) { - e.printStackTrace(); - } - } - } -} diff --git a/src/org/linphone/core/tutorials/TutorialChatRoomActivity.java b/src/org/linphone/core/tutorials/TutorialChatRoomActivity.java deleted file mode 100644 index f7dab4ce7..000000000 --- a/src/org/linphone/core/tutorials/TutorialChatRoomActivity.java +++ /dev/null @@ -1,98 +0,0 @@ -/* -TutorialChatRoomActivity.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core.tutorials; - -import org.linphone.R; -import org.linphone.core.LinphoneCoreException; - -import android.app.Activity; -import android.os.Bundle; -import android.os.Handler; -import android.view.View; -import android.widget.Button; -import android.widget.TextView; - -/** - * Activity for displaying and starting the chatroom example on Android phone. - * - * @author Guillaume Beraudo - * - */ -public class TutorialChatRoomActivity extends Activity { - - private static final String defaultSipAddress = "sip:"; - private TextView sipAddressWidget; - private TutorialChatRoom tutorial; - private Handler mHandler = new Handler() ; - private Button buttonCall; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.hello_world); - sipAddressWidget = (TextView) findViewById(R.id.AddressId); - sipAddressWidget.setText(defaultSipAddress); - - // Output text to the outputText widget - final TextView outputText = (TextView) findViewById(R.id.OutputText); - final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText); - - - // Create HelloWorld object - tutorial = new TutorialChatRoom(notifier); - - - - // Assign call action to call button - buttonCall = (Button) findViewById(R.id.CallButton); - buttonCall.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - TutorialLaunchingThread thread = new TutorialLaunchingThread(); - buttonCall.setEnabled(false); - thread.start(); - } - }); - - // Assign stop action to stop button - Button buttonStop = (Button) findViewById(R.id.ButtonStop); - buttonStop.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - tutorial.stopMainLoop(); - } - }); - } - - - private class TutorialLaunchingThread extends Thread { - @Override - public void run() { - super.run(); - try { - tutorial.launchTutorial(sipAddressWidget.getText().toString()); - mHandler.post(new Runnable() { - public void run() { - buttonCall.setEnabled(true); - } - }); - } catch (LinphoneCoreException e) { - e.printStackTrace(); - } - } - } -} diff --git a/src/org/linphone/core/tutorials/TutorialHelloWorldActivity.java b/src/org/linphone/core/tutorials/TutorialHelloWorldActivity.java deleted file mode 100644 index 60bd872c7..000000000 --- a/src/org/linphone/core/tutorials/TutorialHelloWorldActivity.java +++ /dev/null @@ -1,98 +0,0 @@ -/* -TutorialHelloWorldActivity.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core.tutorials; - -import org.linphone.R; -import org.linphone.core.LinphoneCoreException; - -import android.app.Activity; -import android.os.Bundle; -import android.os.Handler; -import android.view.View; -import android.widget.Button; -import android.widget.TextView; - -/** - * Activity for displaying and starting the HelloWorld example on Android phone. - * - * @author Guillaume Beraudo - * - */ -public class TutorialHelloWorldActivity extends Activity { - - private static final String defaultSipAddress = "sip:"; - private TextView sipAddressWidget; - private TutorialHelloWorld tutorial; - private Handler mHandler = new Handler() ; - private Button buttonCall; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.hello_world); - sipAddressWidget = (TextView) findViewById(R.id.AddressId); - sipAddressWidget.setText(defaultSipAddress); - - // Output text to the outputText widget - final TextView outputText = (TextView) findViewById(R.id.OutputText); - final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText); - - - // Create HelloWorld object - tutorial = new TutorialHelloWorld(notifier); - - - - // Assign call action to call button - buttonCall = (Button) findViewById(R.id.CallButton); - buttonCall.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - TutorialLaunchingThread thread = new TutorialLaunchingThread(); - buttonCall.setEnabled(false); - thread.start(); - } - }); - - // Assign stop action to stop button - Button buttonStop = (Button) findViewById(R.id.ButtonStop); - buttonStop.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - tutorial.stopMainLoop(); - } - }); - } - - - private class TutorialLaunchingThread extends Thread { - @Override - public void run() { - super.run(); - try { - tutorial.launchTutorial(sipAddressWidget.getText().toString()); - mHandler.post(new Runnable() { - public void run() { - buttonCall.setEnabled(true); - } - }); - } catch (LinphoneCoreException e) { - e.printStackTrace(); - } - } - } -} diff --git a/src/org/linphone/core/tutorials/TutorialRegistrationActivity.java b/src/org/linphone/core/tutorials/TutorialRegistrationActivity.java deleted file mode 100644 index 94670480c..000000000 --- a/src/org/linphone/core/tutorials/TutorialRegistrationActivity.java +++ /dev/null @@ -1,103 +0,0 @@ -/* -TutorialRegistrationActivity.java -Copyright (C) 2010 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core.tutorials; - -import org.linphone.R; -import org.linphone.core.LinphoneCoreException; - -import android.os.Bundle; -import android.os.Handler; -import android.view.View; -import android.widget.Button; -import android.widget.TextView; - -/** - * Activity for displaying and starting the registration example on Android phone. - * - * @author Guillaume Beraudo - * - */ -public class TutorialRegistrationActivity extends TutorialHelloWorldActivity { - - private static final String defaultSipAddress = "sip:"; - private static final String defaultSipPassword = ""; - private TextView sipAddressWidget; - private TextView sipPasswordWidget; - private TutorialRegistration tutorial; - private Button buttonCall; - private Handler mHandler = new Handler(); - private TextView outputText; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.hello_world); - sipAddressWidget = (TextView) findViewById(R.id.AddressId); - sipAddressWidget.setText(defaultSipAddress); - sipPasswordWidget = (TextView) findViewById(R.id.Password); - sipPasswordWidget.setVisibility(TextView.VISIBLE); - sipPasswordWidget.setText(defaultSipPassword); - - // Output text to the outputText widget - outputText = (TextView) findViewById(R.id.OutputText); - final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText); - - - // Create Tutorial object - tutorial = new TutorialRegistration(notifier); - - - - // Assign call action to call button - buttonCall = (Button) findViewById(R.id.CallButton); - buttonCall.setText("Register"); - buttonCall.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - TutorialLaunchingThread thread = new TutorialLaunchingThread(); - buttonCall.setEnabled(false); - thread.start(); - } - }); - - - Button buttonStop = (Button) findViewById(R.id.ButtonStop); - buttonStop.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - tutorial.stopMainLoop(); - } - }); - } - - - private class TutorialLaunchingThread extends Thread { - @Override - public void run() { - super.run(); - try { - tutorial.launchTutorial( - sipAddressWidget.getText().toString(), - sipPasswordWidget.getText().toString()); - } catch (LinphoneCoreException e) { - e.printStackTrace(); - outputText.setText(e.getMessage() +"\n"+outputText.getText()); - } - } - } -} diff --git a/src/org/linphone/core/video/VideoUtil.java b/src/org/linphone/core/video/VideoUtil.java deleted file mode 100644 index 065557b77..000000000 --- a/src/org/linphone/core/video/VideoUtil.java +++ /dev/null @@ -1,42 +0,0 @@ -/* -VideoUtil.java -Copyright (C) 2011 Belledonne Communications, Grenoble, France - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -package org.linphone.core.video; - -import java.util.ArrayList; -import java.util.List; - -import org.linphone.core.VideoSize; - -import android.hardware.Camera.Size; - -/** - * @author Guillaume Beraudo - */ -final class VideoUtil { - - private VideoUtil() {} - - public static List createList(List supportedVideoSizes) { - List converted = new ArrayList(supportedVideoSizes.size()); - for (Size s : supportedVideoSizes) { - converted.add(new VideoSize(s.width, s.height)); - } - return converted; - } -} diff --git a/submodules/externals/exosip b/submodules/externals/exosip index 05978321c..73097acf6 160000 --- a/submodules/externals/exosip +++ b/submodules/externals/exosip @@ -1 +1 @@ -Subproject commit 05978321cfc73a91a12c2a818a45a308f3f55a47 +Subproject commit 73097acf6afaef4827e6fe39214e77e53a1fbfd4 diff --git a/submodules/externals/openssl b/submodules/externals/openssl index 2bc1545f3..edb0ac692 160000 --- a/submodules/externals/openssl +++ b/submodules/externals/openssl @@ -1 +1 @@ -Subproject commit 2bc1545f31cba925b8e3011d9fd9f4680144d83b +Subproject commit edb0ac69254fb7c44846182bbd2aa9bc97117f60 diff --git a/submodules/linphone b/submodules/linphone index 18c23b44e..c6eaf5a2f 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 18c23b44ea6875bbed2779e5392defc3f8ce0dfb +Subproject commit c6eaf5a2fe4f643fd416a77c529df8c288d12ff4 From ce4ec82a7d82ecd2971566f68c2ec20c792ec2eb Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 17 Oct 2012 09:52:36 +0200 Subject: [PATCH 09/60] Use echo canceller. --- res/raw/linphonerc | 6 +-- res/values/non_localizable_strings.xml | 1 - res/values/strings.xml | 5 +- res/xml/preferences.xml | 5 +- src/org/linphone/LinphoneActivity.java | 36 ++++++++----- src/org/linphone/LinphoneManager.java | 2 - .../linphone/LinphonePreferencesActivity.java | 51 ++++--------------- 7 files changed, 38 insertions(+), 68 deletions(-) diff --git a/res/raw/linphonerc b/res/raw/linphonerc index 0df56c600..5f3bbe5f0 100644 --- a/res/raw/linphonerc +++ b/res/raw/linphonerc @@ -29,9 +29,9 @@ video_jitt_comp=60 nortp_timeout=30 [sound] -playback_dev_id=ANDROID SND: Android Sound card -ringer_dev_id=ANDROID SND: Android Sound card -capture_dev_id=ANDROID SND: Android Sound card +playback_dev_id= +ringer_dev_id= +capture_dev_id= remote_ring=/data/data/org.linphone/files/ringback.wav local_ring=/data/data/org.linphone/files/oldphone_mono.wav ec_tail_len=120 diff --git a/res/values/non_localizable_strings.xml b/res/values/non_localizable_strings.xml index 7b7a4dc64..c4354ccda 100644 --- a/res/values/non_localizable_strings.xml +++ b/res/values/non_localizable_strings.xml @@ -33,7 +33,6 @@ pref_transport_use_standard_ports_key pref_echo_canceller_calibration_key - pref_echo_limiter_key pref_prefix_key pref_proxy_key pref_domain_key diff --git a/res/values/strings.xml b/res/values/strings.xml index 3ee1e4190..9c35134d9 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -120,7 +120,6 @@ Delete this account Use as default Echo canceller calibration - Echo limiter Use front camera Video Preferences @@ -211,11 +210,11 @@ Cannot invite destination address [%s] started -Removes the echo heard by other end (not recommended) -Removes the echo heard by other end (brute force method) +Removes the echo heard by other end Stun server Calibrating... Calibrated [%s ms] +No echo failed Enter your username and password to connect to the service. Username diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 3e7a9948e..e00f6bfef 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -56,13 +56,10 @@ - - - diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 755b9b0a9..db62aa321 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -21,14 +21,18 @@ package org.linphone; import static android.content.Intent.ACTION_MAIN; +import org.linphone.LinphoneManager.EcCalibrationListener; import org.linphone.LinphoneSimpleListener.LinphoneOnCallStateChangedListener; import org.linphone.compatibility.Compatibility; import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCore; +import org.linphone.core.LinphoneCore.EcCalibratorStatus; import org.linphone.core.LinphoneCore.RegistrationState; +import org.linphone.core.LinphoneCoreException; import org.linphone.core.Log; import org.linphone.mediastream.Version; +import org.linphone.mediastream.video.capture.hwconf.Hacks; import android.app.AlertDialog; import android.app.TabActivity; @@ -148,19 +152,25 @@ public class LinphoneActivity extends TabActivity implements ContactPicked switch (requestCode) { case FIRST_LOGIN_ACTIVITY: if (resultCode == RESULT_OK) { -// Toast.makeText(this, getString(R.string.ec_calibration_launch_message), Toast.LENGTH_LONG).show(); -// try { -// LinphoneManager.getInstance().startEcCalibration(new EcCalibrationListener() { -// public void onEcCalibrationStatus(EcCalibratorStatus status, int delayMs) { -// PreferenceManager.getDefaultSharedPreferences(LinphoneActivity.this) -// .edit().putBoolean( -// getString(R.string.pref_echo_canceller_calibration_key), -// status == EcCalibratorStatus.Done).commit(); -// } -// }); -// } catch (LinphoneCoreException e) { -// Log.e(e, "Unable to calibrate EC"); -// } + if (!Hacks.hasBuiltInEchoCanceller()) { + Toast.makeText(this, getString(R.string.ec_calibration_launch_message), Toast.LENGTH_LONG).show(); + try { + LinphoneManager.getInstance().startEcCalibration(new EcCalibrationListener() { + public void onEcCalibrationStatus(EcCalibratorStatus status, int delayMs) { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(LinphoneActivity.this); + SharedPreferences.Editor editor = prefs.edit(); + if (status == EcCalibratorStatus.DoneNoEcho) { + editor.putBoolean(getString(R.string.pref_echo_cancellation_key), false); + } else if ((status == EcCalibratorStatus.Done) || (status == EcCalibratorStatus.Failed)) { + editor.putBoolean(getString(R.string.pref_echo_cancellation_key), true); + } + editor.commit(); + } + }); + } catch (LinphoneCoreException e) { + Log.e(e, "Unable to calibrate EC"); + } + } fillTabHost(); } else { finish(); diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 51fc3bd1b..7cf1643b3 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -605,9 +605,7 @@ public final class LinphoneManager implements LinphoneCoreListener { } boolean useEC = getPrefBoolean(R.string.pref_echo_cancellation_key, false); - boolean useEL = getPrefBoolean(R.string.pref_echo_limiter_key, false); mLc.enableEchoCancellation(useEC); - mLc.enableEchoLimiter(useEL); } catch (LinphoneCoreException e) { throw new LinphoneConfigException(getString(R.string.wrong_settings),e); } diff --git a/src/org/linphone/LinphonePreferencesActivity.java b/src/org/linphone/LinphonePreferencesActivity.java index f15b19ded..b633cfcfe 100644 --- a/src/org/linphone/LinphonePreferencesActivity.java +++ b/src/org/linphone/LinphonePreferencesActivity.java @@ -26,7 +26,6 @@ import static org.linphone.R.string.pref_codec_ilbc_key; import static org.linphone.R.string.pref_codec_speex16_key; import static org.linphone.R.string.pref_echo_cancellation_key; import static org.linphone.R.string.pref_echo_canceller_calibration_key; -import static org.linphone.R.string.pref_echo_limiter_key; import static org.linphone.R.string.pref_media_encryption_key; import static org.linphone.R.string.pref_video_enable_key; @@ -76,8 +75,7 @@ import de.timroes.axmlrpc.XMLRPCServerException; public class LinphonePreferencesActivity extends PreferenceActivity implements EcCalibrationListener { private Handler mHandler = new Handler(); - private CheckBoxPreference ecCalibratePref; - private CheckBoxPreference elPref; + private Preference ecCalibratePref; private CheckBoxPreference ecPref; private ListPreference mencPref; private int nbAccounts = 1; @@ -597,7 +595,7 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E addTransportChecboxesListener(); - ecCalibratePref = (CheckBoxPreference) findPreference(pref_echo_canceller_calibration_key); + ecCalibratePref = findPreference(pref_echo_canceller_calibration_key); ecCalibratePref.setOnPreferenceClickListener(new OnPreferenceClickListener() { public boolean onPreferenceClick(Preference preference) { startEcCalibration(); @@ -605,7 +603,6 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E } }); ecPref = (CheckBoxPreference) findPreference(pref_echo_cancellation_key); - elPref = (CheckBoxPreference) findPreference(pref_echo_limiter_key); mencPref = (ListPreference) findPreference(pref_media_encryption_key); boolean fastCpu = Version.isArmv7(); @@ -614,7 +611,6 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E findPreference(pref_codec_speex16_key).setEnabled(true); //findPreference(pref_codec_speex32_key)).setEnabled(enableIlbc); } - findPreference(pref_echo_limiter_key).setEnabled(true); initializeMediaEncryptionPreferences(); @@ -637,9 +633,8 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E doOnFirstLaunch(); } if (Hacks.hasBuiltInEchoCanceller()) { - uncheckDisableAndHideCheckbox(R.string.pref_echo_limiter_key); uncheckDisableAndHideCheckbox(R.string.pref_echo_cancellation_key); - uncheckDisableAndHideCheckbox(R.string.pref_echo_canceller_calibration_key); + findPreference(R.string.pref_echo_canceller_calibration_key).setLayoutResource(R.layout.hidden); } @@ -651,10 +646,6 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E findPreference(R.string.pref_video_codec_h264_key).setDefaultValue(false); } - addEchoPrefsListener(); - - if (Hacks.needSoftvolume()) checkAndDisableCheckbox(R.string.pref_audio_soft_volume_key); - if (!LinphoneManager.getLc().isTunnelAvailable()){ hidePreferenceCategory(R.string.pref_tunnel_key); } @@ -677,7 +668,6 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E } private void doOnFirstLaunch() { - manageCheckbox(R.string.pref_echo_limiter_key, !Hacks.hasBuiltInEchoCanceller(), true, false); prefs().edit().putBoolean(LinphoneActivity.PREF_FIRST_LAUNCH, false).commit(); } @@ -711,29 +701,6 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E } } - private void addEchoPrefsListener(){ - OnPreferenceChangeListener ec_listener=new OnPreferenceChangeListener(){ - public boolean onPreferenceChange(Preference arg0, Object newValue) { - Boolean val=(Boolean)newValue; - if (val){ - elPref.setChecked(!val); - } - return true; - } - }; - OnPreferenceChangeListener el_listener=new OnPreferenceChangeListener(){ - public boolean onPreferenceChange(Preference arg0, Object newValue) { - Boolean val=(Boolean)newValue; - if (val){ - ecPref.setChecked(!val); - } - return true; - } - }; - ecPref.setOnPreferenceChangeListener(ec_listener); - elPref.setOnPreferenceChangeListener(el_listener); - } - private void addTransportChecboxesListener() { final List checkboxes = Arrays.asList( @@ -801,15 +768,15 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E mHandler.post(new Runnable() { public void run() { - if (status == EcCalibratorStatus.Done) { + if (status == EcCalibratorStatus.DoneNoEcho) { + ecCalibratePref.setSummary(R.string.no_echo); + ecPref.setChecked(false); + } else if (status == EcCalibratorStatus.Done) { ecCalibratePref.setSummary(String.format(getString(R.string.ec_calibrated), delayMs)); - ecCalibratePref.setChecked(true); - + ecPref.setChecked(true); } else if (status == EcCalibratorStatus.Failed) { ecCalibratePref.setSummary(R.string.failed); - ecCalibratePref.setChecked(false); - elPref.setChecked(true); - ecPref.setChecked(false); + ecPref.setChecked(true); } } }); From 2b0ff0b31f8ea3ad1b9b3841148cf64790acb628 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 17 Oct 2012 15:19:36 +0200 Subject: [PATCH 10/60] update exosip --- submodules/externals/exosip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/externals/exosip b/submodules/externals/exosip index 73097acf6..a5af92c73 160000 --- a/submodules/externals/exosip +++ b/submodules/externals/exosip @@ -1 +1 @@ -Subproject commit 73097acf6afaef4827e6fe39214e77e53a1fbfd4 +Subproject commit a5af92c7346eb3b450dd69015bd769543a1b3e11 From bc93f065286485bcac6884e112920a6b30f2c7a5 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 19 Oct 2012 16:45:10 +0200 Subject: [PATCH 11/60] Fix compilation using Ant --- build.xml | 10 +++++++++- default.properties | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml index db69a1e7c..7a656c56d 100644 --- a/build.xml +++ b/build.xml @@ -637,11 +637,15 @@ + + + + ---------- Handling RenderScript files... + + + + + From 0c6723c721409d8917efe6d6009f11099678c6e0 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 6 Nov 2012 11:28:56 +0100 Subject: [PATCH 19/60] Fix G729 codec detection --- .../linphone/LinphonePreferencesActivity.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/org/linphone/LinphonePreferencesActivity.java b/src/org/linphone/LinphonePreferencesActivity.java index b633cfcfe..077f92407 100644 --- a/src/org/linphone/LinphonePreferencesActivity.java +++ b/src/org/linphone/LinphonePreferencesActivity.java @@ -106,8 +106,8 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E return (CheckBoxPreference) findPreference(getString(key)); } - private void detectAudioCodec(int id, String mime, int rate, boolean hide) { - boolean enable = LinphoneService.isReady() && LinphoneManager.getLc().findPayloadType(mime, rate)!=null; + private void detectAudioCodec(int id, String mime, int rate, int channels, boolean hide) { + boolean enable = LinphoneService.isReady() && LinphoneManager.getLc().findPayloadType(mime, rate, channels)!=null; Preference cb = findPreference(id); cb.setEnabled(enable); if (hide && !enable) { @@ -607,20 +607,20 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements E boolean fastCpu = Version.isArmv7(); if (fastCpu) { - detectAudioCodec(pref_codec_ilbc_key, "iLBC", 8000, false); + detectAudioCodec(pref_codec_ilbc_key, "iLBC", 8000, 1, false); findPreference(pref_codec_speex16_key).setEnabled(true); //findPreference(pref_codec_speex32_key)).setEnabled(enableIlbc); } initializeMediaEncryptionPreferences(); - detectAudioCodec(pref_codec_amr_key,"AMR", 8000, false); - detectAudioCodec(pref_codec_amrwb_key,"AMR-WB", 16000, false); - //detectAudioCodec(R.string.pref_codec_silk8_key,"SILK",8000, true); - //detectAudioCodec(R.string.pref_codec_silk12_key,"SILK",12000, true); - detectAudioCodec(R.string.pref_codec_silk16_key,"SILK",16000, true); - detectAudioCodec(R.string.pref_codec_silk24_key,"SILK",24000, true); - detectAudioCodec(R.string.pref_codec_g729_key,"G729",8000, true); + detectAudioCodec(pref_codec_amr_key,"AMR", 8000, 1, false); + detectAudioCodec(pref_codec_amrwb_key,"AMR-WB", 16000, 1, false); + //detectAudioCodec(R.string.pref_codec_silk8_key,"SILK",8000, 1, true); + //detectAudioCodec(R.string.pref_codec_silk12_key,"SILK",12000, 1, true); + detectAudioCodec(R.string.pref_codec_silk16_key,"SILK",16000, 1, true); + detectAudioCodec(R.string.pref_codec_silk24_key,"SILK",24000, 1, true); + detectAudioCodec(R.string.pref_codec_g729_key,"G729",8000, 1, true); // No video if (!Version.isVideoCapable()) { From 13cb13132994a9a291a07e085baa0f5ea099e8af Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 7 Nov 2012 10:18:31 +0100 Subject: [PATCH 20/60] Fix g729 codec enabling. --- src/org/linphone/LinphoneManager.java | 40 +++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 7cf1643b3..2169aa036 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -581,22 +581,22 @@ public final class LinphoneManager implements LinphoneCoreListener { try { // Configure audio codecs -// enableDisableAudioCodec("speex", 32000, R.string.pref_codec_speex32_key); - enableDisableAudioCodec("speex", 32000, false); - enableDisableAudioCodec("speex", 16000, R.string.pref_codec_speex16_key); - enableDisableAudioCodec("speex", 8000, R.string.pref_codec_speex8_key); - enableDisableAudioCodec("iLBC", 8000, R.string.pref_codec_ilbc_key); - enableDisableAudioCodec("GSM", 8000, R.string.pref_codec_gsm_key); - enableDisableAudioCodec("G722", 8000, R.string.pref_codec_g722_key); - enableDisableAudioCodec("G729", 8000, R.string.pref_codec_g729_key); - enableDisableAudioCodec("PCMU", 8000, R.string.pref_codec_pcmu_key); - enableDisableAudioCodec("PCMA", 8000, R.string.pref_codec_pcma_key); - enableDisableAudioCodec("AMR", 8000, R.string.pref_codec_amr_key); - enableDisableAudioCodec("AMR-WB", 16000, R.string.pref_codec_amrwb_key); - enableDisableAudioCodec("SILK", 24000, R.string.pref_codec_silk24_key); - enableDisableAudioCodec("SILK", 16000, R.string.pref_codec_silk16_key); - enableDisableAudioCodec("SILK", 12000, R.string.pref_codec_silk12_key); - enableDisableAudioCodec("SILK", 8000, R.string.pref_codec_silk8_key); +// enableDisableAudioCodec("speex", 32000, 1, R.string.pref_codec_speex32_key); + enableDisableAudioCodec("speex", 32000, 1, false); + enableDisableAudioCodec("speex", 16000, 1, R.string.pref_codec_speex16_key); + enableDisableAudioCodec("speex", 8000, 1, R.string.pref_codec_speex8_key); + enableDisableAudioCodec("iLBC", 8000, 1, R.string.pref_codec_ilbc_key); + enableDisableAudioCodec("GSM", 8000, 1, R.string.pref_codec_gsm_key); + enableDisableAudioCodec("G722", 8000, 1, R.string.pref_codec_g722_key); + enableDisableAudioCodec("G729", 8000, 1, R.string.pref_codec_g729_key); + enableDisableAudioCodec("PCMU", 8000, 1, R.string.pref_codec_pcmu_key); + enableDisableAudioCodec("PCMA", 8000, 1, R.string.pref_codec_pcma_key); + enableDisableAudioCodec("AMR", 8000, 1, R.string.pref_codec_amr_key); + enableDisableAudioCodec("AMR-WB", 16000, 1, R.string.pref_codec_amrwb_key); + enableDisableAudioCodec("SILK", 24000, 1, R.string.pref_codec_silk24_key); + enableDisableAudioCodec("SILK", 16000, 1, R.string.pref_codec_silk16_key); + enableDisableAudioCodec("SILK", 12000, 1, R.string.pref_codec_silk12_key); + enableDisableAudioCodec("SILK", 8000, 1, R.string.pref_codec_silk8_key); // Configure video codecs @@ -768,15 +768,15 @@ public final class LinphoneManager implements LinphoneCoreListener { mLc.setSignalingTransportPorts(ports); } - private void enableDisableAudioCodec(String codec, int rate, int key) throws LinphoneCoreException { - PayloadType pt = mLc.findPayloadType(codec, rate); + private void enableDisableAudioCodec(String codec, int rate, int channels, int key) throws LinphoneCoreException { + PayloadType pt = mLc.findPayloadType(codec, rate, channels); if (pt !=null) { boolean enable= getPrefBoolean(key,false); mLc.enablePayloadType(pt, enable); } } - private void enableDisableAudioCodec(String codec, int rate, boolean enable) throws LinphoneCoreException { - PayloadType pt = mLc.findPayloadType(codec, rate); + private void enableDisableAudioCodec(String codec, int rate, int channels, boolean enable) throws LinphoneCoreException { + PayloadType pt = mLc.findPayloadType(codec, rate, channels); if (pt !=null) { mLc.enablePayloadType(pt, enable); } From 7b0305110ae1a57e52bdd34b94fccf72a50544b1 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 7 Nov 2012 11:03:27 +0100 Subject: [PATCH 21/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 871acb003..7b502e170 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 871acb0039a7c7a3d7849e83134ae37a1861d856 +Subproject commit 7b502e170b23b4dcbdb170554a15de92ac188ff3 From 5b3eb64158cba9b917e6fdbe47cf8bbf3c68be3a Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 14 Nov 2012 09:51:22 +0100 Subject: [PATCH 22/60] Icon in status bar only display main account status --- src/org/linphone/LinphoneService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index 6e395df19..ba3d8e3b9 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -447,11 +447,11 @@ public final class LinphoneService extends Service implements LinphoneServiceLis Log.i("Service not ready, discarding registration state change to ",state.toString()); return; } - if (state == RegistrationState.RegistrationOk && LinphoneManager.getLc().getDefaultProxyConfig().isRegistered()) { + if (state == RegistrationState.RegistrationOk && LinphoneManager.getLc().getDefaultProxyConfig() != null && LinphoneManager.getLc().getDefaultProxyConfig().isRegistered()) { sendNotification(IC_LEVEL_ORANGE, R.string.notification_registered); } - if (state == RegistrationState.RegistrationFailed || state == RegistrationState.RegistrationCleared) { + if ((state == RegistrationState.RegistrationFailed || state == RegistrationState.RegistrationCleared) && (LinphoneManager.getLc().getDefaultProxyConfig() == null || !LinphoneManager.getLc().getDefaultProxyConfig().isRegistered())) { sendNotification(IC_LEVEL_OFFLINE, R.string.notification_register_failure); } From 9ae1b0d596625ec2231c1d3c572bcb0cd293f0b2 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 15 Nov 2012 11:32:49 +0100 Subject: [PATCH 23/60] Update linphone submodule for WebRTC echo canceller. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 7b502e170..6b32d7d6c 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 7b502e170b23b4dcbdb170554a15de92ac188ff3 +Subproject commit 6b32d7d6c6af200b9ae01640b9412e45722790d9 From 326a6060483542cf6b650f354296056f7d409c35 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 15 Nov 2012 11:40:19 +0100 Subject: [PATCH 24/60] Add WebRTC echo canceller. --- .gitmodules | 3 + Makefile | 2 +- jni/Android.mk | 12 +++ jni/Application.mk | 5 + res/raw/linphonerc | 2 - submodules/externals/build/webrtc/Android.mk | 10 ++ .../common_audio/signal_processing/Android.mk | 96 +++++++++++++++++++ .../modules/audio_processing/aecm/Android.mk | 87 +++++++++++++++++ .../aecm/aecm_core_neon_offsets.h | 8 ++ .../audio_processing/utility/Android.mk | 43 +++++++++ .../build/webrtc/system_wrappers/Android.mk | 39 ++++++++ submodules/externals/webrtc | 1 + 12 files changed, 305 insertions(+), 3 deletions(-) create mode 100644 submodules/externals/build/webrtc/Android.mk create mode 100644 submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk create mode 100644 submodules/externals/build/webrtc/modules/audio_processing/aecm/Android.mk create mode 100644 submodules/externals/build/webrtc/modules/audio_processing/aecm/aecm_core_neon_offsets.h create mode 100644 submodules/externals/build/webrtc/modules/audio_processing/utility/Android.mk create mode 100644 submodules/externals/build/webrtc/system_wrappers/Android.mk create mode 160000 submodules/externals/webrtc diff --git a/.gitmodules b/.gitmodules index f488bd83e..e250e561c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -55,3 +55,6 @@ [submodule "submodules/bcg729"] path = submodules/bcg729 url = git://git.linphone.org/bcg729.git +[submodule "submodules/externals/webrtc"] + path = submodules/externals/webrtc + url = gitosis@git.linphone.org:webrtc diff --git a/Makefile b/Makefile index 021137551..91ac19447 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ prepare-mediastreamer2: prepare-sources: prepare-ffmpeg prepare-ilbc prepare-vpx prepare-silk prepare-srtp prepare-mediastreamer2 generate-libs: - $(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_SILK=1 BUILD_AMRNB=full -j$(NUMCPUS) + $(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_SILK=1 BUILD_AMRNB=full BUILD_G729=1 BUILD_WEBRTC_AECM=1 -j$(NUMCPUS) update-project: $(SDK_PATH)/android update project --path . diff --git a/jni/Android.mk b/jni/Android.mk index 35e56b068..3c6df768b 100755 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -143,3 +143,15 @@ ifneq ($(BUILD_G729), 0) include $(linphone-root-dir)/submodules/bcg729/Android.mk include $(linphone-root-dir)/submodules/bcg729/msbcg729/Android.mk endif + +ifneq ($(BUILD_WEBRTC_AECM), 0) +ifneq ($(TARGET_ARCH), x86) +ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) +WEBRTC_BUILD_NEON_LIBS=true +endif +include $(linphone-root-dir)/submodules/externals/build/webrtc/system_wrappers/Android.mk +include $(linphone-root-dir)/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk +include $(linphone-root-dir)/submodules/externals/build/webrtc/modules/audio_processing/utility/Android.mk +include $(linphone-root-dir)/submodules/externals/build/webrtc/modules/audio_processing/aecm/Android.mk +endif +endif diff --git a/jni/Application.mk b/jni/Application.mk index c67dc451a..e6aae1f36 100644 --- a/jni/Application.mk +++ b/jni/Application.mk @@ -48,6 +48,11 @@ ifeq ($(BUILD_G729),1) APP_MODULES +=libbcg729 libmsbcg729 endif +ifneq ($BUILD_WEBRTC_AECM), 0) +APP_MODULES += libwebrtc_system_wrappers libwebrtc_spl libwebrtc_apm_utility libwebrtc_aecm +APP_MODULES += libwebrtc_spl_neon libwebrtc_aecm_neon +endif + ifeq ($(RING),yes) APP_MODULES += libring endif diff --git a/res/raw/linphonerc b/res/raw/linphonerc index 5f3bbe5f0..7b64b4898 100644 --- a/res/raw/linphonerc +++ b/res/raw/linphonerc @@ -34,8 +34,6 @@ ringer_dev_id= capture_dev_id= remote_ring=/data/data/org.linphone/files/ringback.wav local_ring=/data/data/org.linphone/files/oldphone_mono.wav -ec_tail_len=120 -ec_framesize=128 el_type=mic el_thres=0.03 diff --git a/submodules/externals/build/webrtc/Android.mk b/submodules/externals/build/webrtc/Android.mk new file mode 100644 index 000000000..71185c94d --- /dev/null +++ b/submodules/externals/build/webrtc/Android.mk @@ -0,0 +1,10 @@ +MY_WEBRTC_COMMON_DEFS := \ + -DWEBRTC_ANDROID \ + -DWEBRTC_LINUX \ + -DWEBRTC_CLOCK_TYPE_REALTIME \ + -DWEBRTC_ARCH_ARM + +ifeq ($(TARGET_ARCH_ABI), armeabi-v7a) +MY_WEBRTC_COMMON_DEFS += \ + -DWEBRTC_DETECT_ARM_NEON +endif diff --git a/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk b/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk new file mode 100644 index 000000000..0c04ebea3 --- /dev/null +++ b/submodules/externals/build/webrtc/common_audio/signal_processing/Android.mk @@ -0,0 +1,96 @@ +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +MY_WEBRTC_PATH := $(call my-dir)/../../ +LOCAL_PATH := $(MY_WEBRTC_PATH)/../../webrtc/common_audio/signal_processing + +include $(CLEAR_VARS) + +include $(MY_WEBRTC_PATH)/Android.mk + +LOCAL_ARM_MODE := arm +LOCAL_MODULE_CLASS := STATIC_LIBRARIES +LOCAL_MODULE := libwebrtc_spl +LOCAL_MODULE_TAGS := optional +LOCAL_SRC_FILES := \ + complex_fft.c \ + cross_correlation.c \ + division_operations.c \ + downsample_fast.c \ + min_max_operations.c \ + randomization_functions.c \ + real_fft.c \ + spl_init.c \ + vector_scaling_operations.c + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := \ + $(MY_WEBRTC_COMMON_DEFS) + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/../.. + +ifeq ($(TARGET_ARCH),arm) +LOCAL_SRC_FILES += \ + complex_bit_reverse_arm.s \ + spl_sqrt_floor_arm.s +else +LOCAL_SRC_FILES += \ + complex_bit_reverse.c \ + spl_sqrt_floor.c +endif + +LOCAL_SHARED_LIBRARIES := libstlport + +ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true) +LOCAL_LDLIBS += -ldl -lpthread +endif + +ifneq ($(TARGET_SIMULATOR),true) +LOCAL_SHARED_LIBRARIES += libdl +endif + +ifndef NDK_ROOT +include external/stlport/libstlport.mk +endif +include $(BUILD_STATIC_LIBRARY) + +######################### +# Build the neon library. +ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) + +include $(CLEAR_VARS) + +include $(MY_WEBRTC_PATH)/Android.mk + +LOCAL_ARM_MODE := arm +LOCAL_MODULE_CLASS := STATIC_LIBRARIES +LOCAL_MODULE := libwebrtc_spl_neon +LOCAL_MODULE_TAGS := optional +LOCAL_SRC_FILES := \ + cross_correlation_neon.s \ + downsample_fast_neon.s \ + min_max_operations_neon.s \ + vector_scaling_operations_neon.s + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := \ + $(MY_WEBRTC_COMMON_DEFS) \ + $(MY_ARM_CFLAGS_NEON) + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/../.. + +ifndef NDK_ROOT +include external/stlport/libstlport.mk +endif +include $(BUILD_STATIC_LIBRARY) + +endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) diff --git a/submodules/externals/build/webrtc/modules/audio_processing/aecm/Android.mk b/submodules/externals/build/webrtc/modules/audio_processing/aecm/Android.mk new file mode 100644 index 000000000..9ef3de3bd --- /dev/null +++ b/submodules/externals/build/webrtc/modules/audio_processing/aecm/Android.mk @@ -0,0 +1,87 @@ +############################# +# Build the non-neon library. + +MY_WEBRTC_PATH := $(call my-dir)/../../../ +LOCAL_PATH := $(MY_WEBRTC_PATH)/../../webrtc/modules/audio_processing/aecm + +include $(CLEAR_VARS) + +include $(MY_WEBRTC_PATH)/Android.mk + +LOCAL_ARM_MODE := arm +LOCAL_MODULE_CLASS := STATIC_LIBRARIES +LOCAL_MODULE := libwebrtc_aecm +LOCAL_MODULE_TAGS := optional +LOCAL_SRC_FILES := \ + echo_control_mobile.c \ + aecm_core.c + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := $(MY_WEBRTC_COMMON_DEFS) + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/../utility \ + $(LOCAL_PATH)/../../.. \ + $(LOCAL_PATH)/../../../common_audio/signal_processing/include \ + $(LOCAL_PATH)/../../../system_wrappers/interface \ + +LOCAL_STATIC_LIBRARIES += libwebrtc_system_wrappers + +LOCAL_SHARED_LIBRARIES := \ + libcutils \ + libdl \ + libstlport + +ifndef NDK_ROOT +include external/stlport/libstlport.mk +endif +include $(BUILD_STATIC_LIBRARY) + +######################### +# Build the neon library. +ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) + +include $(CLEAR_VARS) + +include $(MY_WEBRTC_PATH)/Android.mk + +LOCAL_ARM_MODE := arm +LOCAL_MODULE_CLASS := STATIC_LIBRARIES +LOCAL_MODULE := libwebrtc_aecm_neon +LOCAL_MODULE_TAGS := optional + +# Generate a header file aecm_core_neon_offsets.h which will be included in +# assembly file aecm_core_neon.S, from file aecm_core_neon_offsets.c. +#$(LOCAL_PATH)/aecm_core_neon_offsets.h: $(LOCAL_PATH)/aecm_core_neon_offsets.S +# python $(LOCAL_PATH)/../../../build/generate_asm_header.py $^ $@ offset_aecm_ +# +#$(LOCAL_PATH)/aecm_core_neon_offsets.S: $(LOCAL_PATH)/aecm_core_neon_offsets.c +# $(TARGET_CC) $(addprefix -I, $(LOCAL_INCLUDES)) $(addprefix -isystem ,\ +# $(TARGET_C_INCLUDES)) -S -o $@ $^ +# +#$(LOCAL_PATH)/aecm_core_neon.S: $(LOCAL_PATH)/aecm_core_neon_offsets.h + +LOCAL_SRC_FILES := aecm_core_neon.S + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := \ + $(MY_WEBRTC_COMMON_DEFS) \ + -mfpu=neon \ + -mfloat-abi=softfp \ + -flax-vector-conversions + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include \ + $(LOCAL_PATH)/../../.. \ + $(LOCAL_PATH)/../../../common_audio/signal_processing/include \ + $(MY_WEBRTC_PATH)/modules/audio_processing/aecm + +LOCAL_INCLUDES := $(LOCAL_C_INCLUDES) + +ifndef NDK_ROOT +include external/stlport/libstlport.mk +endif +include $(BUILD_STATIC_LIBRARY) + +endif # ifeq ($(WEBRTC_BUILD_NEON_LIBS),true) diff --git a/submodules/externals/build/webrtc/modules/audio_processing/aecm/aecm_core_neon_offsets.h b/submodules/externals/build/webrtc/modules/audio_processing/aecm/aecm_core_neon_offsets.h new file mode 100644 index 000000000..7f24270ec --- /dev/null +++ b/submodules/externals/build/webrtc/modules/audio_processing/aecm/aecm_core_neon_offsets.h @@ -0,0 +1,8 @@ +#define offset_aecm_dfaCleanQDomain 13976 +#define offset_aecm_outBuf 15988 +#define offset_aecm_xBuf 15976 +#define offset_aecm_dBufNoisy 15984 +#define offset_aecm_dBufClean 15980 +#define offset_aecm_channelStored 15964 +#define offset_aecm_channelAdapt16 15968 +#define offset_aecm_channelAdapt32 15972 diff --git a/submodules/externals/build/webrtc/modules/audio_processing/utility/Android.mk b/submodules/externals/build/webrtc/modules/audio_processing/utility/Android.mk new file mode 100644 index 000000000..8f8bb6b8c --- /dev/null +++ b/submodules/externals/build/webrtc/modules/audio_processing/utility/Android.mk @@ -0,0 +1,43 @@ +# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +MY_WEBRTC_PATH := $(call my-dir)/../../../ +LOCAL_PATH := $(MY_WEBRTC_PATH)/../../webrtc/modules/audio_processing/utility + +include $(CLEAR_VARS) + +include $(MY_WEBRTC_PATH)/Android.mk + +LOCAL_ARM_MODE := arm +LOCAL_MODULE_CLASS := STATIC_LIBRARIES +LOCAL_MODULE := libwebrtc_apm_utility +LOCAL_MODULE_TAGS := optional +LOCAL_SRC_FILES := \ + ring_buffer.c \ + delay_estimator.c \ + delay_estimator_wrapper.c + +# Flags passed to both C and C++ files. +LOCAL_CFLAGS := \ + $(MY_WEBRTC_COMMON_DEFS) + +# Include paths placed before CFLAGS/CPPFLAGS +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH) \ + $(LOCAL_PATH)/../../.. \ + $(LOCAL_PATH)/../../../common_audio/signal_processing/include + +LOCAL_SHARED_LIBRARIES := \ + libcutils \ + libdl \ + libstlport + +ifndef NDK_ROOT +include external/stlport/libstlport.mk +endif +include $(BUILD_STATIC_LIBRARY) diff --git a/submodules/externals/build/webrtc/system_wrappers/Android.mk b/submodules/externals/build/webrtc/system_wrappers/Android.mk new file mode 100644 index 000000000..fce5e9cdd --- /dev/null +++ b/submodules/externals/build/webrtc/system_wrappers/Android.mk @@ -0,0 +1,39 @@ +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +MY_WEBRTC_PATH := $(call my-dir)/../ +LOCAL_PATH := $(MY_WEBRTC_PATH)/../../webrtc/system_wrappers/source + +include $(CLEAR_VARS) + +include $(MY_WEBRTC_PATH)/Android.mk + +LOCAL_ARM_MODE := arm +LOCAL_MODULE := libwebrtc_system_wrappers +LOCAL_MODULE_TAGS := optional +LOCAL_CPP_EXTENSION := .cc +LOCAL_SRC_FILES := \ + cpu_features_android.c + +LOCAL_CFLAGS := \ + $(MY_WEBRTC_COMMON_DEFS) + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/../.. \ + $(LOCAL_PATH)/../interface \ + $(LOCAL_PATH)/spreadsortlib + +LOCAL_SHARED_LIBRARIES := \ + libcutils \ + libdl \ + libstlport + +ifndef NDK_ROOT +include external/stlport/libstlport.mk +endif +include $(BUILD_STATIC_LIBRARY) diff --git a/submodules/externals/webrtc b/submodules/externals/webrtc new file mode 160000 index 000000000..2117f353f --- /dev/null +++ b/submodules/externals/webrtc @@ -0,0 +1 @@ +Subproject commit 2117f353f82da43f648b10dc6bd99f55e0d44c3f From b73f7a32e6fafecce960d9b8b7b1a3becdbc810c Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 15 Nov 2012 11:56:11 +0100 Subject: [PATCH 25/60] Deactivate audio codecs that use a clock rate other than 8000 and 16000 Hz. --- res/xml/preferences.xml | 2 -- src/org/linphone/LinphoneManager.java | 6 ++++-- src/org/linphone/LinphonePreferencesActivity.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index e00f6bfef..d4adc9a5d 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -88,8 +88,6 @@ - Date: Thu, 15 Nov 2012 11:59:14 +0100 Subject: [PATCH 26/60] Deactivate echo limiter in speaker mode. --- res/raw/linphonerc | 8 -------- src/org/linphone/LinphoneManager.java | 13 ------------- 2 files changed, 21 deletions(-) diff --git a/res/raw/linphonerc b/res/raw/linphonerc index 7b64b4898..5b5d33f6f 100644 --- a/res/raw/linphonerc +++ b/res/raw/linphonerc @@ -35,14 +35,6 @@ capture_dev_id= remote_ring=/data/data/org.linphone/files/ringback.wav local_ring=/data/data/org.linphone/files/oldphone_mono.wav -el_type=mic -el_thres=0.03 -el_force=100000 -el_sustain=600 -el_transmit_thres=1.7 -ng_floorgain=0.01 - - [video] size=vga diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index eb9c6859b..223a541f3 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -245,13 +245,6 @@ public final class LinphoneManager implements LinphoneCoreListener { */ public void routeAudioToSpeaker() { routeAudioToSpeakerHelper(true); - LinphoneCall currentCall = mLc.getCurrentCall(); - if (currentCall != null && !Hacks.hasBuiltInEchoCanceller()) { - /*disable EC, it is not efficient enough on speaker mode due to bad quality of speakers and saturation*/ - currentCall.enableEchoCancellation(false); - /* instead we prefer the echo limiter */ - currentCall.enableEchoLimiter(true); - } } /** @@ -259,12 +252,6 @@ public final class LinphoneManager implements LinphoneCoreListener { */ public void routeAudioToReceiver() { routeAudioToSpeakerHelper(false); - LinphoneCall call=mLc.getCurrentCall(); - if (call!=null && !Hacks.hasBuiltInEchoCanceller()) { - //Restore default value - call.enableEchoCancellation(mLc.isEchoCancellationEnabled()); - call.enableEchoLimiter(mLc.isEchoLimiterEnabled()); - } } public synchronized static final LinphoneManager createAndStart( From 862f32e4960cc4cbc834f4780ba5344e948f4450 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 15 Nov 2012 12:57:17 +0100 Subject: [PATCH 27/60] Use public url for the webrtc submodule. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index e250e561c..a21a0a5c3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -57,4 +57,4 @@ url = git://git.linphone.org/bcg729.git [submodule "submodules/externals/webrtc"] path = submodules/externals/webrtc - url = gitosis@git.linphone.org:webrtc + url = git://git.linphone.org/webrtc.git From b20cb3afb4bfeb4c0739e3fad00ff93bb848fbc2 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 16 Nov 2012 11:26:50 +0100 Subject: [PATCH 28/60] Added method to listen for connection changed elsewhere in the code --- src/org/linphone/LinphoneManager.java | 12 ++++++++++-- src/org/linphone/LinphoneSimpleListener.java | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 223a541f3..d32093f1a 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -47,6 +47,7 @@ import java.util.Set; import java.util.Timer; import java.util.TimerTask; +import org.linphone.LinphoneSimpleListener.ConnectivityChangedListener; import org.linphone.LinphoneSimpleListener.LinphoneOnAudioChangedListener; import org.linphone.LinphoneSimpleListener.LinphoneOnAudioChangedListener.AudioState; import org.linphone.LinphoneSimpleListener.LinphoneOnDTMFReceivedListener; @@ -58,6 +59,7 @@ import org.linphone.core.LinphoneAuthInfo; import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCallStats; +import org.linphone.core.LinphoneChatMessage; import org.linphone.core.LinphoneChatRoom; import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCore.EcCalibratorStatus; @@ -66,7 +68,6 @@ import org.linphone.core.LinphoneCore.GlobalState; import org.linphone.core.LinphoneCore.MediaEncryption; import org.linphone.core.LinphoneCore.RegistrationState; import org.linphone.core.LinphoneCore.Transports; -import org.linphone.core.LinphoneChatMessage; import org.linphone.core.LinphoneCoreException; import org.linphone.core.LinphoneCoreFactory; import org.linphone.core.LinphoneCoreListener; @@ -866,9 +867,16 @@ public final class LinphoneManager implements LinphoneCoreListener { Log.i(eventInfo.getTypeName()," connected: wifi only activated, setting network unreachable"); } } + + if (connectivityListener != null) { + connectivityListener.onConnectivityChanged(eventInfo, cm); + } } - + private ConnectivityChangedListener connectivityListener; + public void addConnectivityChangedListener(ConnectivityChangedListener l) { + connectivityListener = l; + } diff --git a/src/org/linphone/LinphoneSimpleListener.java b/src/org/linphone/LinphoneSimpleListener.java index 0a10cebf1..1e94f6561 100644 --- a/src/org/linphone/LinphoneSimpleListener.java +++ b/src/org/linphone/LinphoneSimpleListener.java @@ -25,6 +25,8 @@ import org.linphone.core.LinphoneCore.GlobalState; import org.linphone.core.LinphoneCore.RegistrationState; import android.media.MediaPlayer; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; public interface LinphoneSimpleListener { @@ -67,4 +69,7 @@ public interface LinphoneSimpleListener { void onDTMFReceived(LinphoneCall call, int dtmf); } + public static interface ConnectivityChangedListener extends LinphoneSimpleListener { + void onConnectivityChanged(NetworkInfo eventInfo, ConnectivityManager cm); + } } From 8d1f2c6c40034d974058439995f77423d79e8689 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 16 Nov 2012 11:35:33 +0100 Subject: [PATCH 29/60] Added context argument to connectivity listener --- src/org/linphone/LinphoneManager.java | 2 +- src/org/linphone/LinphoneSimpleListener.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index d32093f1a..4e5cc6011 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -869,7 +869,7 @@ public final class LinphoneManager implements LinphoneCoreListener { } if (connectivityListener != null) { - connectivityListener.onConnectivityChanged(eventInfo, cm); + connectivityListener.onConnectivityChanged(mServiceContext, eventInfo, cm); } } diff --git a/src/org/linphone/LinphoneSimpleListener.java b/src/org/linphone/LinphoneSimpleListener.java index 1e94f6561..b69193888 100644 --- a/src/org/linphone/LinphoneSimpleListener.java +++ b/src/org/linphone/LinphoneSimpleListener.java @@ -24,6 +24,7 @@ import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCore.GlobalState; import org.linphone.core.LinphoneCore.RegistrationState; +import android.content.Context; import android.media.MediaPlayer; import android.net.ConnectivityManager; import android.net.NetworkInfo; @@ -70,6 +71,6 @@ public interface LinphoneSimpleListener { } public static interface ConnectivityChangedListener extends LinphoneSimpleListener { - void onConnectivityChanged(NetworkInfo eventInfo, ConnectivityManager cm); + void onConnectivityChanged(Context context, NetworkInfo eventInfo, ConnectivityManager cm); } } From e5d5550284dab99bd50b55111c491868d748bced Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 16 Nov 2012 15:32:13 +0100 Subject: [PATCH 30/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 6b32d7d6c..08dadabca 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 6b32d7d6c6af200b9ae01640b9412e45722790d9 +Subproject commit 08dadabca9cd60b062521cb0fcf47f67d4ceb23d From 91da7043bac36b06a9a4148d5ffa77b937d71834 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 19 Nov 2012 16:02:20 +0100 Subject: [PATCH 31/60] Updated linphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 08dadabca..2c5421f22 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 08dadabca9cd60b062521cb0fcf47f67d4ceb23d +Subproject commit 2c5421f22e37952123d4cd06bf3b13da80a1e86f From c49d9d56fa4b76a635422170e27566459e2e8238 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 20 Nov 2012 14:17:07 +0100 Subject: [PATCH 32/60] Prevent breaking audio of ongoing GSM call when releasing a SIP call. --- src/org/linphone/LinphoneManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 4e5cc6011..f1c72506d 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -1008,7 +1008,10 @@ public final class LinphoneManager implements LinphoneCoreListener { } if (state == CallEnd || state == Error) { - mAudioManager.setMode(MODE_NORMAL); + TelephonyManager tm = (TelephonyManager) LinphoneActivity.instance().getSystemService(Context.TELEPHONY_SERVICE); + if (tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) { + mAudioManager.setMode(MODE_NORMAL); + } } if (state == State.Connected) { @@ -1390,7 +1393,8 @@ public final class LinphoneManager implements LinphoneCoreListener { boolean sendCamera = mLc.getConferenceSize() == 0; enableCamera(call, sendCamera); } - if (state == State.CallEnd && mLc.getCallsNb() == 0) { + TelephonyManager tm = (TelephonyManager) LinphoneActivity.instance().getSystemService(Context.TELEPHONY_SERVICE); + if (state == State.CallEnd && mLc.getCallsNb() == 0 && tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) { routeAudioToReceiver(); } From 253fdad6b66cf4bc31532aa6e4d00dba01190b5e Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 20 Nov 2012 16:45:04 +0100 Subject: [PATCH 33/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 2c5421f22..2d019536d 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 2c5421f22e37952123d4cd06bf3b13da80a1e86f +Subproject commit 2d019536da933d707059084f64ce4e073246b7db From 9c47b2ffd670726755fd4ec530dae70c917e732a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 23 Nov 2012 10:01:50 +0100 Subject: [PATCH 34/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 2d019536d..96dc7aac8 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 2d019536da933d707059084f64ce4e073246b7db +Subproject commit 96dc7aac83db689dfcad04791a36df256aa83f21 From e367f13626580552f9c195b4e2b51c2bc76d64b3 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 27 Nov 2012 13:44:04 +0100 Subject: [PATCH 35/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 96dc7aac8..4315fafad 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 96dc7aac83db689dfcad04791a36df256aa83f21 +Subproject commit 4315fafad9ebe1ccb0795a2c6c2997567e61c466 From 5b0801c0a53a0ee4019af4f0fa4acaed82e6e793 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 4 Dec 2012 09:41:23 +0100 Subject: [PATCH 36/60] Update liblinphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 4315fafad..243016a97 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 4315fafad9ebe1ccb0795a2c6c2997567e61c466 +Subproject commit 243016a976f22ba31059aced9b5c748edb133e55 From ec71a1275e0ddaa83f2631908e17b6782f3e77e8 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 4 Dec 2012 14:34:21 +0100 Subject: [PATCH 37/60] Fix crash --- src/org/linphone/LinphoneManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index f1c72506d..a8e3b472e 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -1008,7 +1008,7 @@ public final class LinphoneManager implements LinphoneCoreListener { } if (state == CallEnd || state == Error) { - TelephonyManager tm = (TelephonyManager) LinphoneActivity.instance().getSystemService(Context.TELEPHONY_SERVICE); + TelephonyManager tm = (TelephonyManager) LinphoneService.instance().getSystemService(Context.TELEPHONY_SERVICE); if (tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) { mAudioManager.setMode(MODE_NORMAL); } @@ -1393,7 +1393,7 @@ public final class LinphoneManager implements LinphoneCoreListener { boolean sendCamera = mLc.getConferenceSize() == 0; enableCamera(call, sendCamera); } - TelephonyManager tm = (TelephonyManager) LinphoneActivity.instance().getSystemService(Context.TELEPHONY_SERVICE); + TelephonyManager tm = (TelephonyManager) LinphoneService.instance().getSystemService(Context.TELEPHONY_SERVICE); if (state == State.CallEnd && mLc.getCallsNb() == 0 && tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) { routeAudioToReceiver(); } From 490e6a3d977ab4201dc98f712dd61aeef0ce6f8d Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Tue, 4 Dec 2012 17:05:53 +0100 Subject: [PATCH 38/60] Fix build.xml --- build.xml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/build.xml b/build.xml index 7a656c56d..d87c5fd4d 100644 --- a/build.xml +++ b/build.xml @@ -549,6 +549,7 @@ libraryResFolderPathOut="project.library.res.folder.path" libraryBinAidlFolderPathOut="project.library.bin.aidl.folder.path" libraryNativeFolderPathOut="project.library.native.folder.path" + libraryRFilePathOut="project.library.bin.r.file.path" jarLibraryPathOut="project.all.jars.path" targetApi="${project.target.apilevel}" verbose="${verbose}" /> @@ -636,8 +637,8 @@ aidlOutFolder="${out.aidl.absolute.dir}"> - - + + @@ -665,6 +666,7 @@ rfolder="${gen.absolute.dir}" nonConstantId="${android.library}" libraryResFolderPathRefid="project.library.res.folder.path" + libraryRFileRefid="project.library.bin.r.file.path" libraryPackagesRefid="project.library.packages" ignoreAssets="${aapt.ignore.assets}" proguardFile="${out.absolute.dir}/proguard.txt"> @@ -945,7 +947,7 @@ - + @@ -1052,14 +1054,10 @@ - - - - - + @@ -1197,7 +1195,7 @@ - @@ -1537,4 +1535,4 @@ device. Also uninstall tested package if applicable unless 'nodeps' is used as well. - + \ No newline at end of file From 34a4242abad1238f28a2bdc0c26263a88253d301 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Tue, 4 Dec 2012 17:06:12 +0100 Subject: [PATCH 39/60] Lower mic volume on Galaxy S. --- src/org/linphone/LinphoneManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index a8e3b472e..113b1284f 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -1168,6 +1168,8 @@ public final class LinphoneManager implements LinphoneCoreListener { } public void setAudioModeIncallForGalaxyS() { + /* The microphone gain is way too high on the Galaxy S so correct it here. */ + LinphoneManager.getLc().setMicrophoneGain(-9.0f); mAudioManager.setMode(MODE_IN_CALL); } From 3fb8f1d34a9ab0926dbec710c150e602b64744c2 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Tue, 4 Dec 2012 17:07:10 +0100 Subject: [PATCH 40/60] Update linphone submodule (jni user-agent, SDP-less INVITE) --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 243016a97..ba478b89e 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 243016a976f22ba31059aced9b5c748edb133e55 +Subproject commit ba478b89e88f5b60f6f3ee5bfe9c636cd8648f3e From fc140df74d157ee1be49fd02c56841464fced4ce Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 5 Dec 2012 11:06:36 +0100 Subject: [PATCH 41/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index ba478b89e..634cab3d5 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit ba478b89e88f5b60f6f3ee5bfe9c636cd8648f3e +Subproject commit 634cab3d53830c0c6c12a7eddbe444d4de6f8178 From 22f3d826c0149d7bb12702356ed1ed881c350dd7 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 5 Dec 2012 15:15:41 +0100 Subject: [PATCH 42/60] Do update-project before generate-apk. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 91ac19447..01d9718d5 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ LINPHONE_VERSION=$(shell grep -e '^.C_INIT' submodules/linphone/configure.ac | s KEYSTORE=bc-android.keystore KEYALIAS=nw8000 -all: prepare-sources generate-libs generate-apk install-apk run-linphone +all: prepare-sources generate-libs update-project generate-apk install-apk run-linphone prepare-ffmpeg: ifeq ($(PATCH_FFMPEG),) From 212453983e3e5589f193266730bdda41712283b3 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 6 Dec 2012 09:25:13 +0100 Subject: [PATCH 43/60] Update the README about the NDK version. --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 56c34a0a2..de6db5ded 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ **************************** To build liblinphone for Android, you must: -1) download the Android ndk (>=r5c) from google. +1) download the latest Android ndk from google. 2) install the autotools: autoconf, automake, aclocal, libtoolize pkgconfig 3) run the ./prepare_sources.sh script in the top level directory. This will download iLBC source files and convert some assembly files in VP8 project. $ ./prepare_sources.sh From e3ffb0e886e1bb2dcaea0502b1605cfb04186ff6 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 6 Dec 2012 11:18:30 +0100 Subject: [PATCH 44/60] Updated ant build --- .gitignore | 1 - ant.properties | 2 + build.xml | 1612 +++------------------------------------------- custom_rules.xml | 93 +++ 4 files changed, 178 insertions(+), 1530 deletions(-) create mode 100644 ant.properties create mode 100644 custom_rules.xml diff --git a/.gitignore b/.gitignore index 3a33fd217..c2c31d413 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,5 @@ obj gen bin doc -ant.properties local.properties project.properties diff --git a/ant.properties b/ant.properties new file mode 100644 index 000000000..59e99e856 --- /dev/null +++ b/ant.properties @@ -0,0 +1,2 @@ +key.store=bc-android.keystore +key.alias=nw8000 diff --git a/build.xml b/build.xml index d87c5fd4d..5dedac939 100644 --- a/build.xml +++ b/build.xml @@ -1,1538 +1,92 @@ - + + + + + + + + + + + + + + + + + + + + - - - + + To customize existing targets, there are two options: + - Customize only one target: + - copy/paste the target into this file, *before* the + task. + - customize it to your needs. + - Customize the whole content of build.xml + - copy/paste the content of the rules files (minus the top node) + into this file, replacing the task. + - customize to your needs. - - - - - - + *********************** + ****** IMPORTANT ****** + *********************** + In all cases you must update the value of version-tag below to read 'custom' instead of an integer, + in order to avoid having your file be overridden by tools such as "android update project" + --> - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @{elseText} - - - - - - - - - - - - - - - - - - - - - @{elseText} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Running tests ... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Uninstalling @{app.package} from the default emulator or device... - - - - - - - - - - - - - - - - - - - - - - - - - Project Name: ${ant.project.name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Switching between debug and non debug build: Deleting previous compilation output... - - - - - - - - - - - - - Switching from instrumented to non-instrumented build: Deleting previous compilation output... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Resolving Build Target for ${ant.project.name}... - - - - - - - ---------- - Creating output directories if needed... - - - - - - - - - - ---------- - Resolving Dependencies for ${ant.project.name}... - - - - - - - - - - - - - - - - - ---------- - Building Libraries with '${project.libraries.target}'... - - - - - - - - - - - - - - - - - - - ---------- - Building tested project at ${tested.project.absolute.dir} with '${tested.project.target}'... - - - - - - - - - - - - - - - - - - - - - - - - - - Handling aidl files... - - - - - - - - - - ---------- - Handling RenderScript files... - - - - - ---------- - Handling Resources... - - - - - - ---------- - Handling BuildConfig class... - - - - - - - - - - - - - - - - - - - - - - - - - - Instrumenting classes from ${out.absolute.dir}/classes... - - - - - - - - - - - - - - - - - - - - - Creating library output jar file... - - - - - - - Custom jar packaging exclusion: ${android.package.excludes} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -include "${proguard.configcmd}" - -include "${out.absolute.dir}/proguard.txt" - -injars ${project.all.classes.value} - -outjars "${obfuscated.jar.file}" - -libraryjars ${project.target.classpath.value} - -dump "${obfuscate.absolute.dir}/dump.txt" - -printseeds "${obfuscate.absolute.dir}/seeds.txt" - -printusage "${obfuscate.absolute.dir}/usage.txt" - -printmapping "${obfuscate.absolute.dir}/mapping.txt" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Debug Package: ${out.final.file} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No key.store and key.alias properties found in build.properties. - Please sign ${out.packaged.file} manually - and run zipalign from the Android SDK tools. - - - - - - - proguard.config is ${proguard.config} - - - - - - - - - Proguard.config is enabled - - - - - - - - - - - - - - - - - - - - - - - - - - - - ************************************************* - **** Android Manifest has debuggable=true **** - **** Doing DEBUG packaging with RELEASE keys **** - ************************************************* - - - - - - - - - - - - - - - - Signing final apk... - - - - - Release Package: ${out.final.file} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Instrumented Package: ${out.final.file} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WARNING: Code Coverage is currently only supported on the emulator and rooted devices. - - - - - - - - Downloading coverage file into project directory... - - - - - - - Extracting coverage report... - - - - - - - - - - - - - - - - - - - Cleaning up temporary files... - - - Saving the report file in ${out.absolute.dir}/coverage.html - - - - - - - - - - - - - - - - - - - - - - - - - - - - Installing ${out.final.file} onto default emulator or device... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Install file not specified. - - 'ant install' now requires the build target to be specified as well. - - - ant debug install - ant release install - ant instrument install - This will build the given package and install it. - - Alternatively, you can use - ant installd - ant installr - ant installi - ant installt - to only install an existing package (this will not rebuild the package.) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Android Ant Build. Available targets: - help: Displays this help. - clean: Removes output files created by other targets. - The 'all' target can be used to clean dependencies - (tested projects and libraries)at the same time - using: 'ant all clean' - debug: Builds the application and signs it with a debug key. - The 'nodeps' target can be used to only build the - current project and ignore the libraries using: - 'ant nodeps debug' - release: Builds the application. The generated apk file must be - signed before it is published. - The 'nodeps' target can be used to only build the - current project and ignore the libraries using: - 'ant nodeps release' - instrument:Builds an instrumented package and signs it with a - debug key. - test: Runs the tests. Project must be a test project and - must have been built. Typical usage would be: - ant [emma] debug install test - emma: Transiently enables code coverage for subsequent - targets. - install: Installs the newly build package. Must either be used - in conjunction with a build target (debug/release/ - instrument) or with the proper suffix indicating - which package to install (see below). - If the application was previously installed, the - application is reinstalled if the signature matches. - installd: Installs (only) the debug package. - installr: Installs (only) the release package. - installi: Installs (only) the instrumented package. - installt: Installs (only) the test and tested packages (unless - nodeps is used as well. - uninstall: Uninstalls the application from a running emulator or - device. Also uninstall tested package if applicable - unless 'nodeps' is used as well. - - \ No newline at end of file + diff --git a/custom_rules.xml b/custom_rules.xml new file mode 100644 index 000000000..5002ce910 --- /dev/null +++ b/custom_rules.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + Generate JNI header + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From e6019200f626bd387a346fb065eaffb40ec79ddf Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 6 Dec 2012 11:48:48 +0100 Subject: [PATCH 45/60] Updated Makefile --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 01d9718d5..cc2641564 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ NUMCPUS=$(shell grep -c '^processor' /proc/cpuinfo || echo "4" ) TOPDIR=$(shell pwd) PATCH_FFMPEG=$(shell cd submodules/externals/ffmpeg && git status | grep neon) LINPHONE_VERSION=$(shell grep -e '^.C_INIT' submodules/linphone/configure.ac | sed -e 's/.*linphone]\,\[//' |sed -e 's/\].*//' ) +ANDROID_MOST_RECENT_TARGET=$(shell android list target -c | grep android | sort -V | tail -n1) KEYSTORE=bc-android.keystore KEYALIAS=nw8000 @@ -52,9 +53,7 @@ generate-libs: $(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_SILK=1 BUILD_AMRNB=full BUILD_G729=1 BUILD_WEBRTC_AECM=1 -j$(NUMCPUS) update-project: - $(SDK_PATH)/android update project --path . - echo "key.store=$(KEYSTORE)" > ant.properties - echo "key.alias=$(KEYALIAS)" >> ant.properties + $(SDK_PATH)/android update project --path . --target $(ANDROID_MOST_RECENT_TARGET) touch default.properties generate-apk: From 543f7448cfa3e53d343e83ac6e03faa178675664 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 6 Dec 2012 12:09:24 +0100 Subject: [PATCH 46/60] Fix Makefile for MacOSX --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cc2641564..4e9532f7c 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ NUMCPUS=$(shell grep -c '^processor' /proc/cpuinfo || echo "4" ) TOPDIR=$(shell pwd) PATCH_FFMPEG=$(shell cd submodules/externals/ffmpeg && git status | grep neon) LINPHONE_VERSION=$(shell grep -e '^.C_INIT' submodules/linphone/configure.ac | sed -e 's/.*linphone]\,\[//' |sed -e 's/\].*//' ) -ANDROID_MOST_RECENT_TARGET=$(shell android list target -c | grep android | sort -V | tail -n1) +ANDROID_MOST_RECENT_TARGET=$(shell android list target -c | nl -ba | grep android | sort | tail -n1 | cut -f2-) KEYSTORE=bc-android.keystore KEYALIAS=nw8000 From 144985adeefa19280b6d58a964ce0a5a266ceadc Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 6 Dec 2012 12:43:20 +0100 Subject: [PATCH 47/60] Added forgotten file needeed for ant compilation --- ant.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/ant.properties b/ant.properties index 59e99e856..7ddeeeb30 100644 --- a/ant.properties +++ b/ant.properties @@ -1,2 +1,3 @@ +source.dir=src:submodules/linphone/mediastreamer2/java/src:submodules/linphone/java/j2se:submodules/linphone/java/common:submodules/linphone/java/impl:submodules/linphone/coreapi/help/java key.store=bc-android.keystore key.alias=nw8000 From 48936353016b0da3300f8c5a6b90f97a29a8c3ad Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 6 Dec 2012 14:40:46 +0100 Subject: [PATCH 48/60] Make only compiles, make install run the app on the device --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4e9532f7c..62e411295 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,9 @@ ANDROID_MOST_RECENT_TARGET=$(shell android list target -c | nl -ba | grep androi KEYSTORE=bc-android.keystore KEYALIAS=nw8000 -all: prepare-sources generate-libs update-project generate-apk install-apk run-linphone +all: prepare-sources generate-libs update-project generate-apk + +install: all install-apk run-linphone prepare-ffmpeg: ifeq ($(PATCH_FFMPEG),) @@ -57,6 +59,7 @@ update-project: touch default.properties generate-apk: + ant clean ant debug install-apk: generate-apk From e285ac514d60a6f0c1df78f9a4470fd9a7589954 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 7 Dec 2012 11:49:11 +0100 Subject: [PATCH 49/60] Updated deliver_sdk --- custom_rules.xml | 13 ++++ default.properties | 16 ++--- deliver_sdk.sh | 167 ++++++++++++++++++++++----------------------- 3 files changed, 101 insertions(+), 95 deletions(-) diff --git a/custom_rules.xml b/custom_rules.xml index 5002ce910..ba9243a4c 100644 --- a/custom_rules.xml +++ b/custom_rules.xml @@ -49,6 +49,19 @@ + + Generate Javadoc + + + + diff --git a/default.properties b/default.properties index 99e31e38c..3ed73066a 100644 --- a/default.properties +++ b/default.properties @@ -1,11 +1,5 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-16 +javadoc.dir=liblinphone-android-javadoc +javadoc.dir=liblinphone-android-javadoc +javadoc.dir=liblinphone-android-javadoc +javadoc.dir=liblinphone-android-javadoc +javadoc.dir=liblinphone-android-javadoc diff --git a/deliver_sdk.sh b/deliver_sdk.sh index 333484197..39d708c6f 100755 --- a/deliver_sdk.sh +++ b/deliver_sdk.sh @@ -17,15 +17,15 @@ mkdir -p $D/gen cat > $D/.classpath < - - - - - - - - - + + + + + + + + + EOF @@ -39,74 +39,81 @@ grep -R "org.linphone.R" . -l | grep java | xargs sed -i 's/org\.linphone\.R/or cat > $D/AndroidManifest.xml < + package="org.linphone" android:versionCode="1" android:versionName="1.0"> + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - EOF cat > $D/default.properties <> local.properties < Date: Fri, 7 Dec 2012 11:53:00 +0100 Subject: [PATCH 50/60] Removed useless file from git --- default.properties | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 default.properties diff --git a/default.properties b/default.properties deleted file mode 100644 index 3ed73066a..000000000 --- a/default.properties +++ /dev/null @@ -1,5 +0,0 @@ -javadoc.dir=liblinphone-android-javadoc -javadoc.dir=liblinphone-android-javadoc -javadoc.dir=liblinphone-android-javadoc -javadoc.dir=liblinphone-android-javadoc -javadoc.dir=liblinphone-android-javadoc From 3dc2fd8df0a403430a76eaf186ea9f5efffac3d5 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 7 Dec 2012 12:10:26 +0100 Subject: [PATCH 51/60] Improved deliver_sdk script --- deliver_sdk.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deliver_sdk.sh b/deliver_sdk.sh index 39d708c6f..b5e2dbb04 100755 --- a/deliver_sdk.sh +++ b/deliver_sdk.sh @@ -154,10 +154,14 @@ rm -rf $DBASE DBASE="liblinphone-android-javadoc" D="../$DBASE.zip" +if grep -r "javadoc.dir" local.properties +then + echo "javadoc.dir already defined" +else + echo "javadoc.dir=$DBASE" >> local.properties +fi + echo "Generating javadoc to $D" -cat >> local.properties < Date: Fri, 7 Dec 2012 14:30:00 +0100 Subject: [PATCH 52/60] Added some methods to the API to remove custom notifs --- src/org/linphone/LinphoneService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index ba3d8e3b9..863a81458 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -25,6 +25,7 @@ import java.lang.reflect.Method; import org.linphone.LinphoneManager.NewOutgoingCallUiListener; import org.linphone.LinphoneSimpleListener.LinphoneServiceListener; +import org.linphone.compatibility.Compatibility; import org.linphone.core.LinphoneCall; import org.linphone.core.LinphoneCall.State; import org.linphone.core.LinphoneCore; @@ -254,6 +255,17 @@ public final class LinphoneService extends Service implements LinphoneServiceLis notifyWrapper(CUSTOM_NOTIF_ID, mMsgNotif); } + + public void removeCustomNotification() { + mNM.cancel(CUSTOM_NOTIF_ID); + resetIntentLaunchedOnNotificationClick(); + } + + private void resetIntentLaunchedOnNotificationClick() { + Intent notifIntent = new Intent(this, incomingReceivedActivity); + mNotifContentIntent = PendingIntent.getActivity(this, 0, notifIntent, PendingIntent.FLAG_UPDATE_CURRENT); + mNotif.setLatestEventInfo(this, mNotificationTitle, "", mNotifContentIntent); + } private static final Class[] mSetFgSign = new Class[] {boolean.class}; private static final Class[] mStartFgSign = new Class[] { From 07ba3e2a8e450ae5e3cbb044d6ac1dfaf52810b4 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 10 Dec 2012 09:43:06 +0100 Subject: [PATCH 53/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 634cab3d5..0849cfcff 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 634cab3d53830c0c6c12a7eddbe444d4de6f8178 +Subproject commit 0849cfcffa9bd30bdb30469afdfce513a86c149c From 50a1f3d3c3bf133f9d26353389c0a00ece7e3758 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 11 Dec 2012 10:13:37 +0100 Subject: [PATCH 54/60] Add contact param setter to API --- src/org/linphone/LinphoneManager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 113b1284f..1ae717923 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -142,6 +142,7 @@ public final class LinphoneManager implements LinphoneCoreListener { private String basePath; private static boolean sExited; private boolean videoInitiator = false; + private String contactParams; private WakeLock mIncallWakeLock; @@ -555,6 +556,10 @@ public final class LinphoneManager implements LinphoneCoreListener { mLc.tunnelAddServerAndMirror(host, port, 12345,500); manageTunnelServer(info); } + + public void setContactParams(String params) { + contactParams = params; + } public void initFromConf() throws LinphoneConfigException { @@ -646,6 +651,9 @@ public final class LinphoneManager implements LinphoneCoreListener { try { if (lDefaultProxyConfig == null) { lDefaultProxyConfig = LinphoneCoreFactory.instance().createProxyConfig(lIdentity, lProxy, null,true); + if (contactParams != null) { + lDefaultProxyConfig.setContactParameters(contactParams); + } mLc.addProxyConfig(lDefaultProxyConfig); int defaultAccount = getPrefInt(R.string.pref_default_account, 0); if (defaultAccount == 0 || defaultAccount >= getPrefInt(R.string.pref_extra_accounts, 0)) { @@ -688,6 +696,9 @@ public final class LinphoneManager implements LinphoneCoreListener { lProxy = "sip:" + lProxy; } lDefaultProxyConfig = LinphoneCoreFactory.instance().createProxyConfig(lIdentity, lProxy, null, true); + if (contactParams != null) { + lDefaultProxyConfig.setContactParameters(contactParams); + } mLc.addProxyConfig(lDefaultProxyConfig); //outbound proxy From 63c3ad8bdf947f46b6f4db624cc1a10952a3bda6 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 11 Dec 2012 11:28:41 +0100 Subject: [PATCH 55/60] Improve audio hack for Galaxy S. --- src/org/linphone/IncallActivity.java | 4 ++ src/org/linphone/IncomingCallActivity.java | 4 ++ src/org/linphone/LinphoneManager.java | 72 +++------------------- submodules/linphone | 2 +- 4 files changed, 19 insertions(+), 63 deletions(-) diff --git a/src/org/linphone/IncallActivity.java b/src/org/linphone/IncallActivity.java index 4cea2330f..bc940516d 100644 --- a/src/org/linphone/IncallActivity.java +++ b/src/org/linphone/IncallActivity.java @@ -852,6 +852,10 @@ public class IncallActivity extends AbstractCalleesActivity implements }); } } + if (state == State.StreamsRunning) { + // The following should not be needed except some devices need it (e.g. Galaxy S). + LinphoneManager.getLc().enableSpeaker(LinphoneManager.getLc().isSpeakerEnabled()); + } super.onCallStateChanged(call, state, message); } } diff --git a/src/org/linphone/IncomingCallActivity.java b/src/org/linphone/IncomingCallActivity.java index f7afc26fc..526579bbf 100644 --- a/src/org/linphone/IncomingCallActivity.java +++ b/src/org/linphone/IncomingCallActivity.java @@ -131,6 +131,10 @@ public class IncomingCallActivity extends Activity implements LinphoneOnCallStat if (call == mCall && State.CallEnd == state) { finish(); } + if (state == State.StreamsRunning) { + // The following should not be needed except some devices need it (e.g. Galaxy S). + LinphoneManager.getLc().enableSpeaker(LinphoneManager.getLc().isSpeakerEnabled()); + } } private void decline() { diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 1ae717923..d644eb306 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -18,11 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.linphone; -import static android.media.AudioManager.MODE_IN_CALL; import static android.media.AudioManager.MODE_NORMAL; -import static android.media.AudioManager.MODE_RINGTONE; -import static android.media.AudioManager.ROUTE_EARPIECE; -import static android.media.AudioManager.ROUTE_SPEAKER; import static android.media.AudioManager.STREAM_RING; import static android.media.AudioManager.STREAM_VOICE_CALL; import static android.media.AudioManager.VIBRATE_TYPE_RINGER; @@ -200,44 +196,13 @@ public final class LinphoneManager implements LinphoneCoreListener { private BroadcastReceiver mKeepAliveReceiver = new KeepAliveReceiver(); - private native void hackSpeakerState(boolean speakerOn); - private static void sRouteAudioToSpeakerHelperHelper(boolean speakerOn) { - getInstance().routeAudioToSpeakerHelperHelper(speakerOn); - } - private void routeAudioToSpeakerHelperHelper(boolean speakerOn) { - boolean different = isSpeakerOn() ^ speakerOn; - if (!different) { - Log.d("Skipping change audio route by the same route ", - speakerOn ? "speaker" : "earpiece"); - return; - } - if (Hacks.needGalaxySAudioHack() || sLPref.useGalaxySHack()) - setAudioModeIncallForGalaxyS(); - - if (sLPref.useSpecificAudioModeHack() != -1) - mAudioManager.setMode(sLPref.useSpecificAudioModeHack()); - - if (Hacks.needRoutingAPI() || sLPref.useAudioRoutingAPIHack()) { - mAudioManager.setRouting( - MODE_NORMAL, - speakerOn? ROUTE_SPEAKER : ROUTE_EARPIECE, - AudioManager.ROUTE_ALL); - } else { - mAudioManager.setSpeakerphoneOn(speakerOn); - } + private synchronized void routeAudioToSpeakerHelper(boolean speakerOn) { + mLc.enableSpeaker(speakerOn); + final LinphoneCall call = mLc.getCurrentCall(); for (LinphoneOnAudioChangedListener listener : getSimpleListeners(LinphoneOnAudioChangedListener.class)) { listener.onAudioStateChanged(speakerOn ? AudioState.SPEAKER : AudioState.EARPIECE); } } - private synchronized void routeAudioToSpeakerHelper(boolean speakerOn) { - final LinphoneCall call = mLc.getCurrentCall(); - if (call != null && call.getState() == State.StreamsRunning && Hacks.needPausingCallForSpeakers()) { - Log.d("Hack to have speaker=",speakerOn," while on call"); - hackSpeakerState(speakerOn); - } else { - routeAudioToSpeakerHelperHelper(speakerOn); - } - } /** * @@ -262,7 +227,7 @@ public final class LinphoneManager implements LinphoneCoreListener { throw new RuntimeException("Linphone Manager is already initialized"); instance = new LinphoneManager(c, listener); - instance.startLibLinphone(); + instance.startLibLinphone(c); TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE); boolean gsmIdle = tm.getCallState() == TelephonyManager.CALL_STATE_IDLE; setGsmIdle(gsmIdle); @@ -290,11 +255,7 @@ public final class LinphoneManager implements LinphoneCoreListener { public boolean isSpeakerOn() { - if (Hacks.needRoutingAPI() || sLPref.useAudioRoutingAPIHack()) { - return mAudioManager.getRouting(MODE_NORMAL) == ROUTE_SPEAKER; - } else { - return mAudioManager.isSpeakerphoneOn(); - } + return mLc.isSpeakerEnabled(); } @@ -447,7 +408,7 @@ public final class LinphoneManager implements LinphoneCoreListener { } - private synchronized void startLibLinphone() { + private synchronized void startLibLinphone(Context c) { try { copyAssetsFromPackage(); //traces alway start with traces enable to not missed first initialization @@ -456,6 +417,7 @@ public final class LinphoneManager implements LinphoneCoreListener { mLc = LinphoneCoreFactory.instance().createLinphoneCore( this, mLinphoneConfigFile, mLinphoneInitialConfigFile, null); + mLc.setContext(c); mLc.enableIpv6(getPrefBoolean(R.string.pref_ipv6_key, false)); mLc.setZrtpSecretsCache(basePath+"/zrtp_secrets"); @@ -1099,11 +1061,9 @@ public final class LinphoneManager implements LinphoneCoreListener { if (disableRinging ) { return; } - - if (Hacks.needGalaxySAudioHack()) { - mAudioManager.setMode(MODE_RINGTONE); - } - + + mLc.startRinging(); + try { if (mAudioManager.shouldVibrate(VIBRATE_TYPE_RINGER) && mVibrator !=null) { long[] patern = {0,1000,1000}; @@ -1178,12 +1138,6 @@ public final class LinphoneManager implements LinphoneCoreListener { return isVideoEnabled() && getPrefBoolean(R.string.pref_video_initiate_call_with_video_key, false); } - public void setAudioModeIncallForGalaxyS() { - /* The microphone gain is way too high on the Galaxy S so correct it here. */ - LinphoneManager.getLc().setMicrophoneGain(-9.0f); - mAudioManager.setMode(MODE_IN_CALL); - } - // Called on first launch only public void initializePayloads() { Log.i("Initializing supported payloads"); @@ -1233,9 +1187,6 @@ public final class LinphoneManager implements LinphoneCoreListener { } public boolean acceptCallIfIncomingPending() throws LinphoneCoreException { - if (Hacks.needGalaxySAudioHack() || sLPref.useGalaxySHack()) - setAudioModeIncallForGalaxyS(); - if (mLc.isInComingInvitePending()) { mLc.acceptCall(mLc.getCurrentCall()); return true; @@ -1244,9 +1195,6 @@ public final class LinphoneManager implements LinphoneCoreListener { } public boolean acceptCall(LinphoneCall call) { - if (Hacks.needGalaxySAudioHack() || sLPref.useGalaxySHack()) - setAudioModeIncallForGalaxyS(); - try { mLc.acceptCall(call); return true; diff --git a/submodules/linphone b/submodules/linphone index 0849cfcff..1e75dc402 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 0849cfcffa9bd30bdb30469afdfce513a86c149c +Subproject commit 1e75dc40229e1f8e6e5c6c121957722f11c03a3e From 859b54061e9146b2bca67fdf043207ca9a93e139 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 11 Dec 2012 14:48:04 +0100 Subject: [PATCH 56/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 1e75dc402..5397f98c3 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 1e75dc40229e1f8e6e5c6c121957722f11c03a3e +Subproject commit 5397f98c3ed03f05bc91fd1c18ef031d3153d1ad From eef3b793fe9fbdf176ce2818983a4f907c33a128 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 12 Dec 2012 14:23:48 +0100 Subject: [PATCH 57/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 5397f98c3..7ccb5702b 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 5397f98c3ed03f05bc91fd1c18ef031d3153d1ad +Subproject commit 7ccb5702beb76b1006535592a473632f3bea6a54 From 928560a5c1838be2ab802dee35c7e90d59e9e98a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 12 Dec 2012 15:25:54 +0100 Subject: [PATCH 58/60] Define user agent. --- src/org/linphone/LinphoneManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index d644eb306..a2c45bea5 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -85,6 +85,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; +import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.hardware.Sensor; import android.hardware.SensorEvent; @@ -418,6 +419,11 @@ public final class LinphoneManager implements LinphoneCoreListener { mLc = LinphoneCoreFactory.instance().createLinphoneCore( this, mLinphoneConfigFile, mLinphoneInitialConfigFile, null); mLc.setContext(c); + try { + mLc.setUserAgent("LinphoneAndroid", c.getPackageManager().getPackageInfo(c.getPackageName(), 0).versionName); + } catch (NameNotFoundException e) { + Log.e(e, "cannot get version name"); + } mLc.enableIpv6(getPrefBoolean(R.string.pref_ipv6_key, false)); mLc.setZrtpSecretsCache(basePath+"/zrtp_secrets"); From ac2630c9a3831107b0e8b88bf1085f98ab206d0d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 12 Dec 2012 16:53:07 +0100 Subject: [PATCH 59/60] Update linphone submodule. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 7ccb5702b..2817a36f1 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 7ccb5702beb76b1006535592a473632f3bea6a54 +Subproject commit 2817a36f1dd129278489d88acd29c2ee1f5176ff From dd9a0c507d8fca9b22a3afff9e1a584ff8a4ec7d Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 13 Dec 2012 14:51:54 +0100 Subject: [PATCH 60/60] Updated linphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 2817a36f1..4c346156c 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 2817a36f1dd129278489d88acd29c2ee1f5176ff +Subproject commit 4c346156ce89230240b5e365c1ec9b1a4f10b65a