replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / android / android_api / base / jni / JniOcResource.cpp
index 44f1eb3..9d30ba2 100644 (file)
@@ -356,6 +356,11 @@ std::string JniOcResource::sid() const
     return m_sharedResource->sid();
 }
 
+std::string JniOcResource::deviceName() const
+{
+    return m_sharedResource->deviceName();
+}
+
 JniOnGetListener* JniOcResource::addOnGetListener(JNIEnv* env, jobject jListener)
 {
     return this->m_onGetManager.addListener(env, jListener, this);
@@ -1705,6 +1710,24 @@ JNIEXPORT jstring JNICALL Java_org_iotivity_base_OcResource_getServerId
 
 /*
 * Class:     org_iotivity_base_OcResource
+* Method:    getDeviceName
+* Signature: ()Ljava/lang/String;
+*/
+JNIEXPORT jstring JNICALL Java_org_iotivity_base_OcResource_getDeviceName
+(JNIEnv *env, jobject thiz)
+{
+    LOGD("OcResource_getDeviceName");
+    JniOcResource *resource = JniOcResource::getJniOcResourcePtr(env, thiz);
+    if (!resource)
+    {
+        return nullptr;
+    }
+
+    return env->NewStringUTF(resource->deviceName().c_str());
+}
+
+/*
+* Class:     org_iotivity_base_OcResource
 * Method:    dispose
 * Signature: ()V
 */