2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 ** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
19 ** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
20 ** Digital Equipment Corporation, Maynard, Mass.
21 ** Copyright (c) 1998 Microsoft.
22 ** To anyone who acknowledges that this file is provided "AS IS"
23 ** without any express or implied warranty: permission to use, copy,
24 ** modify, and distribute this file for any purpose is hereby
25 ** granted without fee, provided that the above copyright notices and
26 ** this notice appears in all source code copies, and that none of
27 ** the names of Open Software Foundation, Inc., Hewlett-Packard
28 ** Company, Microsoft, or Digital Equipment Corporation be used in
29 ** advertising or publicity pertaining to distribution of the software
30 ** without specific, written prior permission. Neither Open Software
31 ** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital
32 ** Equipment Corporation makes any representations about the
33 ** suitability of this software for any purpose.
35 ** This license applies to all the permissions of the below mentioned functions.
36 ** Functions: format_uuid_v3or5, uuid_create_sha1_from_name
46 #include <vconf-internal-csc-keys.h>
49 #include <system_info.h>
50 #include <system_info_private.h>
54 #include <X11/extensions/XI2.h>
55 #include <X11/extensions/XI2proto.h>
57 #include <X11/Xatom.h>
58 #include <X11/extensions/XInput2.h>
60 #include <openssl/sha.h>
61 #include <arpa/inet.h>
64 #include <net_nfc_typedef.h>
67 #include <location-types.h>
69 #include <bluetooth-api.h>
74 #include <sound_manager.h>
77 #define PROP_MULTITOUCH "EvdevMultitouch MultiTouch"
78 #define DEVICE_UUID_STRING_SIZE 37
84 #define LOG_TAG "CAPI_SYSTEM_INFO"
86 #define CAM_INI_FILE_PATH "/usr/etc/mmfw_camcorder.ini"
87 #define CAM_VIDEO_PRI_FILE_PATH "/usr/etc/mmfw_camcorder_dev_video_pri.ini"
88 #define CAM_VIDEO_SEC_FILE_PATH "/usr/etc/mmfw_camcorder_dev_video_sec.ini"
90 #define NFC_INFO_FILE_PATH "/etc/config/nfc/sysinfo-nfc-ug.xml"
92 static char *FRONT_CAM_PATH;
93 static char *BACK_CAM_PATH;
98 uint16_t time_hi_and_version;
99 uint8_t clock_seq_hi_and_reserved;
100 uint8_t clock_seq_low;
105 Tizen Default vender key = f7884739-3c9f-5f7c-af-e1-fc9f5da56003
106 This value should be modified by each venders.
108 _UUID_OBJECT VenderKey = {0xf7884739, 0x3c9f, 0x5f7c, 0xaf, 0xe1, {0xfc, 0x9f, 0x5d, 0xa5, 0x60, 0x3} };
110 format_uuid_v3or5 -- make a UUID from a (pseudo)random 128-bit
113 void format_uuid_v3or5(_UUID_OBJECT *uuid, unsigned char hash[16], int v)
115 /* convert UUID to local byte order */
116 memcpy(uuid, hash, sizeof(*uuid));
117 uuid->time_low = ntohl(uuid->time_low);
118 uuid->time_mid = ntohs(uuid->time_mid);
119 uuid->time_hi_and_version = ntohs(uuid->time_hi_and_version);
121 /* put in the variant and version bits */
122 uuid->time_hi_and_version &= 0x0FFF;
123 uuid->time_hi_and_version |= (v << 12);
124 uuid->clock_seq_hi_and_reserved &= 0x3F;
125 uuid->clock_seq_hi_and_reserved |= 0x80;
128 void uuid_create_sha1_from_name(_UUID_OBJECT *uuid, _UUID_OBJECT nsid, void *name, int namelen)
131 unsigned char hash[20];
132 _UUID_OBJECT net_nsid;
134 /* put name space ID in network byte order so it hashes the same
135 no matter what endian machine we're on */
137 net_nsid.time_low = htonl(net_nsid.time_low);
138 net_nsid.time_mid = htons(net_nsid.time_mid);
139 net_nsid.time_hi_and_version = htons(net_nsid.time_hi_and_version);
142 SHA1_Update(&c, &net_nsid, sizeof(net_nsid));
143 SHA1_Update(&c, name, namelen);
144 SHA1_Final(hash, &c);
146 /* the hash is in network byte order at this point */
147 format_uuid_v3or5(uuid, hash, 5);
150 int uuid_object_to_string(_UUID_OBJECT uuid, char **device_uuid_string)
152 *device_uuid_string = (char *) calloc(1, DEVICE_UUID_STRING_SIZE + 1);
154 if (*device_uuid_string == NULL)
155 return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
157 snprintf(*device_uuid_string, DEVICE_UUID_STRING_SIZE, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
158 (unsigned long)uuid.time_low,
159 (unsigned int)uuid.time_mid,
160 (unsigned int)uuid.time_hi_and_version,
161 (unsigned int)uuid.clock_seq_hi_and_reserved,
162 (unsigned int)uuid.clock_seq_low,
163 (unsigned int)uuid.node[0],
164 (unsigned int)uuid.node[1],
165 (unsigned int)uuid.node[2],
166 (unsigned int)uuid.node[3],
167 (unsigned int)uuid.node[4],
168 (unsigned int)uuid.node[5]);
170 return SYSTEM_INFO_ERROR_NONE;
173 extern char *strcasestr(const char *s, const char *find);
175 int xinput_extension_init(Display *disp)
179 int major = XI_2_Major, minor = XI_2_Minor;
181 if (!XQueryExtension(disp, "XInputExtension", &opcode, &event, &error)) {
182 LOGE("XInput Extension isn't supported.");
183 return SYSTEM_INFO_ERROR_IO_ERROR;
186 if (XIQueryVersion(disp, &major, &minor) == BadRequest) {
187 LOGE("Failed to query XI version.");
188 return SYSTEM_INFO_ERROR_IO_ERROR;
191 if (!(major >= XI_2_Major && minor >= XI_2_Minor)) {
192 LOGE("XI2 is not supported ! (major:%d, minor:%d)", major, minor);
193 return SYSTEM_INFO_ERROR_IO_ERROR;
198 int get_device_property_value(Display *disp, int deviceid, Atom prop)
201 unsigned long nitems, bytes_after;
203 int act_format, ret = -1;
205 if (XIGetProperty(disp, deviceid, prop, 0, 1000, False,
206 XA_INTEGER, &act_type, &act_format,
207 &nitems, &bytes_after, &data) != Success) {
208 LOGE("Failed to get XI2 device property !(deviceid=%d)", deviceid);
209 return SYSTEM_INFO_ERROR_IO_ERROR;
224 int get_multitouch_max_count(Display *disp)
229 XIDeviceInfo *dev, *info = NULL;
231 int xi_opcode = xinput_extension_init(disp);
233 if (0 >= xi_opcode) {
234 LOGE("Failed to initialize X Input Extension !");
235 return SYSTEM_INFO_ERROR_IO_ERROR;
238 atomMultiTouch = XInternAtom(disp, PROP_MULTITOUCH, True);
240 if (!atomMultiTouch) {
241 LOGE("Failed to make an atom for multitouch property !");
242 return SYSTEM_INFO_ERROR_IO_ERROR;
245 info = XIQueryDevice(disp, XIAllDevices, &ndevices);
248 LOGE("Failed to query XI device.");
249 return SYSTEM_INFO_ERROR_IO_ERROR;
252 for (i = 0; i < ndevices ; i++) {
257 if (strcasestr(dev->name, "virtual") && !strcasestr(dev->name, "maru"))
259 if (strcasestr(dev->name, "extended"))
261 if (!strcasestr(dev->name, "touch"))
263 max_count = get_device_property_value(disp, dev->deviceid, atomMultiTouch);
268 XIFreeDeviceInfo(info);
272 XIFreeDeviceInfo(info);
277 * @brief Setting face direction path
281 void set_camera_direction_path(void)
283 char str[MAXBUFSIZE];
284 char tmpStr[MAXBUFSIZE];
288 info = fopen(CAM_VIDEO_PRI_FILE_PATH, "r");
291 while (fgets(str, MAXBUFSIZE, info)) {
292 if (!strncmp(";", str, strlen(";")))
294 else if (!strncmp("FacingDirection", str, strlen("FacingDirection"))) {
295 sscanf(str, "%s = %d", tmpStr, &direction);
296 if (direction == 1) {
297 FRONT_CAM_PATH = strdup(CAM_VIDEO_PRI_FILE_PATH);
298 BACK_CAM_PATH = strdup(CAM_VIDEO_SEC_FILE_PATH);
309 /* default setting */
310 FRONT_CAM_PATH = strdup(CAM_VIDEO_SEC_FILE_PATH);
311 BACK_CAM_PATH = strdup(CAM_VIDEO_PRI_FILE_PATH);
316 int system_info_get_bluetooth_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
320 supported = (bool *)value;
322 if (bluetooth_is_supported())
327 return SYSTEM_INFO_ERROR_NONE;
330 int system_info_get_camera_count(system_info_key_e key, system_info_data_type_e data_type, void **value)
333 char str[MAXBUFSIZE];
334 char tmpStr[MAXBUFSIZE];
337 count = (int *)value;
338 /* default camera count is 2*/
341 info = fopen(CAM_INI_FILE_PATH, "r");
343 LOGE("cannot file open %s file!!!", CAM_INI_FILE_PATH);
344 return SYSTEM_INFO_ERROR_IO_ERROR;
346 while (fgets(str, MAXBUFSIZE, info)) {
347 if (!strncmp(";", str, strlen(";")))
349 else if (!strncmp("DeviceCount", str, strlen("DeviceCount"))) {
350 sscanf(str, "%s = %d", tmpStr, count);
357 return SYSTEM_INFO_ERROR_NONE;
360 int system_info_get_fmradio_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
365 supported = (bool *)value;
367 memset(&hradio, 0x0, sizeof(MMHandleType));
369 if (mm_radio_create(&hradio) == MM_ERROR_NONE) {
370 if(mm_radio_realize(hradio) == MM_ERROR_NONE) {
372 if (mm_radio_unrealize(hradio) == MM_ERROR_NONE) {
373 if (mm_radio_destroy(hradio) == MM_ERROR_NONE)
374 return SYSTEM_INFO_ERROR_NONE;
376 LOGE("cannot destroy mm_radio handle!!!");
377 return SYSTEM_INFO_ERROR_IO_ERROR;
380 LOGE("cannot unrealize mm_radio handle!!!");
381 return SYSTEM_INFO_ERROR_IO_ERROR;
385 if (mm_radio_destroy(hradio) == MM_ERROR_NONE)
386 return SYSTEM_INFO_ERROR_NONE;
388 LOGE("cannot destroy mm_radio handle!!!");
389 return SYSTEM_INFO_ERROR_IO_ERROR;
394 return SYSTEM_INFO_ERROR_NONE;
398 int system_info_get_gps_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
402 supported = (bool *)value;
404 if (location_is_supported_method(LOCATION_METHOD_GPS))
409 return SYSTEM_INFO_ERROR_NONE;
412 int system_info_get_cps_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
416 supported = (bool *)value;
418 if (location_is_supported_method(LOCATION_METHOD_CPS))
423 return SYSTEM_INFO_ERROR_NONE;
426 int system_info_get_wps_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
430 supported = (bool *)value;
432 if (location_is_supported_method(LOCATION_METHOD_WPS))
437 return SYSTEM_INFO_ERROR_NONE;
440 int system_info_get_keyboard_type(system_info_key_e key, system_info_data_type_e data_type, void **value)
443 char *model = "default";
445 if (system_info_get_value_from_xml(XML_FILE_PATH, model, "Keyboad_type", &string)) {
446 LOGE("cannot get Keyboad_type info from %s!!!", XML_FILE_PATH);
447 return SYSTEM_INFO_ERROR_IO_ERROR;
452 return SYSTEM_INFO_ERROR_NONE;
455 int system_info_get_multi_point_touch_count(system_info_key_e key, system_info_data_type_e data_type, void **value)
460 count = (int *)value;
462 disp = XOpenDisplay(NULL);
465 LOGE("Failed to open display!");
466 return SYSTEM_INFO_ERROR_IO_ERROR;
469 *count = get_multitouch_max_count(disp);
471 return SYSTEM_INFO_ERROR_NONE;
474 int system_info_get_nfc_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
477 int nfc_supported = 0;
479 supported = (bool *)value;
481 if (NET_NFC_OK == net_nfc_is_supported(&nfc_supported))
486 return SYSTEM_INFO_ERROR_NONE;
489 int system_info_get_tvout_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
493 char *model = "default";
495 supported = (bool *)value;
497 if (system_info_get_value_from_xml(XML_FILE_PATH, model, "tv_out_support", &string)) {
498 LOGE("cannot get tv_out_support info from %s!!!", NFC_INFO_FILE_PATH);
499 return SYSTEM_INFO_ERROR_IO_ERROR;
502 if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
509 return SYSTEM_INFO_ERROR_NONE;
512 int system_info_get_wifi_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
516 char *model = "default";
518 supported = (bool *)value;
520 if (system_info_get_system_info_model_type() == SYSTEM_INFO_MODEL_TYPE_EMULATOR) {
522 return SYSTEM_INFO_ERROR_NONE;
525 if (system_info_get_value_from_xml(XML_FILE_PATH, model, "wifi_support", &string)) {
526 LOGE("cannot get wifi_support info from %s!!!", NFC_INFO_FILE_PATH);
527 return SYSTEM_INFO_ERROR_IO_ERROR;
530 if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
537 return SYSTEM_INFO_ERROR_NONE;
540 int system_info_get_wifi_direct_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
544 char *model = "default";
546 supported = (bool *)value;
548 if (system_info_get_system_info_model_type() == SYSTEM_INFO_MODEL_TYPE_EMULATOR) {
550 return SYSTEM_INFO_ERROR_NONE;
553 if (system_info_get_value_from_xml(XML_FILE_PATH, model, "wifi_direct_support", &string)) {
554 LOGE("cannot get wifi_direct_support info from %s!!!", NFC_INFO_FILE_PATH);
555 return SYSTEM_INFO_ERROR_IO_ERROR;
558 if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
565 return SYSTEM_INFO_ERROR_NONE;
568 int system_info_get_haptic_supproted(system_info_key_e key, system_info_data_type_e data_type, void **value)
574 supported = (bool *)value;
576 retVal = haptic_get_count(&count);
578 return SYSTEM_INFO_ERROR_IO_ERROR;
585 return SYSTEM_INFO_ERROR_NONE;
588 int system_info_get_csc_sales_code(system_info_key_e key, system_info_data_type_e data_type, void **value)
590 char *CSC_SALES_CODE;
592 CSC_SALES_CODE = (char *)value;
594 if (system_info_vconf_get_value_string(VCONFKEY_CSC_SALESCODE, &CSC_SALES_CODE))
595 return SYSTEM_INFO_ERROR_IO_ERROR;
597 return SYSTEM_INFO_ERROR_NONE;
600 int system_info_get_device_uuid(system_info_key_e key, system_info_data_type_e data_type, void **value)
604 _UUID_OBJECT device_uuid;
607 retVal = system_info_get_value_string(SYSTEM_INFO_KEY_MOBILE_DEVICE_ID, &imei);
608 if (SYSTEM_INFO_ERROR_NONE != retVal) {
609 LOGE("cannot get an IMEI value!!!");
614 uuid_create_sha1_from_name(&device_uuid, VenderKey, imei, strlen(imei));
616 if (uuid_object_to_string(device_uuid, &UUID))
617 return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
622 return SYSTEM_INFO_ERROR_NONE;
624 LOGE("imei is NULL!!!");
625 return SYSTEM_INFO_ERROR_IO_ERROR;
629 int system_info_get_usb_host_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
632 int usbhost_state = 0;
634 supported = (bool *)value;
636 if (vconf_get_int(VCONFKEY_SYSMAN_USB_HOST_STATUS, &usbhost_state))
641 return SYSTEM_INFO_ERROR_NONE;
644 int system_info_get_usb_accessory_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
647 int usbhost_state = 0;
649 supported = (bool *)value;
651 if (vconf_get_int(VCONFKEY_USB_ACCESSORY_STATUS, &usbhost_state))
656 return SYSTEM_INFO_ERROR_NONE;
659 int system_info_get_front_camera_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
663 supported = (bool *)value;
665 /* setting camera direction */
666 set_camera_direction_path();
668 /* There is no FacingDirection field in ini file */
669 if (!access(FRONT_CAM_PATH, R_OK))
674 /* free used memory for camera direction */
675 free(FRONT_CAM_PATH);
678 return SYSTEM_INFO_ERROR_NONE;
681 int system_info_get_front_camera_af_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
684 char str[MAXBUFSIZE];
685 char tmpStr[MAXBUFSIZE];
689 supported = (bool *)value;
690 /* default value is false */
693 /* setting camera direction */
694 set_camera_direction_path();
696 /* Return false, if there is no "/usr/etc/mmfw_camcorder_dev_video_sec.ini" file */
697 if (access(FRONT_CAM_PATH, R_OK))
698 return SYSTEM_INFO_ERROR_NONE;
700 info = fopen(FRONT_CAM_PATH, "r");
702 LOGE("cannot file open %s file!!!", FRONT_CAM_PATH);
703 return SYSTEM_INFO_ERROR_IO_ERROR;
705 while (fgets(str, MAXBUFSIZE, info)) {
706 if (!strncmp(";", str, strlen(";")))
708 else if (!strncmp("FocusMode", str, strlen("FocusMode"))) {
709 sscanf(str, "%s = %d,%d,%d,%d,%d,%d", tmpStr, &tmpInt[0], &tmpInt[1], &tmpInt[2], &tmpInt[3], &tmpInt[4], &tmpInt[5]);
710 if (tmpInt[2] != -255 || tmpInt[4] != -255)
718 /* free used memory for camera direction */
719 free(FRONT_CAM_PATH);
723 return SYSTEM_INFO_ERROR_NONE;
726 int system_info_get_front_camera_flash_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
729 char str[MAXBUFSIZE];
730 char tmpStr[MAXBUFSIZE];
735 supported = (bool *)value;
736 /* default value is false */
739 /* setting camera direction */
740 set_camera_direction_path();
742 /* Return false, if there is no "/usr/etc/mmfw_camcorder_dev_video_sec.ini" file */
743 if (access(FRONT_CAM_PATH, R_OK))
744 return SYSTEM_INFO_ERROR_NONE;
746 info = fopen(FRONT_CAM_PATH, "r");
748 LOGE("cannot file open %s file!!!", FRONT_CAM_PATH);
749 return SYSTEM_INFO_ERROR_IO_ERROR;
751 while (fgets(str, MAXBUFSIZE, info)) {
752 if (!strncmp(";", str, strlen(";")))
754 else if (!strncmp("StrobeMode", str, strlen("StrobeMode"))) {
755 sscanf(str, "%s = %d,%d,%d,%d,%d,%d,%d,%d", tmpStr, &tmpInt[0], &tmpInt[1], &tmpInt[2], &tmpInt[3], &tmpInt[4], &tmpInt[5], &tmpInt[6], &tmpInt[7]);
756 for (i = 1; i < 8; i++) {
757 if (tmpInt[i] != -255)
766 /* free used memory for camera direction */
767 free(FRONT_CAM_PATH);
771 return SYSTEM_INFO_ERROR_NONE;
774 int system_info_get_back_camera_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
778 supported = (bool *)value;
780 /* setting camera direction */
781 set_camera_direction_path();
783 if (!access(BACK_CAM_PATH, R_OK))
788 /* free used memory for camera direction */
789 free(FRONT_CAM_PATH);
792 return SYSTEM_INFO_ERROR_NONE;
795 int system_info_get_back_camera_af_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
798 char str[MAXBUFSIZE];
799 char tmpStr[MAXBUFSIZE];
803 supported = (bool *)value;
804 /* default value is false */
807 /* setting camera direction */
808 set_camera_direction_path();
810 /* Return false, if there is no "/usr/etc/mmfw_camcorder_dev_video_pri.ini" file */
811 if (access(BACK_CAM_PATH, R_OK))
812 return SYSTEM_INFO_ERROR_NONE;
814 info = fopen(BACK_CAM_PATH, "r");
816 LOGE("cannot file open %s file!!!", BACK_CAM_PATH);
817 return SYSTEM_INFO_ERROR_IO_ERROR;
819 while (fgets(str, MAXBUFSIZE, info)) {
820 if (!strncmp(";", str, strlen(";")))
822 else if (!strncmp("FocusMode", str, strlen("FocusMode"))) {
823 sscanf(str, "%s = %d,%d,%d,%d,%d,%d", tmpStr, &tmpInt[0], &tmpInt[1], &tmpInt[2], &tmpInt[3], &tmpInt[4], &tmpInt[5]);
824 if (tmpInt[2] != -255 || tmpInt[4] != -255)
832 /* free used memory for camera direction */
833 free(FRONT_CAM_PATH);
837 return SYSTEM_INFO_ERROR_NONE;
840 int system_info_get_back_camera_flash_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
843 char str[MAXBUFSIZE];
844 char tmpStr[MAXBUFSIZE];
849 supported = (bool *)value;
850 /* default value is false */
853 /* setting camera direction */
854 set_camera_direction_path();
856 /* Return false, if there is no "/usr/etc/mmfw_camcorder_dev_video_pri.ini" file */
857 if (access(BACK_CAM_PATH, R_OK))
858 return SYSTEM_INFO_ERROR_NONE;
860 info = fopen(BACK_CAM_PATH, "r");
862 LOGE("cannot file open %s file!!!", BACK_CAM_PATH);
863 return SYSTEM_INFO_ERROR_IO_ERROR;
865 while (fgets(str, MAXBUFSIZE, info)) {
866 if (!strncmp(";", str, strlen(";")))
868 else if (!strncmp("StrobeMode", str, strlen("StrobeMode"))) {
869 sscanf(str, "%s = %d,%d,%d,%d,%d,%d,%d,%d", tmpStr, &tmpInt[0], &tmpInt[1], &tmpInt[2], &tmpInt[3], &tmpInt[4], &tmpInt[5], &tmpInt[6], &tmpInt[7]);
870 for (i = 1; i < 8; i++) {
871 if (tmpInt[i] != -255)
880 /* free used memory for camera direction */
881 free(FRONT_CAM_PATH);
885 return SYSTEM_INFO_ERROR_NONE;
889 int system_info_get_sip_voip_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
893 char *model = "default";
895 supported = (bool *)value;
897 if (system_info_get_value_from_xml(XML_FILE_PATH, model, "sip_voip_support", &string)) {
898 LOGE("cannot get sip_voip_support info from %s!!!", NFC_INFO_FILE_PATH);
899 return SYSTEM_INFO_ERROR_IO_ERROR;
902 if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
909 return SYSTEM_INFO_ERROR_NONE;
912 int system_info_get_microphone_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
915 sound_device_in_e in;
916 sound_device_out_e out;
918 supported = (bool *)value;
920 if (SOUND_MANAGER_ERROR_NONE == sound_manager_get_active_device(&in, &out)) {
921 if (in == SOUND_DEVICE_IN_MIC)
928 return SYSTEM_INFO_ERROR_NONE;
931 int system_info_get_speech_recognition_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
935 char *model = "default";
937 supported = (bool *)value;
939 if (system_info_get_value_from_xml(XML_FILE_PATH, model, "speech_recognition_support", &string)) {
940 LOGE("cannot get speech_recognition_support info from %s!!!", NFC_INFO_FILE_PATH);
941 return SYSTEM_INFO_ERROR_IO_ERROR;
944 if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
951 return SYSTEM_INFO_ERROR_NONE;
954 int system_info_get_barometer_sensor_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
958 supported = (bool *)value;
960 if (sf_is_sensor_event_available(BAROMETER_SENSOR, 0))
965 return SYSTEM_INFO_ERROR_NONE;
968 int system_info_get_manufacturer(system_info_key_e key, system_info_data_type_e data_type, void **value)
971 char *model = "default";
973 if (system_info_get_value_from_xml(XML_FILE_PATH, model, "MANUFACTURER", &string)) {
974 LOGE("cannot get MANUFACTURER info from %s!!!", XML_FILE_PATH);
975 return SYSTEM_INFO_ERROR_IO_ERROR;
980 return SYSTEM_INFO_ERROR_NONE;
983 int system_info_get_cp_interface(system_info_key_e key, system_info_data_type_e data_type, void **value)
986 char *model = "default";
988 if (system_info_get_value_from_xml(XML_FILE_PATH, model, "CP_Interface", &string)) {
989 LOGE("cannot get CP_Interface info from %s!!!", XML_FILE_PATH);
990 return SYSTEM_INFO_ERROR_IO_ERROR;
995 return SYSTEM_INFO_ERROR_NONE;
998 int system_info_get_nfc_reserved_push_supported(system_info_key_e key, system_info_data_type_e data_type, void **value)
1001 char *string = NULL;
1002 char *model = "default";
1004 supported = (bool *)value;
1006 if (access(NFC_INFO_FILE_PATH, R_OK)) {
1008 return SYSTEM_INFO_ERROR_NONE;
1011 if (system_info_get_value_from_xml(NFC_INFO_FILE_PATH, model, "reserved-push-support", &string)) {
1012 LOGE("cannot get reserved-push-support info from %s!!!", NFC_INFO_FILE_PATH);
1013 return SYSTEM_INFO_ERROR_IO_ERROR;
1016 if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
1023 return SYSTEM_INFO_ERROR_NONE;