From 010f30dae73cbc522de79f6069571351de4391d0 Mon Sep 17 00:00:00 2001 From: Jay Sharma Date: Thu, 24 Mar 2016 12:57:54 +0530 Subject: [PATCH] [Easy-Setup][IOT-1016] Fixed Jira issue. Change-Id: I2690cd69ad35fd95759cdc66361e45c84b42a7f4 Signed-off-by: Jay Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/6255 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- .../java/org/iotivity/service/easysetup/MainActivity.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/java/org/iotivity/service/easysetup/MainActivity.java b/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/java/org/iotivity/service/easysetup/MainActivity.java index b11876e..d9db11e 100755 --- a/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/java/org/iotivity/service/easysetup/MainActivity.java +++ b/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/java/org/iotivity/service/easysetup/MainActivity.java @@ -284,11 +284,13 @@ public class MainActivity extends Activity { "0.0.0.0", // bind to all available interfaces 0, QualityOfService.LOW, filePath + OIC_CLIENT_JSON_DB_FILE); - OcPlatform.Configure(cfg); try { /* * Initialize DataBase */ + + OcPlatform.Configure(cfg); + String sqlDbPath = getFilesDir().getAbsolutePath().replace("files", "databases") + File.separator; File file = new File(sqlDbPath); @@ -304,6 +306,15 @@ public class MainActivity extends Activity { } catch (OcException e) { logMessage(TAG + "provisionInit error: " + e.getMessage()); Log.e(TAG, e.getMessage()); + } catch (UnsatisfiedLinkError e) { + + // Note : Easy setup is built with SECURED = 0, but user still selects Security feature + // while running the Mediator App it couldn't find "libocprovision.so". + // As per the programmer guide, security feature should be invoked only if build is done with SECURED = 1. + Log.e(TAG, " Easy setup is built with secured = 0, but executed with security feature"); + Toast.makeText(this,"Security is not enabled [Easy setup is built with SECURED = 0]", + Toast.LENGTH_LONG).show(); + mEnableSecurity.setChecked(false); } } /** -- 2.7.4