From: Joohyun Kim Date: Wed, 21 Aug 2013 02:52:39 +0000 (+0900) Subject: Add screen feature on SystemInfo X-Git-Tag: accepted/tizen/20130912.081851^2~10^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74983dafd48d22aee25deacf928144afe098e186;p=platform%2Fframework%2Fnative%2Fappfw.git Add screen feature on SystemInfo Change-Id: I760eb0b746f9601cc82d5886be6974ba909df241 Signed-off-by: Joohyun Kim --- diff --git a/src/system/FSys_SystemInfoImpl.cpp b/src/system/FSys_SystemInfoImpl.cpp index 1baa395..ab9285b 100644 --- a/src/system/FSys_SystemInfoImpl.cpp +++ b/src/system/FSys_SystemInfoImpl.cpp @@ -501,9 +501,9 @@ CATCH: unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); r = GetLastResult(); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); - int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); - SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); r = StringUtil::Utf8ToString(pStringValue, value); free(pStringValue); @@ -568,9 +568,9 @@ _SystemInfoImpl::GetSysInfo(const String& key, int& value) unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); r = GetLastResult(); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); - ret = system_info_get_platform_int(systemKey.get(), &value); - SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + ret = system_info_get_platform_int(systemKey.get(), &value); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); r = E_SUCCESS; } } @@ -630,7 +630,19 @@ _SystemInfoImpl::GetSysInfo(const String& key, bool& value) bool supported = false; int ret = system_info_get_platform_bool(systemKey.get(), &supported); - SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + if(ret != SYSTEM_INFO_ERROR_NONE) + { + String screenKey(L"http://tizen.org/feature/screen.size"); + String requiredKey; + tizenKey.SubString(0, screenKey.GetLength(), requiredKey); + + if(requiredKey == screenKey) + { + value = false; + } + } + + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); value = supported; r = E_SUCCESS; } @@ -675,9 +687,9 @@ _SystemInfoImpl::GetPlatformVersion(String& platformVersion) unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); r = GetLastResult(); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); - int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); - SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); r = StringUtil::Utf8ToString(pStringValue, platformVersion); free(pStringValue); @@ -705,9 +717,9 @@ _SystemInfoImpl::GetBuildInfo(String& buildInfo) unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); r = GetLastResult(); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); - int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); - SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); r = StringUtil::Utf8ToString(pStringValue, buildInfo); free(pStringValue); @@ -735,9 +747,9 @@ _SystemInfoImpl::GetNativeApiVersion(String& nativeApiVersion) unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); r = GetLastResult(); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); - int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); - SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); r = StringUtil::Utf8ToString(pStringValue, nativeApiVersion); free(pStringValue); @@ -765,9 +777,9 @@ _SystemInfoImpl::GetWebApiVersion(String& webApiVersion) unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tKey)); r = GetLastResult(); SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r)); - int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); - SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); + int ret = system_info_get_platform_string(systemKey.get(), &pStringValue); + SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", tizenKey.GetPointer()); r = StringUtil::Utf8ToString(pStringValue, webApiVersion); free(pStringValue);