X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fresource-encapsulation%2Fandroid%2Fservice%2Fsrc%2Fmain%2Fjni%2FJniRcsLockedAttributes.cpp;h=ad05590e5e88e1a53d06dcd2a92af36163a3e036;hb=390866079e285d2c74918432c0d597d5da52f8a0;hp=98273c93d647600e956cecaa530f626b7624936a;hpb=3e9402ad71cb3e93266a77796f44d17bab9853fd;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/resource-encapsulation/android/service/src/main/jni/JniRcsLockedAttributes.cpp b/service/resource-encapsulation/android/service/src/main/jni/JniRcsLockedAttributes.cpp index 98273c9..ad05590 100644 --- a/service/resource-encapsulation/android/service/src/main/jni/JniRcsLockedAttributes.cpp +++ b/service/resource-encapsulation/android/service/src/main/jni/JniRcsLockedAttributes.cpp @@ -25,6 +25,7 @@ #include "JniRcsValue.h" #include "Log.h" #include "Verify.h" +#include "JavaExceptions.h" #include "RCSResourceObject.h" @@ -153,7 +154,15 @@ Java_org_iotivity_service_server_RcsLockedAttributes_nativeApply auto res = getResource(env, resourceObject); VERIFY_NO_EXC(env); - writeNativeAttributesFromMap(env, cacheObj, res->getAttributes()); + try + { + RCSResourceObject::LockGuard lock(res); + writeNativeAttributesFromMap(env, cacheObj, res->getAttributes()); + } + catch (const RCSPlatformException& e) + { + throwPlatformException(env, e); + } } JNIEXPORT void JNICALL @@ -163,7 +172,8 @@ Java_org_iotivity_service_server_RcsLockedAttributes_nativeLock auto res = getResource(env, resourceObject); VERIFY_NO_EXC(env); - setSafeNativeHandle< RCSResourceObject::LockGuard >(env, obj, res); + setSafeNativeHandle< RCSResourceObject::LockGuard >(env, obj, + res, RCSResourceObject::AutoNotifyPolicy::NEVER); } JNIEXPORT void JNICALL