From: Dongkyun Son Date: Wed, 19 Jun 2024 13:16:34 +0000 (+0900) Subject: systeminfo: handle cpu.arch and fpu.arch X-Git-Tag: accepted/tizen/unified/x/20240620.114302^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=631ffd2c0ac6be42c47130224b687826469efcec;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git systeminfo: handle cpu.arch and fpu.arch report cpu.arch & fpu.arch in case there is no cpu.arch.* / fpu.arch.* Change-Id: Ica5936c0be979cf2fad514046892615d52291ed0 Signed-off-by: Dongkyun Son --- diff --git a/src/systeminfo/systeminfo_device_capability.cc b/src/systeminfo/systeminfo_device_capability.cc index 2b8b9e40..78cefc0e 100644 --- a/src/systeminfo/systeminfo_device_capability.cc +++ b/src/systeminfo/systeminfo_device_capability.cc @@ -261,10 +261,10 @@ PlatformResult SystemInfoDeviceCapability::GetCapability(const std::string& key, ScopeLogger(); picojson::object& result_obj = result->get(); - 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;