Commit 21447a20 authored by Simon Morlat's avatar Simon Morlat
Browse files

add privacy api in java.

parent a610adec
......@@ -2568,6 +2568,20 @@ extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_setMediaEncryption
linphone_call_params_set_media_encryption((LinphoneCallParams*)cp,(LinphoneMediaEncryption)jmenc);
}
extern "C" jint Java_org_linphone_core_LinphoneCallParamsImpl_getPrivacy(JNIEnv* env
,jobject thiz
,jlong cp
) {
return (jint)linphone_call_params_get_privacy((LinphoneCallParams*)cp);
}
extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_setPrivacy(JNIEnv* env
,jobject thiz
,jlong cp
,jint privacy) {
linphone_call_params_set_privacy((LinphoneCallParams*)cp,privacy);
}
extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_audioBandwidth(JNIEnv *env, jobject thiz, jlong lcp, jint bw){
linphone_call_params_set_audio_bandwidth_limit((LinphoneCallParams*)lcp, bw);
}
......@@ -2719,6 +2733,14 @@ extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_getExpires(JNIEnv
return linphone_proxy_config_get_expires((LinphoneProxyConfig *) ptr);
}
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setPrivacy(JNIEnv* env,jobject thiz,jlong ptr,jint privacy) {
linphone_proxy_config_set_privacy((LinphoneProxyConfig *) ptr, (int) privacy);
}
extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_getPrivacy(JNIEnv* env,jobject thiz,jlong ptr) {
return linphone_proxy_config_get_privacy((LinphoneProxyConfig *) ptr);
}
extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getDuration(JNIEnv* env,jobject thiz,jlong ptr) {
return (jint)linphone_call_get_duration((LinphoneCall *) ptr);
}
......
......@@ -93,4 +93,16 @@ public interface LinphoneCallParams {
* @return value for the header, or null if it doesn't exist.
*/
String getCustomHeader(String name);
/**
* Set the privacy for the call.
* @param privacy_mask a or'd int of values defined in interface {@link org.linphone.core.Privacy}
*/
void setPrivacy(int privacy_mask);
/**
* Get the privacy mask requested for this call.
* @return the privacy mask as defined in interface {@link org.linphone.core.Privacy}
*/
int getPrivacy();
}
......@@ -152,6 +152,19 @@ public interface LinphoneProxyConfig {
*/
int getExpires();
/**
* Set the privacy for all calls or chat sessions using the identity exposed by this LinphoneProxyConfig
* @param privacy_mask a or'd int of values defined in interface {@link org.linphone.core.Privacy}
*/
void setPrivacy(int privacy_mask);
/**
* Get the privacy mask requested for this proxy config.
* @return the privacy mask as defined in interface {@link org.linphone.core.Privacy}
*/
int getPrivacy();
/**
* Sets parameters for the contact
* @param parameters to add
......
......@@ -106,5 +106,17 @@ public class LinphoneCallParamsImpl implements LinphoneCallParams {
public String getCustomHeader(String name) {
return getCustomHeader(nativePtr,name);
}
private native void setPrivacy(long nativePtr, int mask);
@Override
public void setPrivacy(int privacy_mask) {
setPrivacy(nativePtr,privacy_mask);
}
private native int getPrivacy(long nativePtr);
@Override
public int getPrivacy() {
return getPrivacy(nativePtr);
}
}
......@@ -176,4 +176,15 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
public Reason getError() {
return Reason.fromInt(getReason(nativePtr));
}
private native void setPrivacy(long nativePtr, int mask);
@Override
public void setPrivacy(int privacy_mask) {
setPrivacy(nativePtr,privacy_mask);
}
private native int getPrivacy(long nativePtr);
@Override
public int getPrivacy() {
return getPrivacy(nativePtr);
}
}
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