[Mediator] Removed hard-coded Secure Flag from android application
authorlankamadan <lanka.madan@samsung.com>
Mon, 7 Mar 2016 04:46:53 +0000 (13:46 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Tue, 8 Mar 2016 00:43:20 +0000 (00:43 +0000)
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5441
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
(cherry picked from commit 815da513484596845e08fb0ac80346930b662343)

Change-Id: Ifa96ff1d2a2a3e11a2916755495af2c32106d79e
Signed-off-by: lankamadan <lanka.madan@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5449
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/java/org/iotivity/service/easysetup/MainActivity.java

index 3735dc3378d11a7c4423022f2eeca1ea82636016..b11876e7262149940e6d5ffd4af31c0030c5099e 100755 (executable)
@@ -84,6 +84,7 @@ public class MainActivity extends Activity {
 \r
     private static final int BUFFER_SIZE = 1024;\r
     private String filePath = "";\r
+    private boolean isSecurityEnabled = false;\r
     //create platform config\r
     PlatformConfig cfg;\r
 \r
@@ -234,7 +235,7 @@ public class MainActivity extends Activity {
             @Override\r
             public void onClick(View v) {\r
                 filePath = getFilesDir().getPath() + "/";\r
-\r
+                isSecurityEnabled = true;\r
                 //copy json when application runs first time\r
                 SharedPreferences wmbPreference = PreferenceManager.getDefaultSharedPreferences\r
                         (getApplicationContext());\r
@@ -382,7 +383,7 @@ public class MainActivity extends Activity {
 \r
                         mWiFiProvConfig = new WiFiProvConfig(mEnrollerSsid,\r
                                 mEnrollerPassword);\r
-                        mWiFiProvConfig.setSecured(true);\r
+                        mWiFiProvConfig.setSecured(isSecurityEnabled);\r
                         mDevice = mDeviceFactory\r
                                 .newEnrolleeDevice(mWiFiProvConfig);\r
                             Thread thread = new Thread() {\r
@@ -405,7 +406,7 @@ public class MainActivity extends Activity {
 \r
                         mWiFiProvConfig = new WiFiProvConfig(mEnrollerSsid,\r
                                 mEnrollerPassword);\r
-                        mWiFiProvConfig.setSecured(true);\r
+                        mWiFiProvConfig.setSecured(isSecurityEnabled);\r
                         mWiFiOnBoardingConfig = new WiFiOnBoardingConfig();\r
 \r
                         /*\r