change logic to get camera count, screen width, screen height
authorNam KwanWoo <kw46.nam@samsung.com>
Mon, 24 Jun 2013 04:15:15 +0000 (13:15 +0900)
committerNam KwanWoo <kw46.nam@samsung.com>
Mon, 24 Jun 2013 04:15:15 +0000 (13:15 +0900)
Change-Id: I5908c0b7ae03dd863ed1ea7bd5645aa9df8410ea

src/system_info_device.c
src/system_info_platform.c
src/system_info_screen.c

index 35d4b0d..d3c502e 100644 (file)
 #define LOG_TAG "CAPI_SYSTEM_INFO"
 
 #define TETHERING_INFO_FILE_PATH "/etc/config/connectivity/sysinfo-tethering.xml"
+#define CAMERA_INFO_FILE_PATH  "/usr/etc/mmfw_camcorder.ini"
 
 int system_info_get_camera_count(system_info_key_e key, system_info_data_type_e data_type, void **value)
 {
-       bool camera;
-       int *count = 0;
+       int *count;
+       char *devicecount;
 
        count = (int *)value;
        *count = 0;
 
-       if (system_info_get_platform_bool("tizen.org/feature/camera.back", &camera) == SYSTEM_INFO_ERROR_NONE
-               && camera == true)
-               (*count)++;
-       if (system_info_get_platform_bool("tizen.org/feature/camera.front", &camera) == SYSTEM_INFO_ERROR_NONE
-               && camera == true)
-               (*count)++;
+       if (system_info_ini_get_string(CAMERA_INFO_FILE_PATH, "videoinput:devicecount", &devicecount)
+                       != SYSTEM_INFO_ERROR_NONE) {
+               return SYSTEM_INFO_ERROR_IO_ERROR;
+       }
+
+       *count = atoi(devicecount);
+
+       free(devicecount);
 
        return SYSTEM_INFO_ERROR_NONE;
 }
index 40cf35c..a8457cb 100644 (file)
@@ -262,19 +262,19 @@ int system_info_get_opengles_texture_format(system_info_key_e key, system_info_d
                strcat(textureformat, "utc ");
        if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.ptc", &texture) == SYSTEM_INFO_ERROR_NONE
                && texture == true)
-               strcat(textureformat, "ptc ");
+               strcat(textureformat, "ptc ");
        if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.etc", &texture) == SYSTEM_INFO_ERROR_NONE
                && texture == true)
-               strcat(textureformat, "etc ");
+               strcat(textureformat, "etc ");
        if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.3dc", &texture) == SYSTEM_INFO_ERROR_NONE
                && texture == true)
-               strcat(textureformat, "3dc ");
+               strcat(textureformat, "3dc ");
        if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.atc", &texture) == SYSTEM_INFO_ERROR_NONE
                && texture == true)
-               strcat(textureformat, "atc ");
+               strcat(textureformat, "atc ");
        if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.pvrtc", &texture) == SYSTEM_INFO_ERROR_NONE
                && texture == true)
-               strcat(textureformat, "pvrtc");
+               strcat(textureformat, "pvrtc");
 
        OPENGLES_TEXTURE_FORMAT = strdup(textureformat);
 
index 36b0a82..b28f058 100644 (file)
@@ -37,42 +37,12 @@ int system_info_get_screen_bits_per_pixel(system_info_key_e key, system_info_dat
 
 int system_info_get_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value)
 {
-       bool check;
-       int *width = 0;
-
-       width = (int *)value;
-
-       if (system_info_get_platform_bool("tizen.org/feature/screen.size.normal.480.800", &check) == SYSTEM_INFO_ERROR_NONE
-               && check == true)
-               *width = 480;
-       if (system_info_get_platform_bool("tizen.org/feature/screen.size.normal.720.1280", &check) == SYSTEM_INFO_ERROR_NONE
-               && check == true)
-               *width = 720;
-
-       if (*width)
-       return SYSTEM_INFO_ERROR_NONE;
-       else
-               return SYSTEM_INFO_ERROR_IO_ERROR;
+       return system_info_get_platform_int("tizen.org/feature/screen.width", (int *)value);
 }
 
 int system_info_get_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value)
 {
-       bool check;
-       int *height = 0;
-
-       height = (int *)value;
-
-       if (system_info_get_platform_bool("tizen.org/feature/screen.size.normal.480.800", &check) == SYSTEM_INFO_ERROR_NONE
-               && check == true)
-               *height = 800;
-       if (system_info_get_platform_bool("tizen.org/feature/screen.size.normal.720.1280", &check) == SYSTEM_INFO_ERROR_NONE
-               && check == true)
-               *height = 1280;
-
-       if (*height)
-       return SYSTEM_INFO_ERROR_NONE;
-       else
-               return SYSTEM_INFO_ERROR_IO_ERROR;
+       return system_info_get_platform_int("tizen.org/feature/screen.height", (int *)value);
 }
 
 int system_info_get_screen_DPI(system_info_key_e key, system_info_data_type_e data_type, void **value)