systeminfo: handle cpu.arch and fpu.arch 67/313167/3 accepted/tizen/unified/20240622.072009 accepted/tizen/unified/dev/20240701.072809 accepted/tizen/unified/toolchain/20240624.121247 accepted/tizen/unified/x/20240620.114302 accepted/tizen/unified/x/20240620.114318 accepted/tizen/unified/x/asan/20240625.091843
authorDongkyun Son <dongkyun.s@samsung.com>
Wed, 19 Jun 2024 13:16:34 +0000 (22:16 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Thu, 20 Jun 2024 05:37:12 +0000 (14:37 +0900)
report cpu.arch & fpu.arch in case there is no cpu.arch.* / fpu.arch.*

Change-Id: Ica5936c0be979cf2fad514046892615d52291ed0
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
src/systeminfo/systeminfo_device_capability.cc

index 2b8b9e40082e3a40082e82f0e61583bb468ded69..78cefc0e2c2132ed4671dfe574e0424615c7f6c3 100644 (file)
@@ -261,10 +261,10 @@ PlatformResult SystemInfoDeviceCapability::GetCapability(const std::string& key,
   ScopeLogger();
   picojson::object& result_obj = result->get<picojson::object>();
 
-  std::string type = "";
+  std::string type;
   bool bool_value = false;
   int int_value = 0;
-  std::string string_value = "";
+  std::string string_value;
 
   system_info_type_e capability_type = SYSTEM_INFO_BOOL;
 
@@ -310,7 +310,7 @@ PlatformResult SystemInfoDeviceCapability::GetCapability(const std::string& key,
 
 PlatformResult SystemInfoDeviceCapability::IsInputKeyboardLayout(bool* result) {
   ScopeLogger();
-  std::string input_keyboard_layout = "";
+  std::string input_keyboard_layout;
   PlatformResult ret =
       GetValueStringNative("tizen.org/feature/input.keyboard.layout", &input_keyboard_layout);
   if (ret.IsError()) {
@@ -342,7 +342,7 @@ PlatformResult SystemInfoDeviceCapability::GetOpenglesTextureFormat(std::string*
     std::string log_msg = "OpenGL-ES is not supported";
     return LogAndCreateResult(ErrorCode::NOT_SUPPORTED_ERR, log_msg);
   }
-  std::string texture_format = "";
+  std::string texture_format;
 
   ret = GetValueBoolNative("tizen.org/feature/opengles.texture_format.utc", &bool_result);
   if (ret.IsError()) {
@@ -417,7 +417,7 @@ PlatformResult SystemInfoDeviceCapability::GetPlatfomCoreCpuArch(std::string* re
   ScopeLogger();
   std::string result;
   bool bool_result = false;
-  std::string arch = "";
+  std::string arch;
 
   PlatformResult ret = GetValueBoolNative("tizen.org/feature/platform.core.cpu.arch.riscv64", &bool_result);
   if (ret.IsError()) {
@@ -493,6 +493,10 @@ PlatformResult SystemInfoDeviceCapability::GetPlatfomCoreCpuArch(std::string* re
     }
   }
 
+  if (result.empty() && !arch.empty()) {
+      result = arch;
+  }
+
   if (result.empty()) {
     return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "platformCoreCpuArch result is empty");
   }
@@ -504,6 +508,8 @@ PlatformResult SystemInfoDeviceCapability::GetPlatfomCoreFpuArch(std::string* re
   ScopeLogger();
   std::string result;
   bool bool_result = false;
+  std::string fpu_arch;
+
   PlatformResult ret =
       GetValueBoolNative("tizen.org/feature/platform.core.fpu.arch.sse2", &bool_result);
   if (ret.IsError()) {
@@ -513,6 +519,11 @@ PlatformResult SystemInfoDeviceCapability::GetPlatfomCoreFpuArch(std::string* re
     result = kPlatformCoreSse2;
   }
 
+  ret = GetValueStringNative("tizen.org/feature/platform.core.fpu.arch", &fpu_arch);
+  if (ret.IsError()) {
+    LoggerE("GetValueStringNative Error");
+  }
+
   ret = GetValueBoolNative("tizen.org/feature/platform.core.fpu.arch.sse3", &bool_result);
   if (ret.IsError()) {
     return ret;
@@ -567,6 +578,11 @@ PlatformResult SystemInfoDeviceCapability::GetPlatfomCoreFpuArch(std::string* re
     }
     result += kPlatformCoreVfpv4;
   }
+
+  if (result.empty() && !fpu_arch.empty()) {
+      result = fpu_arch;
+  }
+
   if (result.empty()) {
     return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "platformCoreFpuArch result is empty");
   }
@@ -576,7 +592,7 @@ PlatformResult SystemInfoDeviceCapability::GetPlatfomCoreFpuArch(std::string* re
 
 PlatformResult SystemInfoDeviceCapability::GetProfile(std::string* return_value) {
   ScopeLogger();
-  std::string profile = "";
+  std::string profile;
   PlatformResult ret = GetValueStringNative("tizen.org/feature/profile", &profile);
   if (ret.IsError()) {
     return ret;