Browse Source

Add getRating to pEp Identity.

JNI-88
Hussein Kasem 6 years ago
parent
commit
5a9e390936
  1. 1
      android/jni/Android.mk
  2. 8
      src/foundation/pEp/jniadapter/Identity.java
  3. 14
      src/identity_api.cc

1
android/jni/Android.mk

@ -51,6 +51,7 @@ LOCAL_SRC_FILES := \
../../src/foundation_pEp_jniadapter_Message.cc \
../../src/throw_pEp_exception.cc \
../../src/basic_api.cc \
../../src/identity_api.cc \
../../src/jniutils.cc
LOCAL_C_INCLUDES += $(GPGBUILD)/$(TARGET_ARCH_ABI)/app_opt/include

8
src/foundation/pEp/jniadapter/Identity.java

@ -38,5 +38,13 @@ public class Identity implements Serializable{
return address + "::" + username + "\n" +
user_id + "::" + fpr;
}
// Native
private native int _getRating(int commType);
public Rating getRating() {
return Rating.getByInt(_getRating(comm_type.value));
}
}

14
src/identity_api.cc

@ -0,0 +1,14 @@
#include <pEp/message_api.h>
#include "jniutils.hh"
extern "C" {
JNIEXPORT jint JNICALL
Java_foundation_pEp_jniadapter_Identity__1getRating(JNIEnv *env, jobject thiz, jint comm_type) {
return ::rating_from_comm_type((PEP_comm_type) comm_type);
}
} // extern "C"
Loading…
Cancel
Save