#include "system_info/system_info_build.h"
-#include <string>
+#include <stdlib.h>
#if defined(TIZEN_MOBILE)
#include <system_info.h>
#endif
}
bool SysInfoBuild::UpdateHardware() {
- char* cptr = NULL;
- std::string hardware_info;
+ char* hardware_info = NULL;
- system_info_key_e key = SYSTEM_INFO_KEY_MODEL;
- system_info_get_value_string(key, &cptr);
-
- hardware_info.assign(cptr);
- if (hardware_info.empty()) {
+ if (system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &hardware_info)
+ != SYSTEM_INFO_ERROR_NONE)
return false;
- } else {
- model_.assign(hardware_info);
- }
- cptr = NULL;
- key = SYSTEM_INFO_KEY_MANUFACTURER;
- system_info_get_value_string(key, &cptr);
+ model_ = hardware_info;
+ free(hardware_info);
- hardware_info.assign(cptr);
- if (hardware_info.empty()) {
+ if (system_info_get_value_string(SYSTEM_INFO_KEY_MANUFACTURER, &hardware_info)
+ != SYSTEM_INFO_ERROR_NONE)
return false;
- } else {
- manufacturer_.assign(hardware_info);
- }
+
+ manufacturer_ = hardware_info;
+ free(hardware_info);
+
return true;
}
bool SysInfoBuild::UpdateOSBuild() {
- char* cptr = NULL;
- std::string build_info;
+ char* build_info = NULL;
- system_info_key_e key = SYSTEM_INFO_KEY_BUILD_STRING;
- system_info_get_value_string(key, &cptr);
-
- build_info.assign(cptr);
- if (build_info.empty()) {
+ if (system_info_get_value_string(SYSTEM_INFO_KEY_BUILD_STRING, &build_info)
+ != SYSTEM_INFO_ERROR_NONE)
return false;
- } else {
- buildversion_.assign(build_info);
- return true;
- }
+
+ buildversion_ = build_info;
+ free(build_info);
+
+ return true;
}
gboolean SysInfoBuild::OnUpdateTimeout(gpointer user_data) {
#include "system_info/system_info_locale.h"
+#include <stdlib.h>
#if defined(TIZEN_MOBILE)
#include <runtime_info.h>
#endif
-#include <string>
#include "common/picojson.h"
#include "system_info/system_info_utils.h"
}
bool SysInfoLocale::UpdateLanguage() {
- char* cptr = NULL;
- std::string language_info;
+ char* language_info = NULL;
- runtime_info_key_e key = RUNTIME_INFO_KEY_LANGUAGE;
- runtime_info_get_value_string(key, &cptr);
-
- language_info = cptr;
- if (language_info.empty()) {
+ if (runtime_info_get_value_string(RUNTIME_INFO_KEY_LANGUAGE, &language_info)
+ != RUNTIME_INFO_ERROR_NONE)
return false;
- } else {
- language_.assign(language_info);
- return true;
- }
+
+ language_ = language_info;
+ free(language_info);
+
+ return true;
}
bool SysInfoLocale::UpdateCountry() {
- char* cptr = NULL;
- std::string country_info;
+ char* country_info = NULL;
- runtime_info_key_e key = RUNTIME_INFO_KEY_REGION;
- runtime_info_get_value_string(key, &cptr);
-
- country_info = cptr;
- if (country_info.empty()) {
+ if (runtime_info_get_value_string(RUNTIME_INFO_KEY_REGION, &country_info)
+ != RUNTIME_INFO_ERROR_NONE)
return false;
- } else {
- country_.assign(country_info);
- return true;
- }
+
+ country_ = country_info;
+ free(country_info);
+
+ return true;
}
gboolean SysInfoLocale::OnUpdateTimeout(gpointer user_data) {