Browse Source

pEpLog() function call logging only on API exposed functions (JNIEPXORT)

sync
heck 5 years ago
parent
commit
7956b4037c
  1. 13
      src/foundation_pEp_jniadapter_AbstractEngine.cc

13
src/foundation_pEp_jniadapter_AbstractEngine.cc

@ -39,7 +39,6 @@ class JNISync {
public: public:
JNIEnv * env() JNIEnv * env()
{ {
pEpLog("called");
JNIEnv *thread_env = nullptr; JNIEnv *thread_env = nullptr;
int status = jvm->GetEnv((void**)&thread_env, JNI_VERSION_1_6); int status = jvm->GetEnv((void**)&thread_env, JNI_VERSION_1_6);
if (status < 0) { if (status < 0) {
@ -55,19 +54,16 @@ public:
void onSyncStartup() void onSyncStartup()
{ {
pEpLog("called");
env(); env();
} }
void onSyncShutdown() void onSyncShutdown()
{ {
pEpLog("called");
jvm->DetachCurrentThread(); jvm->DetachCurrentThread();
} }
} o; } o;
void jni_init() { void jni_init() {
pEpLog("called");
JNIEnv *_env = o.env(); JNIEnv *_env = o.env();
messageClass = reinterpret_cast<jclass>( messageClass = reinterpret_cast<jclass>(
@ -99,10 +95,9 @@ void jni_init() {
PEP_STATUS messageToSend(message *msg) PEP_STATUS messageToSend(message *msg)
{ {
pEpLog("called");
std::lock_guard<std::mutex> l(mutex_obj); std::lock_guard<std::mutex> l(mutex_obj);
pEpLog("############### messageToSend() called"); pEpLog("############### messageToSend() called");
jobject msg_ = nullptr; jobject msg_ = nullptr;
assert(messageClass && messageConstructorMethodID && obj && messageToSendMethodID); assert(messageClass && messageConstructorMethodID && obj && messageToSendMethodID);
@ -122,10 +117,9 @@ PEP_STATUS messageToSend(message *msg)
PEP_STATUS notifyHandshake(pEp_identity *me, pEp_identity *partner, sync_handshake_signal signal) PEP_STATUS notifyHandshake(pEp_identity *me, pEp_identity *partner, sync_handshake_signal signal)
{ {
pEpLog("called");
std::lock_guard<std::mutex> l(mutex_obj); std::lock_guard<std::mutex> l(mutex_obj);
pEpLog("############### notifyHandshake() called"); pEpLog("############### notifyHandshake() called");
jobject me_ = nullptr; jobject me_ = nullptr;
jobject partner_ = nullptr; jobject partner_ = nullptr;
@ -219,7 +213,6 @@ JNIEXPORT jstring JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_getProto
int examine_identity(pEp_identity *ident, void *arg) int examine_identity(pEp_identity *ident, void *arg)
{ {
pEpLog("called");
locked_queue< pEp_identity * > *queue = (locked_queue< pEp_identity * > *) arg; locked_queue< pEp_identity * > *queue = (locked_queue< pEp_identity * > *) arg;
queue->push_back(identity_dup(ident)); queue->push_back(identity_dup(ident));
return 0; return 0;
@ -240,7 +233,6 @@ pEp_identity *retrieve_next_identity(void *arg)
static void *keyserver_thread_routine(void *arg) static void *keyserver_thread_routine(void *arg)
{ {
pEpLog("called");
PEP_STATUS status = do_keymanagement(retrieve_next_identity, arg); PEP_STATUS status = do_keymanagement(retrieve_next_identity, arg);
locked_queue< pEp_identity * > *queue = (locked_queue< pEp_identity * > *) arg; locked_queue< pEp_identity * > *queue = (locked_queue< pEp_identity * > *) arg;
@ -333,7 +325,6 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine_startSync(
jobject me jobject me
) )
{ {
pEpLog("called");
pEpLog("######## starting sync"); pEpLog("######## starting sync");
try { try {
Adapter::startup<JNISync>(messageToSend, notifyHandshake, &o, &JNISync::onSyncStartup, &JNISync::onSyncShutdown); Adapter::startup<JNISync>(messageToSend, notifyHandshake, &o, &JNISync::onSyncStartup, &JNISync::onSyncShutdown);

Loading…
Cancel
Save