[Easy-Setup][IOT-1016] Fixed Jira issue. 55/6255/2
authorJay Sharma <jay.sharma@samsung.com>
Thu, 24 Mar 2016 07:27:54 +0000 (12:57 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Thu, 24 Mar 2016 10:51:35 +0000 (10:51 +0000)
Change-Id: I2690cd69ad35fd95759cdc66361e45c84b42a7f4
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6255
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/java/org/iotivity/service/easysetup/MainActivity.java

index b11876e..d9db11e 100755 (executable)
@@ -284,11 +284,13 @@ public class MainActivity extends Activity {
                 "0.0.0.0", // bind to all available interfaces\r
                 0,\r
                 QualityOfService.LOW, filePath + OIC_CLIENT_JSON_DB_FILE);\r
-        OcPlatform.Configure(cfg);\r
         try {\r
             /*\r
              * Initialize DataBase\r
              */\r
+\r
+            OcPlatform.Configure(cfg);\r
+\r
             String sqlDbPath = getFilesDir().getAbsolutePath().replace("files", "databases") +\r
                     File.separator;\r
             File file = new File(sqlDbPath);\r
@@ -304,6 +306,15 @@ public class MainActivity extends Activity {
         } catch (OcException e) {\r
             logMessage(TAG + "provisionInit error: " + e.getMessage());\r
             Log.e(TAG, e.getMessage());\r
+        } catch (UnsatisfiedLinkError e) {\r
+\r
+           // Note : Easy setup is built with SECURED = 0, but user still selects Security feature\r
+           // while running the Mediator App it couldn't find "libocprovision.so".\r
+           // As per the programmer guide, security feature should be invoked only if build is done with SECURED = 1.\r
+            Log.e(TAG, " Easy setup is built with secured  = 0, but executed with security feature");\r
+            Toast.makeText(this,"Security is not enabled [Easy setup is built with SECURED = 0]",\r
+                                                                   Toast.LENGTH_LONG).show();\r
+            mEnableSecurity.setChecked(false);\r
         }\r
     }\r
     /**\r