mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-23 22:28:07 +00:00
JNI wrapper for lime methods
This commit is contained in:
parent
5dc6c5cb10
commit
d3e8feeb60
3 changed files with 78 additions and 0 deletions
|
|
@ -2475,6 +2475,27 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setMediaEncryptionMandat
|
|||
linphone_core_set_media_encryption_mandatory((LinphoneCore*)lc, yesno);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isLimeEncryptionAvailable (JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
) {
|
||||
return (jboolean) linphone_core_lime_available((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getLimeEncryption(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
) {
|
||||
return (jint)linphone_core_lime_enabled((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setLimeEncryption(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
,jint menc) {
|
||||
linphone_core_enable_lime((LinphoneCore*)lc,(LinphoneLimeState)menc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_linphone_core_LinphoneCoreImpl
|
||||
* Method: disableChat
|
||||
|
|
|
|||
|
|
@ -561,6 +561,42 @@ public interface LinphoneCore {
|
|||
return mStringValue;
|
||||
}
|
||||
}
|
||||
static public final class LinphoneLimeState {
|
||||
|
||||
static private Vector<LinphoneLimeState> values = new Vector<LinphoneLimeState>();
|
||||
/**
|
||||
* Disabled
|
||||
*/
|
||||
static public final LinphoneLimeState Disabled = new LinphoneLimeState(0, "None");
|
||||
/**
|
||||
* Mandatory
|
||||
*/
|
||||
static public final LinphoneLimeState Mandatory = new LinphoneLimeState(1,"Mandatory");
|
||||
/**
|
||||
* Preferred
|
||||
*/
|
||||
static public final LinphoneLimeState Preferred = new LinphoneLimeState(2,"Preferred");
|
||||
protected final int mValue;
|
||||
private final String mStringValue;
|
||||
|
||||
|
||||
private LinphoneLimeState(int value, String stringValue) {
|
||||
mValue = value;
|
||||
values.addElement(this);
|
||||
mStringValue = stringValue;
|
||||
}
|
||||
public static LinphoneLimeState fromInt(int value) {
|
||||
|
||||
for (int i=0; i<values.size();i++) {
|
||||
LinphoneLimeState menc = (LinphoneLimeState) values.elementAt(i);
|
||||
if (menc.mValue == value) return menc;
|
||||
}
|
||||
throw new RuntimeException("LinphoneLimeState not found ["+value+"]");
|
||||
}
|
||||
public String toString() {
|
||||
return mStringValue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the context of creation of the LinphoneCore.
|
||||
|
|
@ -2340,4 +2376,10 @@ public interface LinphoneCore {
|
|||
* @param path The path from where plugins are to be loaded.
|
||||
**/
|
||||
public void reloadMsPlugins(String path);
|
||||
|
||||
public boolean isLimeEncryptionAvailable();
|
||||
|
||||
public void setLimeEncryption(LinphoneLimeState lime);
|
||||
|
||||
public LinphoneLimeState getLimeEncryption();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1678,4 +1678,19 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
public void reloadMsPlugins(String path) {
|
||||
reloadMsPlugins(nativePtr, path);
|
||||
}
|
||||
|
||||
private native boolean isLimeEncryptionAvailable(long nativePtr);
|
||||
public synchronized boolean isLimeEncryptionAvailable() {
|
||||
return isLimeEncryptionAvailable(nativePtr);
|
||||
}
|
||||
|
||||
private native void setLimeEncryption(long nativePtr, int value);
|
||||
public synchronized void setLimeEncryption(LinphoneLimeState lime) {
|
||||
setLimeEncryption(nativePtr, lime.mValue);
|
||||
}
|
||||
|
||||
private native int getLimeEncryption(long nativePtr);
|
||||
public synchronized LinphoneLimeState getLimeEncryption() {
|
||||
return LinphoneLimeState.fromInt(getLimeEncryption(nativePtr));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue