Commit de2e98bd authored by Sylvain Berfini's avatar Sylvain Berfini

Added ClearException in jni layer to prevent crash when listener doesn't...

Added ClearException in jni layer to prevent crash when listener doesn't implement all callbacks + reworked linphonecorelistener
parent 6045f50d
......@@ -34,7 +34,7 @@ import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.core.LinphoneCore.RemoteProvisioningState;
import org.linphone.core.LinphoneCoreException;
import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneCoreListener;
import org.linphone.core.LinphoneCoreListener.LinphoneListener;
import org.linphone.core.LinphoneEvent;
import org.linphone.core.LinphoneFriend;
import org.linphone.core.LinphoneFriend.SubscribePolicy;
......@@ -60,7 +60,7 @@ import org.linphone.core.SubscriptionState;
* @author Guillaume Beraudo
*
*/
public class TutorialBuddyStatus implements LinphoneCoreListener {
public class TutorialBuddyStatus implements LinphoneListener {
private boolean running;
private TutorialNotifier TutorialNotifier;
......
......@@ -34,7 +34,7 @@ import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.core.LinphoneCore.RemoteProvisioningState;
import org.linphone.core.LinphoneCoreException;
import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneCoreListener;
import org.linphone.core.LinphoneCoreListener.LinphoneListener;
import org.linphone.core.LinphoneEvent;
import org.linphone.core.LinphoneFriend;
import org.linphone.core.LinphoneInfoMessage;
......@@ -58,7 +58,7 @@ import org.linphone.core.SubscriptionState;
* @author Guillaume Beraudo
*
*/
public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessage.StateListener {
public class TutorialChatRoom implements LinphoneListener, LinphoneChatMessage.StateListener {
private boolean running;
private TutorialNotifier TutorialNotifier;
......
......@@ -22,23 +22,23 @@ import java.nio.ByteBuffer;
import org.linphone.core.LinphoneAddress;
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.LinphoneContent;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCore.EcCalibratorStatus;
import org.linphone.core.LinphoneCore.GlobalState;
import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.core.LinphoneCore.RemoteProvisioningState;
import org.linphone.core.LinphoneCoreException;
import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneCoreListener;
import org.linphone.core.LinphoneCoreListener.LinphoneListener;
import org.linphone.core.LinphoneEvent;
import org.linphone.core.LinphoneFriend;
import org.linphone.core.LinphoneInfoMessage;
import org.linphone.core.LinphoneProxyConfig;
import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCore.GlobalState;
import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.core.PublishState;
import org.linphone.core.SubscriptionState;
......@@ -52,7 +52,7 @@ import org.linphone.core.SubscriptionState;
* @author Guillaume Beraudo
*
*/
public class TutorialHelloWorld implements LinphoneCoreListener {
public class TutorialHelloWorld implements LinphoneListener {
private boolean running;
private TutorialNotifier TutorialNotifier;
......
......@@ -34,7 +34,7 @@ import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.core.LinphoneCore.RemoteProvisioningState;
import org.linphone.core.LinphoneCoreException;
import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneCoreListener;
import org.linphone.core.LinphoneCoreListener.LinphoneListener;
import org.linphone.core.LinphoneEvent;
import org.linphone.core.LinphoneFriend;
import org.linphone.core.LinphoneInfoMessage;
......@@ -57,7 +57,7 @@ import org.linphone.core.SubscriptionState;
* @author Guillaume Beraudo
*
*/
public class TutorialRegistration implements LinphoneCoreListener {
public class TutorialRegistration implements LinphoneListener {
private boolean running;
private TutorialNotifier TutorialNotifier;
......
This diff is collapsed.
......@@ -1787,4 +1787,16 @@ public interface LinphoneCore {
* @return An object that implement LinphonePlayer
*/
public LinphonePlayer createLocalPlayer(AndroidVideoWindowImpl window);
/**
* Adds a new listener to be called by the core
* @param listener to add
*/
public void addListener(LinphoneCoreListener listener);
/**
* Removes a listener previously added with addListener
* @param listener to remove
*/
public void removeListener(LinphoneCoreListener listener);
}
......@@ -1291,4 +1291,16 @@ class LinphoneCoreImpl implements LinphoneCore {
return null;
}
}
private native void addListener(long nativePtr, LinphoneCoreListener listener);
@Override
public void addListener(LinphoneCoreListener listener) {
addListener(nativePtr, listener);
}
private native void removeListener(long nativePtr, LinphoneCoreListener listener);
@Override
public void removeListener(LinphoneCoreListener listener) {
removeListener(nativePtr, listener);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment