add new keys (SPEECH_SYNTHESIS, GRAPHICS_HWACCEL)
authorNam KwanWoo <kw46.nam@samsung.com>
Wed, 10 Apr 2013 06:15:23 +0000 (15:15 +0900)
committerNam KwanWoo <kw46.nam@samsung.com>
Wed, 10 Apr 2013 06:15:23 +0000 (15:15 +0900)
Change-Id: I5aa58ca2276fd5e9ba0990e08c049b8dc1845227

configuration/sys-info.xml
include/system_info.h
include/system_info_private.h
packaging/capi-system-info.spec
src/system_info.c
src/system_info_device.c
src/system_info_platform.c

index d0dc96b7bd4a39635942d4de9108e6526c00efbe..345ee4c64b9d1c4d1cadff618f67c5b57ffbfb9d 100644 (file)
@@ -4,7 +4,6 @@
          <key id="MANUFACTURER" string="samsung"/>
          <key id="CP_Interface" string="svnet2"/>
          <key id="Keyboad_type" string="NULL"/>
-         <key id="speech_recognition_support" string="TRUE"/>
          <key id="sip_voip_support" string="TRUE"/>
          <key id="tv_out_support" string="TRUE"/>
          <key id="wifi_support" string="TRUE"/>
index 0a37d3a20ef2761daf290f1bc270495c19a4fd8b..09a23110022fb223cbcc6c120a2550f830af4158 100644 (file)
@@ -100,6 +100,8 @@ typedef enum {
        SYSTEM_INFO_KEY_CBS_SUPPORTED, /**< Indicates whether the device supports CBS */
        SYSTEM_INFO_KEY_NFC_RESERVED_PUSH_SUPPORTED, /**< Indicates whether the device supports nfc-reserved push */
        SYSTEM_INFO_KEY_TETHERING_SUPPORTED, /**< Indicates whether the device supports tethering */
+       SYSTEM_INFO_KEY_SPEECH_SYNTHESIS_SUPPORTED, /**< Indicates whether the device supports tts */
+       SYSTEM_INFO_KEY_GRAPHICS_HWACCEL_SUPPORTED, /**< Indicates whether the device supports graphics hardware acceleration */
 } system_info_key_e;
 
 /**
index 4180dbd16d92e7044967a345419afaae40f77850..274a6e1f9ce0b4fff6f4c2339ade0103dd5f550a 100644 (file)
@@ -106,6 +106,7 @@ int system_info_get_device_uuid(system_info_key_e key, system_info_data_type_e d
 int system_info_get_sip_voip_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
 int system_info_get_microphone_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
 int system_info_get_speech_recognition_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
+int system_info_get_speech_synthesis_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
 int system_info_get_barometer_sensor_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
 int system_info_get_manufacturer(system_info_key_e key, system_info_data_type_e data_type, void **value);
 int system_info_get_cp_interface(system_info_key_e key, system_info_data_type_e data_type, void **value);
@@ -117,6 +118,7 @@ int system_info_get_sms_supported(system_info_key_e key, system_info_data_type_e
 int system_info_get_cbs_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
 int system_info_get_tethering_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
 int system_info_get_nfc_reserved_push_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
+int system_info_get_graphics_hwaccel_supported(system_info_key_e key, system_info_data_type_e data_type, void **value);
 
 int system_info_get_value_from_xml(char *xml_file_path, char *model, char *id_field, char **value);
 #ifdef __cplusplus
index e9848dc32e60472ce4e4d7062ffdde1003cfb3ca..1fdee56bcb6221382ceecd9f236e32390dd7797b 100644 (file)
@@ -1,7 +1,7 @@
 #sbs-git:slp/api/system-info capi-system-info 0.1.0 63d15bafa590ee9de869c8a8ade712e06828e5c3
 Name:       capi-system-info
 Summary:    A System Information library in SLP C API
-Version: 0.1.11
+Version: 0.1.12
 Release:    0
 Group:      System/Libraries
 License:    Apache License, Version 2.0 and IEFT RFC Collection
index c06264b7018d00851eb295ad002516fbd017dfa3..b6a88d10886a5366d257547280516095a6a01eac 100644 (file)
@@ -437,6 +437,20 @@ system_info_s system_info_table[] = {
        system_info_get_tethering_supported
 },
 
+{
+       /**< Indicates whether the device supports tts */
+       SYSTEM_INFO_KEY_SPEECH_SYNTHESIS_SUPPORTED,
+       SYSTEM_INFO_DATA_TYPE_BOOL,
+       system_info_get_speech_synthesis_supported
+},
+
+{
+       /**< Indicates whether the device supports graphics hardware acceleration */
+       SYSTEM_INFO_KEY_GRAPHICS_HWACCEL_SUPPORTED,
+       SYSTEM_INFO_DATA_TYPE_BOOL,
+       system_info_get_graphics_hwaccel_supported
+},
+
 {
        SYSTEM_INFO_MAX, -1, NULL
 }
index a916ab1055fa25bad5b0527a5fdb1a5df0c9090c..c8c6770d9fd74f6e7472ea9c48341cd193d81a0a 100644 (file)
@@ -89,6 +89,8 @@
 
 #define NFC_INFO_FILE_PATH "/etc/config/nfc/sysinfo-nfc-ug.xml"
 #define TETHERING_INFO_FILE_PATH "/etc/config/connectivity/sysinfo-tethering.xml"
+#define TTS_INFO_FILE_PATH "/etc/config/sysinfo-tts.xml"
+#define STT_INFO_FILE_PATH "/etc/config/sysinfo-stt.xml"
 
 static char *FRONT_CAM_PATH;
 static char *BACK_CAM_PATH;
@@ -943,8 +945,41 @@ int system_info_get_speech_recognition_supported(system_info_key_e key, system_i
 
        supported = (bool *)value;
 
-       if (system_info_get_value_from_xml(XML_FILE_PATH, model, "speech_recognition_support", &string)) {
-               LOGE("cannot get speech_recognition_support info from %s!!!", NFC_INFO_FILE_PATH);
+       if (access(STT_INFO_FILE_PATH, R_OK)) {
+               *supported = false;
+               return SYSTEM_INFO_ERROR_NONE;
+       }
+
+       if (system_info_get_value_from_xml(STT_INFO_FILE_PATH, model, "stt-support", &string)) {
+               LOGE("cannot get stt-support info from %s!!!", STT_INFO_FILE_PATH);
+               return SYSTEM_INFO_ERROR_IO_ERROR;
+       }
+
+       if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
+               *supported = true;
+       else
+               *supported = false;
+
+       free(string);
+
+       return SYSTEM_INFO_ERROR_NONE;
+}
+
+int system_info_get_speech_synthesis_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
+{
+       bool *supported;
+       char *string = NULL;
+       char *model = "default";
+
+       supported = (bool *)value;
+
+       if (access(TTS_INFO_FILE_PATH, R_OK)) {
+               *supported = false;
+               return SYSTEM_INFO_ERROR_NONE;
+       }
+
+       if (system_info_get_value_from_xml(TTS_INFO_FILE_PATH, model, "tts-support", &string)) {
+               LOGE("cannot get tts-support info from %s!!!", TTS_INFO_FILE_PATH);
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
 
index 5e572c59dcf85750843e98b273357a17d48e3e8c..656ef4cce55f0211213963a68616e8bcbfcf8019 100644 (file)
@@ -49,6 +49,7 @@
 #define SIZE_OF_MODEL_NAME 8
 
 #define MESSAGE_INFO_FILE_PATH "/etc/config/sysinfo-message.xml"
+#define GRAPHICS_INFO_FILE_PATH "/etc/config/graphics/sysinfo-graphics.xml"
 
 int system_info_get_value_from_xml(char *xml_file_path, char *model, char *id_field, char **value)
 {
@@ -740,3 +741,31 @@ int system_info_get_cbs_supported(system_info_key_e key, system_info_data_type_e
 
        return SYSTEM_INFO_ERROR_NONE;
 }
+
+int system_info_get_graphics_hwaccel_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
+{
+       bool *supported;
+       char *string = NULL;
+       char *model = "default";
+
+       supported = (bool *)value;
+
+       if (access(GRAPHICS_INFO_FILE_PATH, R_OK)) {
+               *supported = false;
+               return SYSTEM_INFO_ERROR_NONE;
+       }
+
+       if (system_info_get_value_from_xml(GRAPHICS_INFO_FILE_PATH, model, "acceleration-support", &string)) {
+               LOGE("cannot get acceleration-support info from %s!!!", GRAPHICS_INFO_FILE_PATH);
+               return SYSTEM_INFO_ERROR_IO_ERROR;
+       }
+
+       if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
+               *supported = true;
+       else
+               *supported = false;
+
+       free(string);
+
+       return SYSTEM_INFO_ERROR_NONE;
+}