[SystemInfo] getCapability refactoring
authorRafal Galka <r.galka@samsung.com>
Mon, 18 May 2015 08:28:13 +0000 (10:28 +0200)
committerRafal Galka <r.galka@samsung.com>
Mon, 18 May 2015 08:28:13 +0000 (10:28 +0200)
[Info] http://168.219.209.56/jira/browse/XWALK-258

Change-Id: I25728a7c0d69f29a57bcede66e58122bd8675644

src/systeminfo/systeminfo-utils.cpp

index 9016a97..f767ce8 100644 (file)
@@ -2744,12 +2744,12 @@ PlatformResult SystemInfoDeviceCapability::GetCapability(const std::string& key,
   bool bool_value = false ;
   bool is_fetched = false;
 
-  PlatformResult ret = CheckStringCapability(key, &value, &is_fetched);
+  PlatformResult ret = CheckBoolCapability(key, &bool_value, &is_fetched);
   if (ret.IsError()) {
     return ret;
   }
   if (is_fetched) {
-    type = "string";
+    type = "bool";
   } else {
     ret = CheckIntCapability(key, &value, &is_fetched);
     if (ret.IsError()) {
@@ -2758,12 +2758,12 @@ PlatformResult SystemInfoDeviceCapability::GetCapability(const std::string& key,
     if (is_fetched) {
       type = "int";
     } else {
-      ret = CheckBoolCapability(key, &bool_value, &is_fetched);
+      ret = CheckStringCapability(key, &value, &is_fetched);
       if (ret.IsError()) {
         return ret;
       }
       if(is_fetched) {
-        type = "bool";
+        type = "string";
       }
     }
   }