diff options
author | Dongkyun Son <dongkyun.s@samsung.com> | 2024-06-19 22:16:34 +0900 |
---|---|---|
committer | Dongkyun Son <dongkyun.s@samsung.com> | 2024-06-20 14:37:12 +0900 |
commit | 631ffd2c0ac6be42c47130224b687826469efcec (patch) | |
tree | e291d13c031b6f2b284855e29149f814fa4d2346 | |
parent | 4cb7ca7a611b0f4afc7bf423628b6392e825f931 (diff) | |
download | webapi-plugins-631ffd2c0ac6be42c47130224b687826469efcec.tar.gz webapi-plugins-631ffd2c0ac6be42c47130224b687826469efcec.tar.bz2 webapi-plugins-631ffd2c0ac6be42c47130224b687826469efcec.zip |
systeminfo: handle cpu.arch and fpu.archaccepted/tizen/unified/x/asan/20240625.091843accepted/tizen/unified/x/20240620.114318accepted/tizen/unified/x/20240620.114302accepted/tizen/unified/toolchain/20240624.121247accepted/tizen/unified/dev/20240701.072809accepted/tizen/unified/20240622.072009
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>
-rw-r--r-- | src/systeminfo/systeminfo_device_capability.cc | 28 |
1 files changed, 22 insertions, 6 deletions
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<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; |