#include <string.h>
#include <unistd.h>
-#include <vconf.h>
#include <dlog.h>
#include <system_info.h>
},
{
- /**< Indicates whether the device supports TV-out */
- SYSTEM_INFO_KEY_TVOUT_SUPPORTED,
- SYSTEM_INFO_DATA_TYPE_BOOL,
- system_info_get_tvout_supported
-},
-
-{
/**< Indicates whether the device supports Wi-Fi */
SYSTEM_INFO_KEY_WIFI_SUPPORTED,
SYSTEM_INFO_DATA_TYPE_BOOL,
},
{
- /**< The unique ID to identify GSM, and UMTS mobile devices */
- SYSTEM_INFO_KEY_MOBILE_DEVICE_ID,
- SYSTEM_INFO_DATA_TYPE_STRING,
- system_info_get_mobile_device_id
-},
-
-{
- /**< The sales code of the CSC */
- SYSTEM_INFO_KEY_CSC_SALES_CODE,
- SYSTEM_INFO_DATA_TYPE_STRING,
- system_info_get_csc_sales_code
-},
-
-{
/**< The Name of the Platform */
SYSTEM_INFO_KEY_PLATFORM_NAME,
SYSTEM_INFO_DATA_TYPE_STRING,
},
{
- /**< Indicates whether the device supports HAPTIC */
- SYSTEM_INFO_KEY_HAPTIC_SUPPORTED,
- SYSTEM_INFO_DATA_TYPE_BOOL,
- system_info_get_haptic_supproted
-},
-
-{
- /**< Indicates whether the device supports HAPTIC */
+ /**< Indicates whether the device supports wifi direct */
SYSTEM_INFO_KEY_WIFI_DIRECT_SUPPORTED,
SYSTEM_INFO_DATA_TYPE_BOOL,
system_info_get_wifi_direct_supported
},
{
- /**< The Device unique ID to identify */
- SYSTEM_INFO_KEY_DEVICE_UUID,
- SYSTEM_INFO_DATA_TYPE_STRING,
- system_info_get_device_uuid
-},
-
-{
- /**< Indicates whether the device supports GPS */
- SYSTEM_INFO_KEY_CPS_SUPPORTED,
- SYSTEM_INFO_DATA_TYPE_BOOL,
- system_info_get_cps_supported
-},
-
-{
/**< Indicates whether the device supports GPS */
SYSTEM_INFO_KEY_WPS_SUPPORTED,
SYSTEM_INFO_DATA_TYPE_BOOL,
},
{
- /**< Indicates whether the device supports front camera auto focus */
- SYSTEM_INFO_KEY_FRONT_CAMERA_AF_SUPPORTED,
- SYSTEM_INFO_DATA_TYPE_BOOL,
- system_info_get_front_camera_af_supported
-},
-
-{
/**< Indicates whether the device supports front camera flash */
SYSTEM_INFO_KEY_FRONT_CAMERA_FLASH_SUPPORTED,
SYSTEM_INFO_DATA_TYPE_BOOL,
},
{
- /**< Indicates whether the device supports back camera auto focus */
- SYSTEM_INFO_KEY_BACK_CAMERA_AF_SUPPORTED,
- SYSTEM_INFO_DATA_TYPE_BOOL,
- system_info_get_back_camera_af_supported
-},
-
-{
/**< Indicates whether the device supports back camera flash */
SYSTEM_INFO_KEY_BACK_CAMERA_FLASH_SUPPORTED,
SYSTEM_INFO_DATA_TYPE_BOOL,
},
{
- /**< The method of interface with CP */
- SYSTEM_INFO_KEY_CP_INTERFACE,
- SYSTEM_INFO_DATA_TYPE_STRING,
- system_info_get_cp_interface
-},
-
-{
/**< Indicates whether the device supports MMS */
SYSTEM_INFO_KEY_MMS_SUPPORTED,
SYSTEM_INFO_DATA_TYPE_BOOL,
return SYSTEM_INFO_ERROR_IO_ERROR;
}
- ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, BOOL_TYPE, &
-string);
+ ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, BOOL_TYPE, &string);
if (ret) {
LOGE("cannot get %s", key);
return ret;
return SYSTEM_INFO_ERROR_IO_ERROR;
}
- ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, INT_TYPE, &
-string);
+ ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, INT_TYPE, &string);
if (ret) {
LOGE("cannot get %s", key);
return ret;
return SYSTEM_INFO_ERROR_IO_ERROR;
}
- ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, DBL_TYPE, &
-string);
+ ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, DBL_TYPE, &string);
if (ret) {
LOGE("cannot get %s", key);
return ret;
return SYSTEM_INFO_ERROR_IO_ERROR;
}
- ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, STR_TYPE, &
-string);
+ ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, STR_TYPE, &string);
if (ret) {
LOGE("cannot get %s", key);
return ret;
return SYSTEM_INFO_ERROR_IO_ERROR;
}
- ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, BOOL_TYPE, &
-string);
+ ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, BOOL_TYPE, &string);
if (ret) {
LOGI("cannot get %s", key);
*supported = false;
return SYSTEM_INFO_ERROR_IO_ERROR;
}
- ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, INT_TYPE, &
-string);
+ ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, INT_TYPE, &string);
if (ret) {
LOGI("cannot get %s", key);
*ret_val = 0;
return SYSTEM_INFO_ERROR_IO_ERROR;
}
- ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, DBL_TYPE, &
-string);
+ ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, DBL_TYPE, &string);
if (ret) {
LOGI("cannot get %s", key);
*ret_val = 0;
return SYSTEM_INFO_ERROR_IO_ERROR;
}
- ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, STR_TYPE, &
-string);
+ ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, STR_TYPE, &string);
+ if (ret) {
+ LOGE("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
+ return ret;
+ }
+
+ *value = string;
+
+ return SYSTEM_INFO_ERROR_NONE;
+}
+
+int system_info_get_internal_bool(const char *key, bool *value)
+{
+ int ret;
+ bool *supported;
+ char *string = NULL;
+
+ supported = (bool *)value;
+
+ if (access(CONFIG_FILE_PATH, R_OK)) {
+ LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+ return SYSTEM_INFO_ERROR_IO_ERROR;
+ }
+
+ ret = system_info_get_value_from_config_xml(INTERNAL_TAG, key, BOOL_TYPE, &string);
+ if (ret) {
+ LOGI("cannot get %s", key);
+ *supported = false;
+ return SYSTEM_INFO_ERROR_NONE;
+ }
+
+ if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
+ *supported = true;
+ else
+ *supported = false;
+
+ free(string);
+
+ return SYSTEM_INFO_ERROR_NONE;
+}
+
+int system_info_get_internal_int(const char *key, int *value)
+{
+ int ret;
+ int *ret_val;
+ char *string = NULL;
+
+ ret_val = (int *)value;
+
+ if (access(CONFIG_FILE_PATH, R_OK)) {
+ LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+ return SYSTEM_INFO_ERROR_IO_ERROR;
+ }
+
+ ret = system_info_get_value_from_config_xml(INTERNAL_TAG, key, INT_TYPE, &string);
+ if (ret) {
+ LOGI("cannot get %s", key);
+ *ret_val = 0;
+ return SYSTEM_INFO_ERROR_NONE;
+ }
+
+ *ret_val = atoi(string);
+
+ free(string);
+
+ return SYSTEM_INFO_ERROR_NONE;
+}
+
+int system_info_get_internal_double(const char *key, double *value)
+{
+ int ret;
+ double *ret_val;
+ char *string = NULL;
+
+ ret_val = (double *)value;
+
+ if (access(CONFIG_FILE_PATH, R_OK)) {
+ LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+ return SYSTEM_INFO_ERROR_IO_ERROR;
+ }
+
+ ret = system_info_get_value_from_config_xml(INTERNAL_TAG, key, DBL_TYPE, &string);
+ if (ret) {
+ LOGI("cannot get %s", key);
+ *ret_val = 0;
+ return SYSTEM_INFO_ERROR_NONE;
+ }
+
+ *ret_val = atof(string);
+
+ free(string);
+
+ return SYSTEM_INFO_ERROR_NONE;
+}
+
+int system_info_get_internal_string(const char *key, char **value)
+{
+ int ret;
+ char *string = NULL;
+
+ if (access(CONFIG_FILE_PATH, R_OK)) {
+ LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+ return SYSTEM_INFO_ERROR_IO_ERROR;
+ }
+
+ ret = system_info_get_value_from_config_xml(INTERNAL_TAG, key, STR_TYPE, &string);
if (ret) {
LOGE("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
return ret;