[Mediator] Removed hard-coded Secure Flag from android application 73/5473/2
authorJay Sharma <jay.sharma@samsung.com>
Mon, 7 Mar 2016 04:21:45 +0000 (09:51 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Mon, 7 Mar 2016 06:32:01 +0000 (06:32 +0000)
- updated as per review comment in master branch

Change-Id: If4ad30f1d453aec546a9157ef6caaff87ef10b6e
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5473
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 a997505..b11876e 100755 (executable)
@@ -84,7 +84,7 @@ public class MainActivity extends Activity {
 \r
     private static final int BUFFER_SIZE = 1024;\r
     private String filePath = "";\r
-    private boolean isSecurityEnabled;\r
+    private boolean isSecurityEnabled = false;\r
     //create platform config\r
     PlatformConfig cfg;\r
 \r
@@ -383,13 +383,7 @@ public class MainActivity extends Activity {
 \r
                         mWiFiProvConfig = new WiFiProvConfig(mEnrollerSsid,\r
                                 mEnrollerPassword);\r
-\r
-                        if(isSecurityEnabled){\r
-                            mWiFiProvConfig.setSecured(true);\r
-                        }else{\r
-                            mWiFiProvConfig.setSecured(false);\r
-                        }\r
-\r
+                        mWiFiProvConfig.setSecured(isSecurityEnabled);\r
                         mDevice = mDeviceFactory\r
                                 .newEnrolleeDevice(mWiFiProvConfig);\r
                             Thread thread = new Thread() {\r
@@ -412,11 +406,7 @@ public class MainActivity extends Activity {
 \r
                         mWiFiProvConfig = new WiFiProvConfig(mEnrollerSsid,\r
                                 mEnrollerPassword);\r
-                        if(isSecurityEnabled){\r
-                            mWiFiProvConfig.setSecured(true);\r
-                        }else{\r
-                            mWiFiProvConfig.setSecured(false);\r
-                        }\r
+                        mWiFiProvConfig.setSecured(isSecurityEnabled);\r
                         mWiFiOnBoardingConfig = new WiFiOnBoardingConfig();\r
 \r
                         /*\r