[IOT-1324] Fix crash issue which call getPlatformInfo with QoS.
authorjihwan.seo <jihwan.seo@samsung.com>
Tue, 27 Sep 2016 09:52:13 +0000 (18:52 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Wed, 28 Sep 2016 05:13:56 +0000 (05:13 +0000)
The Listener for getPlatformInfo with QoS used DeviceInfoListener.
So, it replace with PlatformInfoListener.
(it was occurred in Android Platform)

Change-Id: Ia9f0530465267a6f338dc67ba42a8c5b396271ef
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12293
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
android/android_api/base/jni/JniOcPlatform.cpp

index 5f0faa5..6b03638 100644 (file)
@@ -1441,12 +1441,12 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcPlatform_getPlatformInfo1(
         ThrowOcException(OC_STACK_INVALID_PARAM, "onPlatformFoundListener cannot be null");
         return;
     }
-    JniOnDeviceInfoListener *onDeviceInfoListener = AddOnDeviceInfoListener(env, jListener);
+    JniOnPlatformInfoListener *onPlatformInfoListener = AddOnPlatformInfoListener(env, jListener);
 
-    FindDeviceCallback findDeviceCallback =
-        [onDeviceInfoListener](const OCRepresentation& ocRepresentation)
+    FindPlatformCallback findPlatformCallback =
+        [onPlatformInfoListener](const OCRepresentation& ocRepresentation)
         {
-            onDeviceInfoListener->foundDeviceCallback(ocRepresentation);
+            onPlatformInfoListener->foundPlatformCallback(ocRepresentation);
         };
 
     try
@@ -1455,7 +1455,7 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcPlatform_getPlatformInfo1(
             host,
             resourceUri,
             static_cast<OCConnectivityType>(jConnectivityType),
-            findDeviceCallback,
+            findPlatformCallback,
             JniUtils::getQOS(env, static_cast<int>(jQoS)));
 
         if (OC_STACK_OK != result)