mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Update JNI one more time.
This commit is contained in:
parent
5c7159d87f
commit
480144c98f
4 changed files with 13 additions and 9 deletions
|
|
@ -3621,13 +3621,15 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_PresenceActivityImpl_setDescriptio
|
|||
/*
|
||||
* Class: org_linphone_core_PresenceServiceImpl
|
||||
* Method: newPresenceServiceImpl
|
||||
* Signature: (Ljava/lang/String;)J
|
||||
* Signature: (Ljava/lang/String;ILjava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_org_linphone_core_PresenceServiceImpl_newPresenceServiceImpl(JNIEnv *env, jobject jobj, jstring id) {
|
||||
JNIEXPORT jlong JNICALL Java_org_linphone_core_PresenceServiceImpl_newPresenceServiceImpl(JNIEnv *env, jobject jobj, jstring id, jint basic_status, jstring contact) {
|
||||
LinphonePresenceService *service;
|
||||
const char *cid = id ? env->GetStringUTFChars(id, NULL) : NULL;
|
||||
service = linphone_presence_service_new(cid);
|
||||
const char *ccontact = contact ? env->GetStringUTFChars(contact, NULL) : NULL;
|
||||
service = linphone_presence_service_new(cid, (LinphonePresenceBasicStatus)basic_status, ccontact);
|
||||
if (cid) env->ReleaseStringUTFChars(id, cid);
|
||||
if (ccontact) env->ReleaseStringUTFChars(contact, ccontact);
|
||||
return (jlong)service;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,9 +120,11 @@ abstract public class LinphoneCoreFactory {
|
|||
/**
|
||||
* Create a PresenceService object.
|
||||
* @param id The id of the presence service. Can be null to generate it automatically.
|
||||
* @param status The PresenceBasicStatus to set for the PresenceService object.
|
||||
* @param contact The contact to set for the PresenceService object. Can be null.
|
||||
* @return A new PresenceService object.
|
||||
*/
|
||||
abstract public PresenceService createPresenceService(String id);
|
||||
abstract public PresenceService createPresenceService(String id, PresenceBasicStatus status, String contact);
|
||||
|
||||
/**
|
||||
* Create a PresenceModel object.
|
||||
|
|
|
|||
|
|
@ -186,8 +186,8 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PresenceService createPresenceService(String id) {
|
||||
return new PresenceServiceImpl(id);
|
||||
public PresenceService createPresenceService(String id, PresenceBasicStatus status, String contact) {
|
||||
return new PresenceServiceImpl(id, status, contact);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ public class PresenceServiceImpl implements PresenceService {
|
|||
mNativePtr = nativePtr;
|
||||
}
|
||||
|
||||
private native long newPresenceServiceImpl(String id);
|
||||
protected PresenceServiceImpl(String id) {
|
||||
mNativePtr = newPresenceServiceImpl(id);
|
||||
private native long newPresenceServiceImpl(String id, int status, String contact);
|
||||
protected PresenceServiceImpl(String id, PresenceBasicStatus status, String contact) {
|
||||
mNativePtr = newPresenceServiceImpl(id, status.toInt(), contact);
|
||||
}
|
||||
|
||||
private native void unref(long nativePtr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue