Add JNI method for user data in call

and proxy config
This commit is contained in:
Margaux Clerc 2014-07-23 14:58:12 +02:00
parent b2132d4d8a
commit 8b99a4c074
4 changed files with 40 additions and 14 deletions

View file

@ -323,4 +323,14 @@ public interface LinphoneCall {
*/
ErrorInfo getErrorInfo();
/**
* attached a user data to a call
**/
void setUserData(Object obj);
/**
* Returns user data from a call. return null if any
* @return an Object.
*/
Object getUserData();
}

View file

@ -25,9 +25,6 @@ package org.linphone.core;
*/
public interface LinphoneProxyConfig {
public void setIsDeleted(boolean b);
public boolean getIsDeleted();
/**
*Starts editing a proxy configuration.
*Because proxy configuration must be consistent, applications MUST call {@link #edit()} before doing any attempts to modify proxy configuration (such as identity, proxy address and so on).
@ -290,4 +287,15 @@ public interface LinphoneProxyConfig {
* @return the publish expiration time in second. Default value is the registration expiration value.
*/
public int getPublishExpires();
/**
* attached a user data to a proxy config
**/
void setUserData(Object obj);
/**
* Returns user data from a proxy config. return null if any
* @return an Object.
*/
Object getUserData();
}

View file

@ -22,6 +22,7 @@ class LinphoneCallImpl implements LinphoneCall {
protected final long nativePtr;
boolean ownPtr = false;
Object userData;
private LinphoneCallStats audioStats;
private LinphoneCallStats videoStats;
@ -236,4 +237,12 @@ class LinphoneCallImpl implements LinphoneCall {
public ErrorInfo getErrorInfo() {
return new ErrorInfoImpl(getErrorInfo(nativePtr));
}
@Override
public void setUserData(Object obj) {
userData = obj;
}
@Override
public Object getUserData() {
return userData;
}
}

View file

@ -24,8 +24,7 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
protected long nativePtr;
protected LinphoneCoreImpl mCore;
protected boolean isDeleting;
Object userData;
private native int getState(long nativePtr);
private native void setExpires(long nativePtr, int delay);
private native int getExpires(long nativePtr);
@ -36,7 +35,6 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
setIdentity(identity);
setProxy(proxy);
setRoute(route);
setIsDeleted(false);
enableRegister(enableRegister);
ownPtr=true;
}
@ -52,14 +50,6 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
ownPtr=false;
}
public boolean getIsDeleted() {
return isDeleting;
}
public void setIsDeleted(boolean b) {
isDeleting = b;
}
private void isValid() {
if (nativePtr == 0) {
throw new RuntimeException("proxy config removed");
@ -357,4 +347,13 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
isValid();
return getPublishExpires(nativePtr);
}
@Override
public void setUserData(Object obj) {
userData = obj;
}
@Override
public Object getUserData() {
return userData;
}
}