#20 - add function config_media_keys()

gitea-20
heck 7 months ago
parent 3004e0d16f
commit 694f753730

@ -2,6 +2,7 @@
#include <pEp/keymanagement.h>
#include <pEp/message_api.h>
#include <pEp/sync_api.h>
#include <pEp/media_key.h>
#include <pEp/pEpLog.hh>
#include <pEp/passphrase_cache.hh>
#include <pEp/callback_dispatcher.hh>
@ -358,6 +359,26 @@ JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1stopSync(
CallbackDispatcher::stop_sync();
}
JNIEXPORT void JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1config_1media_1keys(JNIEnv *env,
jobject obj,
jobject value)
{
std::mutex *mutex_local = nullptr;
{
std::lock_guard<std::mutex> l(global_mutex);
pEpLog("called with lock_guard");
mutex_local = get_engine_java_object_mutex(env, obj);
}
std::lock_guard<std::mutex> l(*mutex_local);
PEP_STATUS status = ::config_media_keys(Adapter::session(),to_stringpairlist(env, value));
if (status) {
throw_pEp_Exception(env, status);
}
}
JNIEXPORT jboolean JNICALL Java_foundation_pEp_jniadapter_AbstractEngine__1isSyncRunning(JNIEnv *env,
jobject obj)
{

@ -77,6 +77,19 @@ abstract class AbstractEngine extends UniquelyIdentifiable implements AbstractEn
private native void _stopSync();
public void config_media_keys(ArrayList<Pair<String, String>> value) {
if (value != null) {
ArrayList<Pair<byte[], byte[]>> list = new ArrayList<Pair<byte[], byte[]>>();
for (Pair<String, String> i : value) {
list.add(new Pair<byte[],byte[]>(Utils.toUTF8(i.first), Utils.toUTF8(i.second)));
}
_config_media_keys(list);
} else {
_config_media_keys(null);
}
}
private native void _config_media_keys(ArrayList<Pair<byte[], byte[]>> value);
public boolean isSyncRunning() {
return _isSyncRunning();

Loading…
Cancel
Save