tizen 2.4 release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20151029.034407 submit/tizen_2.4/20151028.063710 tizen_2.4_mobile_release
authorjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 07:27:00 +0000 (16:27 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 07:27:00 +0000 (16:27 +0900)
52 files changed:
CMakeLists.txt
LICENSE.APLv2 [moved from LICENSE with 100% similarity]
NOTICE
TC/_export_env.sh [deleted file]
TC/_export_target_env.sh [deleted file]
TC/build.sh [deleted file]
TC/clean.sh [deleted file]
TC/config [deleted file]
TC/execute.sh [deleted file]
TC/testcase/Makefile [deleted file]
TC/testcase/tslist [deleted file]
TC/testcase/utc_system_info.c [deleted file]
TC/tet_scen [deleted file]
TC/tetbuild.cfg [deleted file]
TC/tetclean.cfg [deleted file]
TC/tetexec.cfg [deleted file]
capi-system-info-plugin.pc.in [new file with mode: 0755]
debian/README [deleted file]
debian/capi-system-info-dev.install [deleted file]
debian/capi-system-info-dev.postinst [deleted file]
debian/capi-system-info.install [deleted file]
debian/capi-system-info.postinst [deleted file]
debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/rules [deleted file]
doc/system_info_doc.h
include/system_info.h
include/system_info_internal.h [deleted file]
include/system_info_intf.h [new file with mode: 0644]
include/system_info_private.h
include/system_info_type.h
packaging/capi-system-info.manifest
packaging/capi-system-info.spec
packaging/tizenid.service
plugin/CMakeLists.txt [new file with mode: 0644]
plugin/LICENSE [new file with mode: 0644]
plugin/packaging/system-info-external-plugin.manifest [new file with mode: 0644]
plugin/packaging/system-info-external-plugin.spec [new file with mode: 0644]
plugin/plugin.c [new file with mode: 0644]
src/product_plugin/CMakeLists.txt [new file with mode: 0644]
src/product_plugin/external-plugin.c [new file with mode: 0644]
src/system_info.c
src/system_info_device.c [deleted file]
src/system_info_external.c [new file with mode: 0644]
src/system_info_file.c [moved from src/system_info_no_file.c with 74% similarity]
src/system_info_hardware.c [deleted file]
src/system_info_parse.c
src/system_info_platform.c [deleted file]
src/system_info_screen.c [deleted file]
src/tizenid/CMakeLists.txt
src/tizenid/tizenid.c

index 9aca8cd..884cea9 100644 (file)
@@ -1,6 +1,7 @@
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 SET(fw_name "capi-system-info")
+SET(external_plugin "${fw_name}-plugin")
 
 PROJECT(${fw_name})
 
@@ -27,6 +28,11 @@ IF("${ARCH}" STREQUAL "arm")
 ENDIF("${ARCH}" STREQUAL "arm")
 
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DCONFIG_FILE_PATH=\"${CONFIG_FILE_PATH}\"")
+ADD_DEFINITIONS("-DINFO_FILE_PATH=\"${INFO_FILE_PATH}\"")
+ADD_DEFINITIONS("-DOS_RELEASE_FILE_PATH=\"${OS_RELEASE_FILE_PATH}\"")
+ADD_DEFINITIONS("-DSERIAL_PATH=\"${SERIAL_PATH}\"")
+ADD_DEFINITIONS("-DTIZEN_ID_PATH=\"${TIZEN_ID_PATH}\"")
 ADD_DEFINITIONS("-DSLP_DEBUG")
 
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
@@ -34,7 +40,7 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
 aux_source_directory(src SOURCES)
 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
 
-TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
+TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS} "-ldl")
 
 SET_TARGET_PROPERTIES(${fw_name}
      PROPERTIES
@@ -49,6 +55,7 @@ INSTALL(
         FILES_MATCHING
         PATTERN "*_private.h" EXCLUDE
         PATTERN "*_doc.h" EXCLUDE
+        PATTERN "*_intf.h" EXCLUDE
         PATTERN "${INC_DIR}/*.h"
         )
 
@@ -64,8 +71,21 @@ CONFIGURE_FILE(
 )
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
 
+SET(PLUGIN_PC_NAME ${external_plugin})
+CONFIGURE_FILE(
+    ${PLUGIN_PC_NAME}.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN_PC_NAME}.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN_PC_NAME}.pc DESTINATION lib/pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/system_info_intf.h DESTINATION include/plugin)
+
 ADD_SUBDIRECTORY(src/tizenid)
 
+IF("${PRODUCT_PLUGIN}" STREQUAL "ON")
+       ADD_SUBDIRECTORY(src/product_plugin)
+ENDIF()
+
 IF(UNIX)
 
 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
similarity index 100%
rename from LICENSE
rename to LICENSE.APLv2
diff --git a/NOTICE b/NOTICE
index a64ea2f..8d651da 100644 (file)
--- a/NOTICE
+++ b/NOTICE
@@ -1,3 +1,14 @@
 Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
 Except as noted, this software is licensed under Apache License, Version 2.
-Please, see the LICENSE file for Apache License terms and conditions.
+Please, see the LICENSE.APLv2 file for Apache License terms and conditions.
+
+format_uuid_v3orv5() and uuid_create_sha1_from_name() functions are copyrighted
+by other copyright holder.
+
+Copyright   1990- 1993, 1996 Open Software Foundation, Inc.
+Copyright   1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass.
+Copyright   1998 Microsoft.
+
+format_uuid_v3orv5() and uuid_create_sha1_from_name() functions are licensed under 
+a separate license. Please, see the LICENSE.RFCXXXX file for terms and conditions 
+of the license.
diff --git a/TC/_export_env.sh b/TC/_export_env.sh
deleted file mode 100755 (executable)
index 72a11ec..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-. ./config
-export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh
deleted file mode 100755 (executable)
index 5ddaa53..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-. ./config
-export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
diff --git a/TC/build.sh b/TC/build.sh
deleted file mode 100755 (executable)
index 72aad6c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-. ./_export_env.sh                              # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -c -p ./
-tcc -b -j $JOURNAL_RESULT -p ./
-grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/clean.sh b/TC/clean.sh
deleted file mode 100755 (executable)
index 29743e0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-. ./_export_env.sh                              # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-RESULT_DIR=results
-
-tcc -c -p ./                                # executing tcc, with clean option (-c)
-rm -r $RESULT_DIR
-rm -r tet_tmp_dir
-rm testcase/tet_captured
diff --git a/TC/config b/TC/config
deleted file mode 100755 (executable)
index bc02baf..0000000
--- a/TC/config
+++ /dev/null
@@ -1,3 +0,0 @@
-TET_INSTALL_HOST_PATH=/home/junghyuk/workspace/TETware
-TET_INSTALL_TARGET_PATH=/mnt/nfs/workspace/TETware
-
diff --git a/TC/execute.sh b/TC/execute.sh
deleted file mode 100755 (executable)
index a4f6095..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-. ./_export_target_env.sh                    # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -e -j $JOURNAL_RESULT -p ./
-grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
diff --git a/TC/testcase/Makefile b/TC/testcase/Makefile
deleted file mode 100755 (executable)
index ab8fa69..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-CC = gcc
-
-C_FILES = $(shell ls *.c)
-
-PKGS = capi-system-info dlog glib-2.0
-
-LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
-LDFLAGS += `pkg-config --libs $(PKGS)`
-
-CFLAGS += `pkg-config --cflags $(PKGS)`
-CFLAGS += -I.
-CFLAGS += -I$(TET_ROOT)/inc/tet3
-CFLAGS += -Wall
-
-#TARGETS = $(C_FILES:%.c=tc-%)
-TCS := $(shell ls -1 *.c | cut -d. -f1)
-
-all: $(TCS)
-
-%: %.c
-       $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-clean:
-       rm -f $(TCS)
diff --git a/TC/testcase/tslist b/TC/testcase/tslist
deleted file mode 100755 (executable)
index 3083489..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/testcase/utc_system_info
diff --git a/TC/testcase/utc_system_info.c b/TC/testcase/utc_system_info.c
deleted file mode 100644 (file)
index c68af84..0000000
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <tet_api.h>
-#include <system_info.h>
-
-
-static void startup(void);
-static void cleanup(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-
-#define API_NAME_SYSINFO_ACCESSIBLE "system_info_type_accessible"
-#define API_NAME_SYSINFO_GOOD_VALUE "system_info_good_value"
-#define API_NAME_SYSINFO_SUPPORT_CHECK(key) "system_info_support_check_"#key
-
-/* this is the sting with 2^15 elements, really huge */
-#define HUGE_STRING_LEN 65536
-
-/****************************************************************/
-/* check if all defined types for results are accessible */
-static void utc_system_info_get_int_p(void);
-static void utc_system_info_get_int_n(void);
-static void utc_system_info_get_bool_p(void);
-static void utc_system_info_get_bool_n(void);
-static void utc_system_info_get_string_p(void);
-static void utc_system_info_get_string_n(void);
-static void utc_system_info_get_double_p(void);
-static void utc_system_info_get_double_n(void);
-static void utc_system_info_get_platform_bool(void);
-static void utc_system_info_get_platform_int(void);
-static void utc_system_info_get_platform_double(void);
-static void utc_system_info_get_platform_string(void);
-static void utc_system_info_get_custom_bool(void);
-static void utc_system_info_get_custom_int(void);
-static void utc_system_info_get_custom_double(void);
-static void utc_system_info_get_custom_string(void);
-static void utc_system_info_get_internal_value(void);
-
-/****************************************************************/
-/* check if all particular informations have reasonable values */
-static void utc_system_info_model_p(void);
-static void utc_system_info_tizen_ver_p(void);
-static void utc_system_info_h_res_p(void);
-static void utc_system_info_w_res_p(void);
-static void utc_system_info_platform_name_p(void);
-static void utc_system_info_platform_ver_p(void);
-static void utc_system_info_screen_DPI_p(void);
-static void utc_system_info_core_cpu_arch_p(void);
-static void utc_system_info_core_freq_p(void);
-static void utc_system_info_physical_screen_height_p(void);
-static void utc_system_info_physical_screen_width_p(void);
-static void utc_system_info_build_string_p(void);
-static void utc_system_info_build_date_p(void);
-static void utc_system_info_build_time_p(void);
-static void utc_system_info_manufacturer_p(void);
-static void utc_system_info_tethering_support_key_p(void);
-
-struct tet_testlist tet_testlist[] = {
-       {utc_system_info_get_string_p, 1},
-       {utc_system_info_get_string_n, 1},
-       {utc_system_info_get_double_p, 1},
-       {utc_system_info_get_double_n, 1},
-       {utc_system_info_model_p, 1},
-       {utc_system_info_tizen_ver_p, 1},
-       {utc_system_info_h_res_p, 1},
-       {utc_system_info_w_res_p, 1},
-       {utc_system_info_platform_name_p, 1},
-       {utc_system_info_platform_ver_p, 1},
-       {utc_system_info_core_cpu_arch_p, 1},
-       {utc_system_info_core_freq_p, 1},
-       {utc_system_info_physical_screen_height_p, 1},
-       {utc_system_info_physical_screen_width_p, 1},
-       {utc_system_info_build_string_p, 1},
-       {utc_system_info_build_date_p, 1},
-       {utc_system_info_build_time_p, 1},
-       {utc_system_info_manufacturer_p, 1},
-       {utc_system_info_tethering_support_key_p, 1},
-       {utc_system_info_get_platform_bool, 1},
-       {utc_system_info_get_platform_int, 1},
-       {utc_system_info_get_platform_double, 1},
-       {utc_system_info_get_platform_string, 1},
-       {utc_system_info_get_custom_bool, 1},
-       {utc_system_info_get_custom_int, 1},
-       {utc_system_info_get_custom_double, 1},
-       {utc_system_info_get_custom_string, 1},
-       {utc_system_info_get_internal_value, 1},
-       {NULL, 0},
-};
-
-static void startup(void)
-{
-
-}
-
-static void cleanup(void)
-{
-       /* end of TC */
-}
-
-/****************************************************************/
-/* check if all defined types for results are accessible */
-static void utc_system_info_get_string_p(void)
-{
-       char *value = NULL;
-
-       int retcode = system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &value);
-
-       if (value) {
-               free(value);
-       }
-
-       if (retcode == SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_ACCESSIBLE, "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_ACCESSIBLE, "failed");
-}
-
-static void utc_system_info_get_string_n(void)
-{
-       int retcode = system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, NULL);
-
-       if (retcode != SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_ACCESSIBLE, "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_ACCESSIBLE, "failed");
-}
-
-
-static void utc_system_info_get_double_p(void)
-{
-       double value;
-
-       int retcode = system_info_get_value_double(SYSTEM_INFO_KEY_CORE_CPU_FREQ, &value);
-
-       if (retcode == SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_ACCESSIBLE, "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_ACCESSIBLE, "failed");
-}
-
-static void utc_system_info_get_double_n(void)
-{
-       int retcode = system_info_get_value_double(SYSTEM_INFO_KEY_CORE_CPU_FREQ, NULL);
-
-       if (retcode != SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_ACCESSIBLE, "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_ACCESSIBLE, "failed");
-}
-
-/****************************************************************/
-/* check if all particular informations have reasonable values */
-
-static void utc_system_info_model_p(void)
-{
-       char *string = NULL;
-       int string_len = 0;
-       int result = 0;
-
-       system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &string);
-
-       if (string) {
-               string_len = strlen(string);
-               free(string);
-       }
-
-       result = (string_len < HUGE_STRING_LEN)  &&  (string_len > 0);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_tizen_ver_p(void)
-{
-       char *string = NULL;
-       int string_len = 0;
-       int result = 0;
-
-       system_info_get_value_string(SYSTEM_INFO_KEY_TIZEN_VERSION, &string);
-
-       if (string) {
-               string_len = strlen(string);
-               free(string);
-       }
-
-       result = (string_len < HUGE_STRING_LEN)  &&  (string_len > 0);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_h_res_p(void)
-{
-       int h = -1;
-       int result = 0;
-
-       system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_HEIGHT, &h);
-
-       result = (h > 0)  &&  (h < 10000);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_w_res_p(void)
-{
-       int w = -1;
-       int result = 0;
-
-       system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_WIDTH, &w);
-
-       result = (w > 0)  &&  (w < 10000);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_platform_name_p(void)
-{
-       char *string = NULL;
-       int string_len = 0;
-       int result = 0;
-
-       system_info_get_value_string(SYSTEM_INFO_KEY_PLATFORM_NAME, &string);
-
-       if (string) {
-               string_len = strlen(string);
-               free(string);
-       }
-
-       result = (string_len < HUGE_STRING_LEN)  &&  (string_len > 0);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_platform_ver_p(void)
-{
-       char *string = NULL;
-       int string_len = 0;
-       int result = 0;
-
-       system_info_get_value_string(SYSTEM_INFO_KEY_TIZEN_VERSION_NAME, &string);
-
-       if (string) {
-               string_len = strlen(string);
-               free(string);
-       }
-
-       result = (string_len < HUGE_STRING_LEN)  &&  (string_len > 0);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_core_cpu_arch_p(void)
-{
-       char *string = NULL;
-
-       int result = system_info_get_value_string(SYSTEM_INFO_KEY_CORE_CPU_ARCH, &string);
-
-       if (string) {
-               free(string);
-       }
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 0);
-}
-
-static void utc_system_info_core_freq_p(void)
-{
-       double w = 0;
-       int result = 0;
-
-       system_info_get_value_double(SYSTEM_INFO_KEY_CORE_CPU_FREQ, &w);
-
-       result = (w > 0)  &&  (w < 10000);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_physical_screen_height_p(void)
-{
-       int w = -1;
-       int result = 0;
-
-       system_info_get_value_int(SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT, &w);
-
-       result = (w > 0)  &&  (w < 10000);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_physical_screen_width_p(void)
-{
-       int w = -1;
-       int result = 0;
-
-       system_info_get_value_int(SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH, &w);
-
-       result = (w > 0)  &&  (w < 10000);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_build_string_p(void)
-{
-       char *string = NULL;
-       int string_len = 0;
-       int result = 0;
-
-       system_info_get_value_string(SYSTEM_INFO_KEY_BUILD_STRING, &string);
-
-       if (string) {
-               string_len = strlen(string);
-               free(string);
-       }
-
-       result = (string_len < HUGE_STRING_LEN)  &&  (string_len > 0);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_build_date_p(void)
-{
-       char *string = NULL;
-       int string_len = 0;
-       int result = 0;
-
-       system_info_get_value_string(SYSTEM_INFO_KEY_BUILD_DATE, &string);
-
-       if (string) {
-               string_len = strlen(string);
-               free(string);
-       }
-
-       result = (string_len < HUGE_STRING_LEN)  &&  (string_len > 0);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_build_time_p(void)
-{
-       char *string = NULL;
-       int string_len = 0;
-       int result = 0;
-
-       system_info_get_value_string(SYSTEM_INFO_KEY_BUILD_TIME, &string);
-
-       if (string) {
-               string_len = strlen(string);
-               free(string);
-       }
-
-       result = (string_len < HUGE_STRING_LEN)  &&  (string_len > 0);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_manufacturer_p(void)
-{
-       char *string = NULL;
-       int string_len = 0;
-       int result = 0;
-
-       system_info_get_value_string(SYSTEM_INFO_KEY_MANUFACTURER, &string);
-
-       if (string) {
-               string_len = strlen(string);
-               free(string);
-       }
-
-       result = (string_len < HUGE_STRING_LEN)  &&  (string_len > 0);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_tethering_support_key_p(void)
-{
-       bool supported;
-       int retcode = -1;
-       int i;
-
-       retcode = system_info_get_value_bool(SYSTEM_INFO_KEY_TETHERING_SUPPORTED, &supported);
-
-       if (retcode == SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_SUPPORT_CHECK(i), "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_SUPPORT_CHECK(i), "failed");
-}
-
-static void utc_system_info_get_platform_bool(void)
-{
-       bool supported;
-       int retcode = -1;
-
-       retcode = system_info_get_platform_bool("tizen.org/feature/fmradio", &supported);
-
-       if (retcode == SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_SUPPORT_CHECK(i), "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_SUPPORT_CHECK(i), "failed");
-}
-
-static void utc_system_info_get_platform_int(void)
-{
-       int value = -1;
-       int result = 0;
-
-       system_info_get_platform_int("tizen.org/feature/screen.bpp", &value);
-
-       result = (value > 0)  &&  (value < 10000);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_get_platform_double(void)
-{
-       double value;
-       int retcode = -1;
-
-       retcode = system_info_get_platform_double("tizen.org/feature/double", &value);
-
-       if (retcode != SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_SUPPORT_CHECK(i), "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_SUPPORT_CHECK(i), "failed");
-}
-
-static void utc_system_info_get_platform_string(void)
-{
-       char *string = NULL;
-       int string_len = 0;
-       int result = 0;
-
-       system_info_get_platform_string("tizen.org/system/platform.name", &string);
-
-       if (string) {
-               string_len = strlen(string);
-               free(string);
-       }
-
-       result = (string_len < HUGE_STRING_LEN)  &&  (string_len > 0);
-
-       dts_check_eq(API_NAME_SYSINFO_GOOD_VALUE, result, 1);
-}
-
-static void utc_system_info_get_custom_bool(void)
-{
-       bool value;
-       int retcode = -1;
-
-       retcode = system_info_get_custom_bool("tizen.org/feature/double", &value);
-
-       if (retcode != SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_SUPPORT_CHECK(i), "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_SUPPORT_CHECK(i), "failed");
-}
-
-static void utc_system_info_get_custom_int(void)
-{
-       int value;
-       int retcode = -1;
-
-       retcode = system_info_get_custom_int("tizen.org/feature/double", &value);
-
-       if (retcode != SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_SUPPORT_CHECK(i), "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_SUPPORT_CHECK(i), "failed");
-}
-
-static void utc_system_info_get_custom_double(void)
-{
-       int value;
-       int retcode = -1;
-
-       retcode = system_info_get_custom_double("tizen.org/feature/double", &value);
-
-       if (retcode != SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_SUPPORT_CHECK(i), "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_SUPPORT_CHECK(i), "failed");
-}
-
-static void utc_system_info_get_custom_string(void)
-{
-       char *value = NULL;
-       int retcode = -1;
-
-       retcode = system_info_get_custom_string("tizen.org/feature/double", &value);
-
-       if (value)
-               free(value);
-
-       if (retcode != SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_SUPPORT_CHECK(i), "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_SUPPORT_CHECK(i), "failed");
-}
-
-static void utc_system_info_get_internal_value(void)
-{
-       char *value = NULL;
-       int retcode = -1;
-
-       retcode = system_info_get_internal_value("board.display.height_mm", &value);
-
-       if (value)
-               free(value);
-
-       if (retcode == SYSTEM_INFO_ERROR_NONE)
-               dts_pass(API_NAME_SYSINFO_SUPPORT_CHECK(i), "passed");
-       else
-               dts_fail(API_NAME_SYSINFO_SUPPORT_CHECK(i), "failed");
-}
\ No newline at end of file
diff --git a/TC/tet_scen b/TC/tet_scen
deleted file mode 100755 (executable)
index 03f029a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-all
-       ^TEST
-##### Scenarios for TEST #####
-
-# Test scenario
-TEST
-       :include:/testcase/tslist
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
deleted file mode 100755 (executable)
index f7eda55..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capture option for build operation checking
-TET_BUILD_TOOL=make # build with using make command
-TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build
-TET_API_COMPLIANT=True # use TET API in Test Case ?
-TET_PASS_TC_NAME=True # report passed TC name in Journal file?
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
deleted file mode 100755 (executable)
index 02d7030..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capture option
-TET_CLEAN_TOOL= make clean # clean tool
-TET_CLEAN_FILE= Makefile # file for clean
-TET_API_COMPLIANT=True # TET API useage 
-TET_PASS_TC_NAME=True # showing name , passed TC
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
deleted file mode 100755 (executable)
index ef3e452..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TET_OUTPUT_CAPTURE=True # capturing execution or not
-TET_EXEC_TOOL=  # ex) exec : execution tool set up/ Optional
-TET_EXEC_FILE=   # ex) exectool : execution file/ Optional
-TET_API_COMPLIANT=True # Test case or Tool usesTET API?
-TET_PASS_TC_NAME=True # showing Passed TC name ?
diff --git a/capi-system-info-plugin.pc.in b/capi-system-info-plugin.pc.in
new file mode 100755 (executable)
index 0000000..67c755b
--- /dev/null
@@ -0,0 +1,13 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=/usr/lib
+includedir=/usr/include/plugin
+
+Name: @PLUGIN_PC_NAME@
+Description: capi-system-info plugin library
+Version: @VERSION@
+Requires:
+Cflags: -I${includedir}
+
diff --git a/debian/README b/debian/README
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/debian/capi-system-info-dev.install b/debian/capi-system-info-dev.install
deleted file mode 100644 (file)
index 761a28b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/usr/include/*
-/usr/include/*/*
-/usr/lib/pkgconfig/*.pc
-
diff --git a/debian/capi-system-info-dev.postinst b/debian/capi-system-info-dev.postinst
deleted file mode 100644 (file)
index 1a24852..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#!/bin/sh
diff --git a/debian/capi-system-info.install b/debian/capi-system-info.install
deleted file mode 100644 (file)
index 4a755a4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/usr/lib/lib*.so*
diff --git a/debian/capi-system-info.postinst b/debian/capi-system-info.postinst
deleted file mode 100644 (file)
index 1a24852..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#!/bin/sh
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644 (file)
index 40c9522..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-capi-system-info (0.1.6-1) unstable; urgency=low
-
-  * Support SYSTEM_INFO_KEY_MANUFACTURER, SYSTEM_INFO_KEY_CP_INTERFACE
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.6-1
-
- -- Kwanwoo Nam <kw46.nam@samsung.com>  Thu, 15 Nov 2012 17:00:00 +0900
-
-capi-system-info (0.1.5-10) unstable; urgency=low
-
-  * Add make_info_file.sh
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-10
-
- -- Kwanwoo Nam <kw46.nam@samsung.com>  Thu, 15 Nov 2012 17:00:00 +0900
-
-capi-system-info (0.1.5-9) unstable; urgency=low
-
-  * Fixed some prevent defect cases
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-9
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Fri, 26 Oct 2012 17:00:00 +0900
-
-capi-system-info (0.1.5-8) unstable; urgency=low
-
-  * Remove the dependent with capi-network-wifi & wifi-direct packages
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-8
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Wed, 24 Oct 2012 14:00:00 +0900
-
-capi-system-info (0.1.5-7) unstable; urgency=low
-
-  * Support SYSTEM_INFO_KEY_CORE_CPU_ARCH, SYSTEM_INFO_KEY_CORE_FPU_ARCH in Emulator Environment
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-7
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Wed, 17 Oct 2012 17:00:00 +0900
-
-capi-system-info (0.1.5-6) unstable; urgency=low
-
-  * Fixed prevent defect cases : CID 17696, 14717, 12322, 12323, 14713, 14716, 16983, 14714, 14715, 10432
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-6
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Mon, 15 Oct 2012 15:30:00 +0900
-
-capi-system-info (0.1.5-5) unstable; urgency=low
-
-  * Applying SMACK manifest
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-5
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Fri, 21 Sep 2012 09:30:00 +0900
-
-capi-system-info (0.1.5-4) unstable; urgency=low
-
-  * Bug Fix : Add XFree code after using Xmalloc pointer & fixed DPI calculation code
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-4
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Tue, 11 Sep 2012 15:00:00 +0900
-
-capi-system-info (0.1.5-3) unstable; urgency=low
-
-  * Bug Fix : Add null checking code when IMEI value is null
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-3
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Sat, 08 Sep 2012 19:30:00 +0900
-
-capi-system-info (0.1.5-2) unstable; urgency=low
-
-  * Remove usage of wifi_direct_deinitialize() function
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-2
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Wed, 05 Sep 2012 15:53:00 +0900
-
-capi-system-info (0.1.5-1) unstable; urgency=low
-
-  * Change how to get the camera informations
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-1
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Tue, 04 Sep 2012 16:10:00 +0900
-
-capi-system-info (0.1.5-0) unstable; urgency=low
-
-  * Addded Platform Build Information APIs
-  * Git: /framework/api/system-info
-  * Tag: capi-system-info_0.1.5-0
-
- -- Yang Yonghyun <alex.yang@samsung.com>  Mon, 03 Sep 2012 15:06:00 +0900
-
-capi-system-info (0.1.0-14) unstable; urgency=low
-
-  * Updated supported network-type
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-14
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Fri, 18 May 2012 19:20:13 +0900
-
-capi-system-info (0.1.0-13) unstable; urgency=low
-
-  * Added CSC sales code
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-13
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Thu, 17 May 2012 21:10:23 +0900
-
-capi-system-info (0.1.0-12) unstable; urgency=low
-
-  * Updated Tizen version
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-12
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Mon, 19 Mar 2012 19:25:53 +0900
-
-capi-system-info (0.1.0-11) unstable; urgency=low
-
-  * Updated build configuration
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-11
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Thu, 15 Mar 2012 11:41:29 +0900
-
-capi-system-info (0.1.0-10) unstable; urgency=low
-
-  * Added SYSTEM_INFO_KEY_MOBILE_DEVICE_ID
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-10
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Wed, 07 Mar 2012 16:36:27 +0900
-
-capi-system-info (0.1.0-9) unstable; urgency=low
-
-  * Updated tizen version
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-9
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Wed, 22 Feb 2012 15:23:27 +0900
-
-capi-system-info (0.1.0-8) unstable; urgency=low
-
-  * Added version numbering
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-8
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Wed, 15 Feb 2012 10:56:43 +0900
-
-capi-system-info (0.1.0-7) unstable; urgency=low
-
-  * Updated tizen version
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-7
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Mon, 09 Jan 2012 15:04:37 +0900
-
-capi-system-info (0.1.0-6) unstable; urgency=low
-
-  * Fixed spelling
-  * Fixed invalid key
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-6
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Tue, 20 Dec 2011 16:23:42 +0900
-
-capi-system-info (0.1.0-5) unstable; urgency=low
-
-  * Change type of keys
-  * Git: slp/api/system-info
-  * Tag: capi-system-info_0.1.0-5
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Thu, 15 Dec 2011 07:43:25 +0300
-
-capi-system-info (0.1.0-4) unstable; urgency=low
-
-  * The available keys are changed
-  * The system information changed event is deprecated
-  * Git: slp-source.sec.samsung.net:slp/api/system-info
-  * Tag: capi-system-info_0.1.0-4
-
- -- Junghyuk Park <junghyuk.park@samsung.com>  Tue, 06 Dec 2011 21:29:38 +0900
-
-capi-system-info (0.1.0-3) unstable; urgency=low
-
-  * Using Tizen namespace
-  * Git: slp-source.sec.samsung.net:slp/api/system-info
-  * Tag: capi-system-info_0.1.0-3
-
- -- Kyuhun Jung <kyuhun.jung@samsung.com>  Wed, 23 Nov 2011 07:19:43 +0300
-
-capi-system-info (0.1.0-2) unstable; urgency=low
-
-  * Change system information key and value
-  * Git: slp-source.sec.samsung.net:slp/api/system-info
-  * Tag: capi-system-info_0.1.0-2
-
- -- Kyuhun Jung <kyuhun.jung@samsung.com>  Mon, 21 Nov 2011 09:56:39 +0300
-
-
-capi-system-info (0.1.0-1) unstable; urgency=low
-
-  * Update API descriptions
-  * Git: slp-source.sec.samsung.net:slp/api/system-info
-  * Tag: capi-system-info_0.1.0-1
-
- -- Kyuhun Jung <kyuhun.jung@samsung.com>  Tue, 27 Sep 2011 21:00:50 +0900
-
-capi-system-info (0.0.1-5) unstable; urgency=low
-
-  * Update API descriptions
-  * Git: slp-source.sec.samsung.net:slp/api/system-info
-  * Tag: capi-system-info_0.0.1-5
-
- -- Kyuhun Jung <kyuhun.jung@samsung.com>  Mon, 26 Sep 2011 16:38:58 +0900
-
-capi-system-info (0.0.1-4) unstable; urgency=low
-
-  * Some System Information keys are changed
-  * Git: slp-source.sec.samsung.net:slp/api/system-info
-  * Tag: capi-system-info_0.0.1-4
-
- -- Kyuhun Jung <kyuhun.jung@samsung.com>  Mon, 26 Sep 2011 13:43:35 +0900
-
-capi-system-info (0.0.1-3) unstable; urgency=low
-
-  * SYSTEM_INFO_ERROR_INTERNAL error code is removed
-  * Git: slp-source.sec.samsung.net:slp/api/system-info
-  * Tag: capi-system-info_0.0.1-3
-
- -- Kyuhun Jung <kyuhun.jung@samsung.com>  Thu, 25 Aug 2011 18:41:35 +0900
-
-capi-system-info (0.0.1-2) unstable; urgency=low
-
-  * system_info_get_value_type API is deprecated
-  * Git: slp-source.sec.samsung.net:slp/api/system-info
-  * Tag: capi-system-info_0.0.1-2
-
-
- -- Kyuhun Jung <kyuhun.jung@samsung.com>  Mon, 22 Aug 2011 19:58:48 +0900
-
-capi-system-info (0.0.1-1) unstable; urgency=low
-
-  * Initial upload
-  * Git: slp-source.sec.samsung.net:slp/api/system-info
-  * Tag: capi-system-info_0.0.1-1
-
-
- -- Woongsuk Cho <ws77.cho@samsung.com>  Thu, 04 Aug 2011 17:40:37 +0900
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100755 (executable)
index ee18cd0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Source: capi-system-info
-Section: libs
-Priority: extra
-Maintainer: Woongsuk Cho <ws77.cho@samsung.com>, Kyuhun Jung <kyuhun.jung@samsung.com>
-Build-Depends: debhelper (>= 5), dlog-dev, capi-base-common-dev, libvconf-dev, iniparser-dev, libx11-dev, libslp-tapi-dev
-
-Package: capi-system-info
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: A System Information library in Tizen Native API
-
-Package: capi-system-info-dev
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, capi-system-info (= ${Source-Version}), capi-base-common-dev
-Description: A System Information library in Tizen Native API (DEV)
-
-Package: capi-system-info-dbg
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, capi-system-info (= ${Source-Version})
-Description: A System Information library in Tizen Native API (DBG)
-
diff --git a/debian/rules b/debian/rules
deleted file mode 100755 (executable)
index 7360e1d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/make -f
-
-CFLAGS = -Wall -g
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-else
-       CFLAGS += -O2
-endif
-CMAKE_ROOT_DIR ?= $(CURDIR)
-CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
-
-FULLVER ?= $(shell dpkg-parsechangelog | grep Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
-MAJORVER ?= $(shell echo $(FULLVER) | cut -d '.' -f 1)
-
-configure: configure-stamp
-configure-stamp:
-       dh_testdir
-       mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && cmake .. -DFULLVER=${FULLVER} -DMAJORVER=${MAJORVER}
-       touch configure-stamp
-
-
-build: build-stamp
-build-stamp: configure-stamp 
-       dh_testdir
-       cd $(CMAKE_BUILD_DIR) && $(MAKE)
-       touch $@
-
-clean:
-       cd $(CMAKE_ROOT_DIR)
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp configure-stamp
-       rm -f `find . -name *.pc`
-       rm -rf $(CMAKE_BUILD_DIR)
-       dh_clean
-       
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k 
-       dh_installdirs
-
-       cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-binary-indep: build install
-
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-       dh_installchangelogs 
-       dh_installdocs
-       dh_installexamples
-       dh_install --sourcedir=debian/tmp
-       dh_installman
-       dh_link
-       dh_strip --dbg-package=capi-system-info-dbg
-       dh_fixperms
-       dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
-
index 7e7ffe0..e548840 100644 (file)
@@ -29,7 +29,7 @@
  * @section CAPI_SYSTEM_SYSTEM_INFO_MODULE_OVERVIEW Overview
  * The System Information API provides functions which can be used to obtain system information such as the device API and platform versions, device model number, supported device features, and device screen dimensions.
  * The available system information is stored in key/value pairs. Depending on their respective key, values can have different data types.
- * The keys for the platform functions are specified by the Tizen platform and can be seen <a href="../org.tizen.guides/html/native/system/sysinfo_n.htm">here.</a>
+ * The keys for the platform functions are specified by the Tizen platform and can be seen <a href="https://developer.tizen.org/development/guides/native-application/system/system-information">here.</a>
  * The keys for the custom functions are specified by OEM's and vendors. Developers should check with their OEM's Tizen OS support if they wish to use a custom functions.
  *
  */
index 19e5464..5b0048a 100644 (file)
@@ -32,7 +32,7 @@ extern "C"
 
 /**
  * @brief   Gets the boolean value of the @a platform feature.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @param[in] key The name of the platform feature to get
  * @param[out] value The value of the given platform feature
  * @return  @c 0 on success,
@@ -46,7 +46,7 @@ int system_info_get_platform_bool(const char *key, bool *value);
 
 /**
  * @brief   Gets the integer value of the @a platform feature.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @param[in] key The name of the platform feature to get
  * @param[out] value The value of the given platform feature
  * @return  @c 0 on success,
@@ -60,7 +60,7 @@ int system_info_get_platform_int(const char *key, int *value);
 
 /**
  * @brief   Gets the double value of the @a platform feature.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @param[in] key The name of the platform feature to get
  * @param[out] value The value of the given platform feature
  * @return  @c 0 on success,
@@ -74,7 +74,7 @@ int system_info_get_platform_double(const char *key, double *value);
 
 /**
  * @brief   Gets the string value of the @a platform feature.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @remarks You must release the @a value using free().
  * @param[in] key The name of the platform feature to get
  * @param[out] value The value of the given platform feature
@@ -91,7 +91,7 @@ int system_info_get_platform_string(const char *key, char **value);
 
 /**
  * @brief   Gets the boolean value of the @a custom feature.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @param[in] key The name of the custom feature to get. NOTE: This custom function uses a custom key which is provided by OEM's
  * @param[out] value The value of the given custom feature
  * @return  @c 0 on success,
@@ -105,7 +105,7 @@ int system_info_get_custom_bool(const char *key, bool *value);
 
 /**
  * @brief   Gets the integer value of the @a custom feature.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @param[in] key The name of the custom feature to get. NOTE: This custom function uses a custom key which is provided by OEM's
  * @param[out] value The value of the given custom feature
  * @return  @c 0 on success,
@@ -119,7 +119,7 @@ int system_info_get_custom_int(const char *key, int *value);
 
 /**
  * @brief   Gets the double value of the @a custom feature.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @param[in] key The name of the custom feature to get. NOTE: This custom function uses a custom key which is provided by OEM's
  * @param[out] value The value of the given custom feature
  * @return  @c 0 on success,
@@ -133,7 +133,7 @@ int system_info_get_custom_double(const char *key, double *value);
 
 /**
  * @brief   Gets the string value of the @a custom feature.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @remarks You must release the @a value using free().
  * @param[in] key The name of the custom feature to get. NOTE: This custom function uses a custom key which is provided by OEM's
  * @param[out] value The value of the given custom feature
diff --git a/include/system_info_internal.h b/include/system_info_internal.h
deleted file mode 100644 (file)
index c0b84dc..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __TIZEN_SYSTEM_SYSTEM_INFO_INTERNAL_H__
-#define __TIZEN_SYSTEM_SYSTEM_INFO_INTERNAL_H__
-
-#include "system_info_type.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**
- * @internal
- * @addtogroup CAPI_SYSTEM_SYSTEM_INFO_INTERNAL_MODULE
- * @{
- */
-
-/**
- * @brief Enumeration of key for system information
- */
-typedef enum {
-       SYSTEM_INFO_KEY_MODEL,                  /**< The model of the device */
-       SYSTEM_INFO_KEY_TIZEN_VERSION,          /**< The version of the Tizen API */
-       SYSTEM_INFO_KEY_PLATFORM_NAME,          /**< The name of platform */
-       SYSTEM_INFO_KEY_TIZEN_VERSION_NAME,     /**< The name of tizen version  */
-       SYSTEM_INFO_KEY_MANUFACTURER,           /**< The manufacturer of the device */
-       SYSTEM_INFO_KEY_CORE_CPU_ARCH,          /**< The CORE CPU architecture of model */
-       SYSTEM_INFO_KEY_CORE_CPU_FREQ,          /**< The CORE CPU frequency of model */
-       SYSTEM_INFO_KEY_BUILD_STRING,           /**< The build string of platform binary */
-       SYSTEM_INFO_KEY_BUILD_DATE,             /**< The build date of platform binary */
-       SYSTEM_INFO_KEY_BUILD_TIME,             /**< The build time of platform binary */
-       SYSTEM_INFO_KEY_SCREEN_HEIGHT,          /**< The height of the screen in pixels */
-       SYSTEM_INFO_KEY_SCREEN_WIDTH,           /**< The width of the screen in pixels */
-       SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT, /**< The physical screen height in millimeters */
-       SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH,  /**< The physical screen width in millimeters */
-       SYSTEM_INFO_KEY_TETHERING_SUPPORTED,    /**< Indicates whether the device supports tethering */
-} system_info_key_e;
-
-/**
- * @internal
- * @brief   Gets the integer value of the system information
- * @since_tizen 2.3
- * @param[in] key The name of the system information to get
- * @param[out] value The value of the given system information
- * @return  0 on success, otherwise a negative error value.
- * @retval  #SYSTEM_INFO_ERROR_NONE Successful
- * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
- */
-int system_info_get_value_int(system_info_key_e key, int *value);
-
-/**
- * @internal
- * @brief   Gets the boolean value of the system information
- * @since_tizen 2.3
- * @param[in] key The name of the system information to get
- * @param[out] value The value of the given system information
- * @return  0 on success, otherwise a negative error value.
- * @retval  #SYSTEM_INFO_ERROR_NONE Successful
- * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
- */
-int system_info_get_value_bool(system_info_key_e key, bool *value);
-
-/**
- * @internal
- * @brief   Gets the double value of the system information
- * @since_tizen 2.3
- * @param[in] key The name of the system information to get
- * @param[out] value The value of the given system information
- * @return  0 on success, otherwise a negative error value.
- * @retval  #SYSTEM_INFO_ERROR_NONE Successful
- * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
- */
-int system_info_get_value_double(system_info_key_e key, double *value);
-
-/**
- * @internal
- * @brief   Gets the string value of the system information
- * @since_tizen 2.3
- * @remarks The @a value must be released with @c free() by you.
- * @param[in] key The name of the system information to get
- * @param[out] value The value of the given system information
- * @return  0 on success, otherwise a negative error value.
- * @retval  #SYSTEM_INFO_ERROR_NONE Successful
- * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
- * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system
- */
-int system_info_get_value_string(system_info_key_e key, char **value);
-
-
-/**
- * @internal
- * @brief   Gets the string value of the internal feature
- * @since_tizen 2.3
- * @remarks The @a value must be released with @c free() by you.
- * @param[in] key The name of the internal feature to get
- * @param[out] value The value of the given internal feature
- * @return  0 on success, otherwise a negative error value.
- * @retval  #SYSTEM_INFO_ERROR_NONE Successful
- * @retval  #SYSTEM_INFO_ERROR_OUT_OF_MEMORY Out of memory
- * @retval  #SYSTEM_INFO_ERROR_INVALID_PARAMETER cannot find key in config files
- * @retval  #SYSTEM_INFO_ERROR_IO_ERROR An input/output error occurred when read value from config files
- */
-int system_info_get_internal_value(const char *key, char **value);
-
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_SYSTEM_SYSTEM_INFO_INTERNAL_H__ */
diff --git a/include/system_info_intf.h b/include/system_info_intf.h
new file mode 100644 (file)
index 0000000..1035f2d
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __TIZEN_SYSTEM_SYSTEM_INFO_INTF_H__
+#define __TIZEN_SYSTEM_SYSTEM_INFO_INTF_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stdio.h>
+
+#define TAG_CUSTOM     "custom"
+
+#define TYPE_BOOL      "bool"
+#define TYPE_INT       "int"
+#define TYPE_DBL       "double"
+#define TYPE_STR       "string"
+
+typedef struct {
+       int (*get_value_external)(const char *tag,
+                       const char *key, const char *type,
+                       char *buf, unsigned int len);
+} system_info_external_plugin_interface;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_SYSTEM_SYSTEM_INFO_PRIVATE_H__ */
index 601250e..392e82d 100644 (file)
@@ -23,31 +23,27 @@ extern "C"
 {
 #endif
 
-#include "system_info_internal.h"
+#include <stdbool.h>
+#include <dlog.h>
 
 #ifndef API
 #define API __attribute__ ((visibility("default")))
 #endif
 
-#define INFO_FILE_PATH "/etc/info.ini"
-#define OS_RELEASE_FILE_PATH "/etc/os-release"
-#define CPU_INFO_FILE_PATH "/proc/cpuinfo"
-#define CPU_INFO_MAX_FREQ_PATH "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"
-#define CONFIG_FILE_PATH "/etc/config/model-config.xml"
-#define SERIAL_PATH "/csa/imei/serialno.dat"
-#define MAXBUFSIZE 512
+#undef LOG_TAG
+#define LOG_TAG "CAPI_SYSTEM_INFO"
+#define _D(fmt, args...)   SLOGD(fmt, ##args)
+#define _E(fmt, args...)   SLOGE(fmt, ##args)
+#define _I(fmt, args...)   SLOGI(fmt, ##args)
 
 #define PLATFORM_TAG   "platform"
 #define CUSTOM_TAG             "custom"
-#define INTERNAL_TAG   "internal"
 
 #define BOOL_TYPE      "bool"
 #define INT_TYPE       "int"
 #define DBL_TYPE       "double"
 #define STR_TYPE       "string"
 
-#define BOARD_CONFIG   "board"
-
 typedef enum {
        SYSTEM_INFO_DATA_TYPE_STRING,
        SYSTEM_INFO_DATA_TYPE_INT,
@@ -55,47 +51,18 @@ typedef enum {
        SYSTEM_INFO_DATA_TYPE_BOOL
 } system_info_data_type_e;
 
-/**
- * @brief Enumeration of Mode type
- */
-typedef enum {
-       SYSTEM_INFO_MODEL_TYPE_EMULATOR,
-       SYSTEM_INFO_MODEL_TYPE_TARGET
-} system_info_mode_type_e;
-
-typedef int (*system_info_get_value_cb) (system_info_key_e key, system_info_data_type_e data_type, void **value);
-
-system_info_mode_type_e system_info_get_system_info_model_type(void);
-
 int system_info_ini_get_string(char *ini_file, char *key, char **output);
-int system_info_get_value_from_xml(char *xml_file_path, char *model, char *id_field, char **value);
 int system_info_get_value_from_config_xml(char *feature_tag, const char *name_field, char *type_field, char **value);
 
-int system_info_get_bsp_info(const char *key, char **value);
-
 int system_info_vconf_get_value_int(const char *vconf_key, int *value);
 int system_info_vconf_get_value_bool(const char *vconf_key, bool *value);
 int system_info_vconf_get_value_double(const char *vconf_key, double *value);
 int system_info_vconf_get_value_string(const char *vconf_key, char **value);
 
-int system_info_get_model(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_tizen_version(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_platform_name(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_tizen_version_name(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_core_cpu_arch(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_core_cpu_freq(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_physical_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_physical_screen_width(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_build_string(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_build_date(system_info_key_e key, system_info_data_type_e data_type, void **value);
-int system_info_get_build_time(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_no_file(const char *key, void **value);
 
+int external_get_value(const char *tag, const char *key, const char *type, char **value);
+
 #ifdef __cplusplus
 }
 #endif
index 999b22d..38cc0e1 100644 (file)
@@ -32,7 +32,6 @@ extern "C"
 
 /**
  * @brief Enumeration of error codes for system information
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
 typedef enum {
        SYSTEM_INFO_ERROR_NONE              = TIZEN_ERROR_NONE,          /**< Successful */
index e515dca..fe4ebee 100644 (file)
@@ -4,5 +4,6 @@
        </request>
        <assign>
                <filesystem path="/etc/make_info_file.sh" exec_label="none" />
+               <filesystem path="/usr/bin/tizen_id" exec_label="none" />
        </assign>
 </manifest>
index 34b9e6d..b29904b 100644 (file)
@@ -13,7 +13,7 @@ BuildRequires:        pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(iniparser)
 BuildRequires: pkgconfig(libxml-2.0)
 BuildRequires: pkgconfig(openssl)
-BuildRequires: pkgconfig(cryptsvc)
+BuildRequires: pkgconfig(glib-2.0)
 
 Requires(post):        /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -33,9 +33,30 @@ Requires: %{name} = %{version}-%{release}
 %setup -q
 cp %{SOURCE1001} .
 
+%define config_file_path /etc/config/model-config.xml
+%define info_file_path /etc/info.ini
+%define os_release_file_path /etc/os-release
+%define serial_path /csa/imei/serialno.dat
+
+# tizenid.service should be changed if the path is changed
+%define tizen_id_path /etc/tizenid
+
+%if "%{?tizen_profile_name}" == "tv"
+%define product_plugin ON
+%else
+%define product_plugin OFF
+%endif
+
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+cmake . -DCMAKE_INSTALL_PREFIX=/usr \
+               -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+               -DCONFIG_FILE_PATH=%{config_file_path} \
+               -DINFO_FILE_PATH=%{info_file_path} \
+               -DOS_RELEASE_FILE_PATH=%{os_release_file_path} \
+               -DSERIAL_PATH=%{serial_path} \
+               -DTIZEN_ID_PATH=%{tizen_id_path} \
+               -DPRODUCT_PLUGIN=%{product_plugin}
 
 make %{?jobs:-j%jobs}
 
@@ -44,7 +65,7 @@ rm -rf %{buildroot}
 
 %make_install
 mkdir -p %{buildroot}/usr/share/license
-cp -f LICENSE %{buildroot}/usr/share/license/%{name}
+cp -f LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
 
 mkdir -p %{buildroot}/etc
 cp -f script/make_info_file.sh %{buildroot}/etc/make_info_file.sh
@@ -63,14 +84,21 @@ ln -s ../tizenid.service %{buildroot}%{_libdir}/systemd/system/multi-user.target
 /usr/share/license/%{name}
 %{_libdir}/libcapi-system-info.so.*
 %attr(0744,root,-) /etc/make_info_file.sh
+
+#tizenid
 %{_bindir}/tizen_id
 %{_libdir}/systemd/system/tizenid.service
 %{_libdir}/systemd/system/multi-user.target.wants/tizenid.service
 
+#product plugin
+%if %{?product_plugin} == ON
+%{_libdir}/libsystem-info-external-plugin.so
+%endif
+
 %files devel
 %manifest %{name}.manifest
 %{_includedir}/system/system_info.h
 %{_includedir}/system/system_info_type.h
-%{_includedir}/system/system_info_internal.h
+%{_includedir}/plugin/system_info_intf.h
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/libcapi-system-info.so
index 9333789..0909e37 100644 (file)
@@ -1,10 +1,10 @@
 [Unit]
 Description=Making Tizen ID
-Requires=opt-usr.mount
 
 [Service]
-Type=simple
+Type=oneshot
 ExecStart=/usr/bin/tizen_id
+ExecStartPost=/usr/bin/chsmack -a '_' /etc/tizenid
 
 [Install]
 WantedBy=multi-user.target
diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ef9edef
--- /dev/null
@@ -0,0 +1,20 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(SYSINFO_PLUGIN system-info-external-plugin)
+SET(SRCS plugin.c)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${SYSINFO_PLUGIN} REQUIRED
+               dlog
+               capi-system-info-plugin
+)
+
+FOREACH(flag ${${SYSINFO_PLUGIN}_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_LIBRARY(${SYSINFO_PLUGIN} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${SYSINFO_PLUGIN} ${${SYSINFO_PLUGIN}_LDFLAGS})
+INSTALL(TARGETS ${SYSINFO_PLUGIN} DESTINATION lib COMPONENT RuntimeLibraries)
diff --git a/plugin/LICENSE b/plugin/LICENSE
new file mode 100644 (file)
index 0000000..261eeb9
--- /dev/null
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/plugin/packaging/system-info-external-plugin.manifest b/plugin/packaging/system-info-external-plugin.manifest
new file mode 100644 (file)
index 0000000..97e8c31
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_"/>
+       </request>
+</manifest>
diff --git a/plugin/packaging/system-info-external-plugin.spec b/plugin/packaging/system-info-external-plugin.spec
new file mode 100644 (file)
index 0000000..ca32cd2
--- /dev/null
@@ -0,0 +1,42 @@
+Name:          system-info-external-plugin
+Summary:       External plugin for System information library
+Version:       0.0.1
+Release:       1
+Group:         System/Libraries
+License:       Apache License, Version 2.0
+Source0:       %{name}-%{version}.tar.gz
+Source1001:    %{name}.manifest
+BuildRequires: cmake
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(capi-system-info-plugin)
+
+Requires(post):        /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+
+%build
+cmake . -DCMAKE_INSTALL_PREFIX=/usr
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+
+%make_install
+mkdir -p %{buildroot}/usr/share/license
+cp -f LICENSE %{buildroot}/usr/share/license/%{name}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+%files
+%manifest %{name}.manifest
+/usr/share/license/%{name}
+%{_libdir}/libsystem-info-external-plugin.so
diff --git a/plugin/plugin.c b/plugin/plugin.c
new file mode 100644 (file)
index 0000000..aec341d
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <dlog.h>
+#include <errno.h>
+
+#include <system_info_intf.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "SYSTEM_INFO_PLUGIN"
+
+#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
+
+static int get_sample(char *buf, unsigned int len)
+{
+       snprintf(buf, len, "Sample value");
+       return 0;
+}
+
+static const struct external_system_info_key {
+       const char *key;
+       const char *tag;
+       const char *type;
+       int (*get_value)(char *buf, unsigned int len);
+} system_info_key[] = {
+       { "http://developer.tizen.org/tizen/sample"     , TAG_CUSTOM, TYPE_STR, get_sample      },
+};
+
+static int get_value_external(const char *tag,
+               const char *key, const char *type,
+               char *buf, unsigned int len)
+{
+       int i;
+       int key_len, tag_len, type_len;
+
+       if (!tag || !key || !type || !buf)
+               return -EINVAL;
+
+       key_len = strlen(key);
+       tag_len = strlen(tag);
+       type_len = strlen(type);
+       if (key_len == 0 || tag_len == 0 || type_len == 0)
+               return -EINVAL;
+
+       for (i = 0 ; i < ARRAY_SIZE(system_info_key) ; i++) {
+               if (strncmp(system_info_key[i].type, type, type_len))
+                       continue;
+               if (strncmp(system_info_key[i].tag, tag, tag_len))
+                       continue;
+               if (strncmp(system_info_key[i].key, key, key_len))
+                       continue;
+
+               if (system_info_key[i].get_value)
+                       return system_info_key[i].get_value(buf, len);
+       }
+
+       LOGE("Failed to find system info key in the plugin (%s)", key);
+       return -EINVAL;
+}
+
+const system_info_external_plugin_interface external_plugin = {
+       .get_value_external = get_value_external,
+};
+
+API const system_info_external_plugin_interface *system_info_get_external_plugin_interface(void)
+{
+       return &external_plugin;
+}
diff --git a/src/product_plugin/CMakeLists.txt b/src/product_plugin/CMakeLists.txt
new file mode 100644 (file)
index 0000000..adf218a
--- /dev/null
@@ -0,0 +1,21 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(SYSINFO_PLUGIN system-info-external-plugin)
+SET(SRCS external-plugin.c)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${SYSINFO_PLUGIN} REQUIRED
+               dlog
+)
+
+FOREACH(flag ${${SYSINFO_PLUGIN}_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+
+ADD_LIBRARY(${SYSINFO_PLUGIN} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${SYSINFO_PLUGIN} ${${SYSINFO_PLUGIN}_LDFLAGS})
+INSTALL(TARGETS ${SYSINFO_PLUGIN} DESTINATION lib COMPONENT RuntimeLibraries)
diff --git a/src/product_plugin/external-plugin.c b/src/product_plugin/external-plugin.c
new file mode 100644 (file)
index 0000000..37de079
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <dlog.h>
+
+#include <system_info_intf.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "CAPI_SYSTEM_INFO"
+
+#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
+
+static int get_region_kind(char *buf, unsigned int len)
+{
+       snprintf(buf, len, "USA");
+       return 0;
+}
+
+static int get_local_set(char *buf, unsigned int len)
+{
+       snprintf(buf, len, "us");
+       return 0;
+}
+
+static int get_panel_resolution_width(char *buf, unsigned int len)
+{
+       snprintf(buf, len, "1920");
+       return 0;
+}
+static int get_panel_resolution_height(char *buf, unsigned int len)
+{
+       snprintf(buf, len, "1080");
+       return 0;
+}
+static int get_tv_year(char *buf, unsigned int len)
+{
+       snprintf(buf, len, "2015");
+       return 0;
+}
+static int get_ttv_supported(char *buf, unsigned int len)
+{
+       snprintf(buf, len, "true");
+       return 0;
+}
+static int get_tv_chip_type(char *buf, unsigned int len)
+{
+       snprintf(buf, len, "HAWKP UHD 2015");
+       return 0;
+}
+
+static const struct external_system_info_key {
+       const char *key;
+       const char *tag;
+       const char *type;
+       int (*get_value)(char *buf, unsigned int len);
+} system_info_key[] = {
+       { "http://developer.samsung.com/tizen/system/region_kind"       , TAG_CUSTOM, TYPE_STR, get_region_kind },
+       { "http://developer.samsung.com/tizen/system/local_set"         , TAG_CUSTOM, TYPE_STR, get_local_set },
+       { "http://developer.samsung.com/tizen/system/panel_resolution_width"    , TAG_CUSTOM, TYPE_INT, get_panel_resolution_width },
+       { "http://developer.samsung.com/tizen/system/panel_resolution_height"   , TAG_CUSTOM, TYPE_INT, get_panel_resolution_height },
+       { "http://developer.samsung.com/tizen/system/tv_year"           , TAG_CUSTOM, TYPE_INT, get_tv_year },
+       { "http://developer.samsung.com/tizen/system/ttv_supported"     , TAG_CUSTOM, TYPE_BOOL, get_ttv_supported },
+       { "http://developer.samsung.com/tizen/system/tv_chip_type"      , TAG_CUSTOM, TYPE_STR, get_tv_chip_type },
+};
+
+static int get_value_external(const char *tag,
+               const char *key, const char *type,
+               char *buf, unsigned int len)
+{
+       int i;
+       int key_len, tag_len, type_len;
+
+       if (!tag || !key || !type || !buf)
+               return -EINVAL;
+
+       key_len = strlen(key);
+       tag_len = strlen(tag);
+       type_len = strlen(type);
+       if (key_len == 0 || tag_len == 0 || type_len == 0)
+               return -EINVAL;
+
+       for (i = 0 ; i < ARRAY_SIZE(system_info_key) ; i++) {
+               if (strncmp(system_info_key[i].type, type, type_len))
+                       continue;
+               if (strncmp(system_info_key[i].tag, tag, tag_len))
+                       continue;
+               if (strncmp(system_info_key[i].key, key, key_len))
+                       continue;
+
+               if (system_info_key[i].get_value)
+                       return system_info_key[i].get_value(buf, len);
+       }
+
+       LOGE("Failed to find system info key in the plugin (%s)", key);
+       return -EINVAL;
+}
+
+const system_info_external_plugin_interface external_plugin = {
+       .get_value_external = get_value_external,
+};
+
+API const system_info_external_plugin_interface *system_info_get_external_plugin_interface(void)
+{
+       return &external_plugin;
+}
index 2b452e4..5815454 100644 (file)
 #include <unistd.h>
 #include <ctype.h>
 
-#include <dlog.h>
-
 #include <system_info.h>
 #include <system_info_private.h>
 #include <sys/utsname.h>
 
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
 #define SYSTEM_INFO_MAX -1
 
-typedef struct {
-       system_info_key_e key;
-       system_info_data_type_e data_type;
-       system_info_get_value_cb get_value_cb;
-} system_info_s;
-
-typedef system_info_s * system_info_h;
-
-system_info_s system_info_table[] = {
-
-{
-        /**< The model of the device */
-       SYSTEM_INFO_KEY_MODEL,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_model
-},
-
-{
-        /**< The version of the Tizen supported by the platform */
-       SYSTEM_INFO_KEY_TIZEN_VERSION,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_tizen_version
-},
-
-{
-       /**< The height of the screen in pixels */
-       SYSTEM_INFO_KEY_SCREEN_HEIGHT,
-       SYSTEM_INFO_DATA_TYPE_INT,
-       system_info_get_screen_height
-},
-
-{
-       /**< The width of the screen in pixels */
-       SYSTEM_INFO_KEY_SCREEN_WIDTH,
-       SYSTEM_INFO_DATA_TYPE_INT,
-       system_info_get_screen_width
-},
-
-{
-       /**< The Name of the Platform */
-       SYSTEM_INFO_KEY_PLATFORM_NAME,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_platform_name
-},
-
-{
-       /**< The Name of the Tizen version */
-       SYSTEM_INFO_KEY_TIZEN_VERSION_NAME,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_tizen_version_name
-},
-
-{
-       /**< The CORE CPU architecture of model */
-       SYSTEM_INFO_KEY_CORE_CPU_ARCH,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_core_cpu_arch
-},
-
-{
-       /**< The CORE CPU frequency of model */
-       SYSTEM_INFO_KEY_CORE_CPU_FREQ,
-       SYSTEM_INFO_DATA_TYPE_DOUBLE,
-       system_info_get_core_cpu_freq
-},
-
-{
-       /**< The height of the physical screen size in millimeters */
-       SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT,
-       SYSTEM_INFO_DATA_TYPE_INT,
-       system_info_get_physical_screen_height
-},
-
-{
-       /**< The width of the physical screen size in millimeters */
-       SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH,
-       SYSTEM_INFO_DATA_TYPE_INT,
-       system_info_get_physical_screen_width
-},
-
-{
-       /**< The build string of the platform binary */
-       SYSTEM_INFO_KEY_BUILD_STRING,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_build_string
-},
-
-{
-       /**< The build date of the platform binary */
-       SYSTEM_INFO_KEY_BUILD_DATE,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_build_date
-},
-
-{
-       /**< The build time of the platform binary */
-       SYSTEM_INFO_KEY_BUILD_TIME,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_build_time
-},
-
-{
-       /**< The manufacturer of the device */
-       SYSTEM_INFO_KEY_MANUFACTURER,
-       SYSTEM_INFO_DATA_TYPE_STRING,
-       system_info_get_manufacturer
-},
-
-{
-       /**< Indicates whether the device supports tethering */
-       SYSTEM_INFO_KEY_TETHERING_SUPPORTED,
-       SYSTEM_INFO_DATA_TYPE_BOOL,
-       system_info_get_tethering_supported
-},
-
-{
-       SYSTEM_INFO_MAX, -1, NULL
-}
-
-};
-
-static system_info_mode_type_e system_info_system_info_model_type;
-
-system_info_mode_type_e system_info_get_system_info_model_type(void)
-{
-       return system_info_system_info_model_type;
-}
-
-void __attribute__((constructor)) system_info_init(void)
-{
-       int ret, len, i;
-       char *str = NULL;
-
-       ret = system_info_get_platform_string("tizen.org/system/model_name", &str);
-
-       if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("initialize error");
-               return;
-       }
-
-       if (!str) {
-               LOGE("Failed to get model name");
-               return;
-       }
-
-       len = strlen(str);
-       for (i = 0 ; i < len ; i++) {
-               str[i] = toupper(str[i]);
-       }
-
-       if (!strcmp(str, "EMULATOR"))
-               system_info_system_info_model_type = SYSTEM_INFO_MODEL_TYPE_EMULATOR;
-       else
-               system_info_system_info_model_type = SYSTEM_INFO_MODEL_TYPE_TARGET;
-
-       free(str);
-}
-
-static int system_info_get(system_info_key_e key, system_info_h *system_info)
-{
-       int index = 0;
-
-       while (system_info_table[index].key != SYSTEM_INFO_MAX) {
-               if (system_info_table[index].key == key) {
-                       *system_info = &system_info_table[index];
-                       return 0;
-               }
-
-               index++;
-       }
-
-       return -1;
-}
-
-int system_info_get_value(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       system_info_h system_info;
-       system_info_get_value_cb system_info_getter;
-
-       if (value == NULL) {
-               LOGE("INVALID_PARAMETER(0x%08x) : invalid output param", SYSTEM_INFO_ERROR_INVALID_PARAMETER);
-               return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
-       }
-
-       if (system_info_get(key, &system_info)) {
-               LOGE("INVALID_PARAMETER(0x%08x) : invalid key", SYSTEM_INFO_ERROR_INVALID_PARAMETER);
-               return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
-       }
-
-       if (system_info->data_type != data_type) {
-               LOGE("INVALID_PARAMETER(0x%08x) : invalid data type", SYSTEM_INFO_ERROR_INVALID_PARAMETER);
-               return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
-       }
-
-       system_info_getter = system_info->get_value_cb;
-
-       if (system_info_getter == NULL) {
-               LOGE("IO_ERROR(0x%08x) : failed to call getter for the system information", SYSTEM_INFO_ERROR_IO_ERROR);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       return system_info_getter(key, system_info->data_type, value);
-}
-
-API int system_info_get_value_int(system_info_key_e key, int *value)
-{
-       return system_info_get_value(key, SYSTEM_INFO_DATA_TYPE_INT, (void **)value);
-}
-
-API int system_info_get_value_bool(system_info_key_e key, bool *value)
-{
-       return system_info_get_value(key, SYSTEM_INFO_DATA_TYPE_BOOL, (void **)value);
-}
-
-API int system_info_get_value_double(system_info_key_e key, double *value)
-{
-       return system_info_get_value(key, SYSTEM_INFO_DATA_TYPE_DOUBLE, (void **)value);
-}
-
-API int system_info_get_value_string(system_info_key_e key, char **value)
-{
-       return system_info_get_value(key, SYSTEM_INFO_DATA_TYPE_STRING, (void **)value);
-}
-
 API int system_info_get_platform_bool(const char *key, bool *value)
 {
        int ret;
@@ -268,7 +36,7 @@ API int system_info_get_platform_bool(const char *key, bool *value)
        supported = (bool *)value;
 
        if (access(CONFIG_FILE_PATH, R_OK)) {
-               LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+               _E("cannot find file %s!!!", CONFIG_FILE_PATH);
                if (errno == EPERM || errno == EACCES)
                        return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
                return SYSTEM_INFO_ERROR_IO_ERROR;
@@ -276,7 +44,7 @@ API int system_info_get_platform_bool(const char *key, bool *value)
 
        ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, BOOL_TYPE, &string);
        if (ret) {
-               LOGE("cannot get %s", key);
+               _E("cannot get %s", key);
                return ret;
        }
 
@@ -299,7 +67,7 @@ API int system_info_get_platform_int(const char *key, int *value)
        ret_val = (int *)value;
 
        if (access(CONFIG_FILE_PATH, R_OK)) {
-               LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+               _E("cannot find file %s!!!", CONFIG_FILE_PATH);
                if (errno == EPERM || errno == EACCES)
                        return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
                return SYSTEM_INFO_ERROR_IO_ERROR;
@@ -307,7 +75,7 @@ API int system_info_get_platform_int(const char *key, int *value)
 
        ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, INT_TYPE, &string);
        if (ret) {
-               LOGE("cannot get %s", key);
+               _E("cannot get %s", key);
                return ret;
        }
 
@@ -327,7 +95,7 @@ API int system_info_get_platform_double(const char *key, double *value)
        ret_val = (double *)value;
 
        if (access(CONFIG_FILE_PATH, R_OK)) {
-               LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+               _E("cannot find file %s!!!", CONFIG_FILE_PATH);
                if (errno == EPERM || errno == EACCES)
                        return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
                return SYSTEM_INFO_ERROR_IO_ERROR;
@@ -335,7 +103,7 @@ API int system_info_get_platform_double(const char *key, double *value)
 
        ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, DBL_TYPE, &string);
        if (ret) {
-               LOGE("cannot get %s", key);
+               _E("cannot get %s", key);
                return ret;
        }
 
@@ -352,7 +120,7 @@ API int system_info_get_platform_string(const char *key, char **value)
        char *string = NULL;
 
        if (access(CONFIG_FILE_PATH, R_OK)) {
-               LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+               _E("cannot find file %s!!!", CONFIG_FILE_PATH);
                if (errno == EPERM || errno == EACCES)
                        return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
                return SYSTEM_INFO_ERROR_IO_ERROR;
@@ -366,7 +134,7 @@ API int system_info_get_platform_string(const char *key, char **value)
 
        ret = system_info_get_value_from_config_xml(PLATFORM_TAG, key, STR_TYPE, &string);
        if (ret) {
-               LOGE("cannot get %s", key);
+               _E("cannot get %s", key);
                return ret;
        }
 
@@ -384,7 +152,7 @@ API int system_info_get_custom_bool(const char *key, bool *value)
        supported = (bool *)value;
 
        if (access(CONFIG_FILE_PATH, R_OK)) {
-               LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+               _E("cannot find file %s!!!", CONFIG_FILE_PATH);
                if (errno == EPERM || errno == EACCES)
                        return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
                return SYSTEM_INFO_ERROR_IO_ERROR;
@@ -392,8 +160,12 @@ API int system_info_get_custom_bool(const char *key, bool *value)
 
        ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, BOOL_TYPE, &string);
        if (ret) {
-               LOGE("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
-               return ret;
+               _I("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
+               ret = external_get_value(CUSTOM_TAG, key, BOOL_TYPE, &string);
+               if (ret) {
+                       _E("Cannot find key (%s) in the plugin (%d)", key, ret);
+                       return ret;
+               }
        }
 
        if (!strcmp(string, "true") || !strcmp(string, "TRUE"))
@@ -415,7 +187,7 @@ API int system_info_get_custom_int(const char *key, int *value)
        ret_val = (int *)value;
 
        if (access(CONFIG_FILE_PATH, R_OK)) {
-               LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+               _E("cannot find file %s!!!", CONFIG_FILE_PATH);
                if (errno == EPERM || errno == EACCES)
                        return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
                return SYSTEM_INFO_ERROR_IO_ERROR;
@@ -423,8 +195,12 @@ API int system_info_get_custom_int(const char *key, int *value)
 
        ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, INT_TYPE, &string);
        if (ret) {
-               LOGE("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
-               return ret;
+               _I("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
+               ret = external_get_value(CUSTOM_TAG, key, INT_TYPE, &string);
+               if (ret) {
+                       _E("Cannot find key (%s) in the plugin (%d)", key, ret);
+                       return ret;
+               }
        }
 
        *ret_val = atoi(string);
@@ -443,7 +219,7 @@ API int system_info_get_custom_double(const char *key, double *value)
        ret_val = (double *)value;
 
        if (access(CONFIG_FILE_PATH, R_OK)) {
-               LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+               _E("cannot find file %s!!!", CONFIG_FILE_PATH);
                if (errno == EPERM || errno == EACCES)
                        return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
                return SYSTEM_INFO_ERROR_IO_ERROR;
@@ -451,8 +227,12 @@ API int system_info_get_custom_double(const char *key, double *value)
 
        ret = system_info_get_value_from_config_xml(CUSTOM_TAG, key, DBL_TYPE, &string);
        if (ret) {
-               LOGE("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
-               return ret;
+               _I("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
+               ret = external_get_value(CUSTOM_TAG, key, DBL_TYPE, &string);
+               if (ret) {
+                       _E("Cannot find key (%s) in the plugin (%d)", key, ret);
+                       return ret;
+               }
        }
 
        *ret_val = atof(string);
@@ -468,7 +248,7 @@ API int system_info_get_custom_string(const char *key, char **value)
        char *string = NULL;
 
        if (access(CONFIG_FILE_PATH, R_OK)) {
-               LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
+               _E("cannot find file %s!!!", CONFIG_FILE_PATH);
                if (errno == EPERM || errno == EACCES)
                        return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
                return SYSTEM_INFO_ERROR_IO_ERROR;
@@ -476,38 +256,12 @@ API int system_info_get_custom_string(const char *key, char **value)
 
        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;
-}
-
-API int system_info_get_internal_value(const char *key, char **value)
-{
-       int ret, len;
-       char *string = NULL;
-
-       len = strlen(BOARD_CONFIG);
-
-       if (!strncmp(key, BOARD_CONFIG, len)) {
-               if (system_info_get_bsp_info(key, value) == SYSTEM_INFO_ERROR_NONE)
-                       return SYSTEM_INFO_ERROR_NONE;
-       }
-
-       if (access(CONFIG_FILE_PATH, R_OK)) {
-               LOGE("cannot find file %s!!!", CONFIG_FILE_PATH);
-               if (errno == EPERM || errno == EACCES)
-                       return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
-               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;
+               _I("cannot get %s info from %s!!!", key, CONFIG_FILE_PATH);
+               ret = external_get_value(CUSTOM_TAG, key, STR_TYPE, &string);
+               if (ret) {
+                       _E("Cannot find key (%s) in the plugin (%d)", key, ret);
+                       return ret;
+               }
        }
 
        *value = string;
diff --git a/src/system_info_device.c b/src/system_info_device.c
deleted file mode 100644 (file)
index 64655df..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <dlog.h>
-
-#include <system_info.h>
-#include <system_info_private.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
-#define TETHERING_INFO_FILE_PATH "/etc/config/connectivity/sysinfo-tethering.xml"
-
-int system_info_get_manufacturer(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       char *manufacturer = NULL;
-
-       manufacturer = strdup("samsung");
-       if (manufacturer == NULL) {
-               LOGE("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
-               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-       }
-
-       *value = manufacturer;
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_tethering_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(TETHERING_INFO_FILE_PATH, R_OK)) {
-                       *supported = false;
-                       return SYSTEM_INFO_ERROR_NONE;
-       }
-
-       if (system_info_get_value_from_xml(TETHERING_INFO_FILE_PATH, model, "tethering-support", &string)) {
-                       LOGE("cannot get tethering-support info from %s!!!", TETHERING_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;
-}
diff --git a/src/system_info_external.c b/src/system_info_external.c
new file mode 100644 (file)
index 0000000..73d68ff
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * system-info
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "system_info_private.h"
+#include "system_info_type.h"
+#include "system_info_intf.h"
+#include <string.h>
+#include <unistd.h>
+#include <dlfcn.h>
+
+#define BUF_MAX 256
+
+#define EXTERNAL_SYSTEM_INFO "/usr/lib/libsystem-info-external-plugin.so"
+
+int external_get_value(const char *tag, const char *key,
+               const char *type, char **val)
+{
+       void *handle = NULL;
+       int ret;
+       char buf[BUF_MAX];
+       const system_info_external_plugin_interface *plugin;
+       const system_info_external_plugin_interface *(*system_info_get_external_plugin_interface)(void);
+
+
+       if (access(EXTERNAL_SYSTEM_INFO, F_OK) != 0) {
+               _E("No external system info library");
+               return SYSTEM_INFO_ERROR_IO_ERROR;
+       }
+
+       handle = dlopen(EXTERNAL_SYSTEM_INFO, RTLD_NOW);
+       if (!handle) {
+               _E("dlopen(%s) failed(%s)", EXTERNAL_SYSTEM_INFO, dlerror());
+               ret = SYSTEM_INFO_ERROR_IO_ERROR;
+               goto out;
+       }
+
+       system_info_get_external_plugin_interface = dlsym(handle, "system_info_get_external_plugin_interface");
+       if (!system_info_get_external_plugin_interface) {
+               _E("dlsym failed(%s)", dlerror());
+               ret = SYSTEM_INFO_ERROR_IO_ERROR;
+               goto out;
+       }
+
+       plugin = system_info_get_external_plugin_interface();
+       if (!plugin) {
+               _E("Failed to get plugin");
+               ret = SYSTEM_INFO_ERROR_IO_ERROR;
+               goto out;
+       }
+
+       if (plugin->get_value_external == NULL) {
+               _E("Invalid plugin function");
+               ret = SYSTEM_INFO_ERROR_IO_ERROR;
+               goto out;
+       }
+
+       ret = plugin->get_value_external(tag, key, type, buf, sizeof(buf));
+       if (ret < 0) {
+               _E("Failed to get value from plugin (ret:%d)", ret);
+               ret = SYSTEM_INFO_ERROR_IO_ERROR;
+               goto out;
+       }
+
+       *val = strdup(buf);
+       if (*val == NULL) {
+               _E("strdup() failed");
+               ret = SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
+               goto out;
+       }
+
+       ret = SYSTEM_INFO_ERROR_NONE;
+
+out:
+       if (handle)
+               dlclose(handle);
+
+       return ret;
+}
similarity index 74%
rename from src/system_info_no_file.c
rename to src/system_info_file.c
index 95d94c1..3753b77 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include <dlog.h>
-
 #include <system_info.h>
 #include <system_info_private.h>
 
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
 #define SERIAL_TOK_DELIMITER ","
 #define BUF_MAX 256
 
-#define TIZEN_ID_PATH  "/opt/home/root/tizenid"
-
 static int get_tizenid(char **value)
 {
        char id[BUF_MAX];
@@ -45,12 +35,12 @@ static int get_tizenid(char **value)
 
        fp = fopen(TIZEN_ID_PATH, "r");
        if (!fp) {
-               LOGE("Failed to open file (%s)", TIZEN_ID_PATH);
+               _E("Failed to open file (%s)", TIZEN_ID_PATH);
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
 
        if (fgets(id, sizeof(id), fp) == NULL) {
-               LOGE("Failed to get string (errno:%d)", errno);
+               _E("Failed to get string (errno:%d)", errno);
                fclose(fp);
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
@@ -58,7 +48,7 @@ static int get_tizenid(char **value)
        fclose(fp);
 
        if (strlen(id) == 0) {
-               LOGE("String length of id is 0");
+               _E("String length of id is 0");
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
 
@@ -67,29 +57,27 @@ static int get_tizenid(char **value)
        return 0;
 }
 
-static int get_build_info(int key, char *buf, unsigned int len)
+static int get_build_info(char *key, char *buf, unsigned int len)
 {
        int ret;
        char *val;
 
-       if (key != SYSTEM_INFO_KEY_BUILD_DATE &&
-               key != SYSTEM_INFO_KEY_BUILD_STRING &&
-               key != SYSTEM_INFO_KEY_BUILD_TIME)
+       if (!key)
                return -EINVAL;
 
-       ret = system_info_get_value_string(key, &val);
+       ret = system_info_ini_get_string(INFO_FILE_PATH, key, &val);
        if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("Failed to get build date(%d)", ret);
+               _E("Failed to get build date(%d)", ret);
                return ret;
        }
 
        if (!val) {
-               LOGE("val == NULL");
+               _E("val == NULL");
                return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
        }
 
        if (strlen(val) == 0) {
-               LOGE("Invalid date");
+               _E("Invalid date");
                free(val);
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
@@ -105,9 +93,9 @@ static int get_build_date(char **value)
        int ret;
        char date[BUF_MAX];
 
-       ret = get_build_info(SYSTEM_INFO_KEY_BUILD_DATE, date, sizeof(date));
+       ret = get_build_info("build:date", date, sizeof(date));
        if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("Failed to get build date(%d)", ret);
+               _E("Failed to get build date(%d)", ret);
                return ret;
        }
 
@@ -121,9 +109,9 @@ static int get_build_string(char **value)
        int ret;
        char str[BUF_MAX];
 
-       ret = get_build_info(SYSTEM_INFO_KEY_BUILD_STRING, str, sizeof(str));
+       ret = get_build_info("version:build", str, sizeof(str));
        if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("Failed to get build date(%d)", ret);
+               _E("Failed to get build date(%d)", ret);
                return ret;
        }
 
@@ -137,9 +125,9 @@ static int get_build_time(char **value)
        int ret;
        char time[BUF_MAX];
 
-       ret = get_build_info(SYSTEM_INFO_KEY_BUILD_TIME, time, sizeof(time));
+       ret = get_build_info("build:time", time, sizeof(time));
        if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("Failed to get build date(%d)", ret);
+               _E("Failed to get build date(%d)", ret);
                return ret;
        }
 
diff --git a/src/system_info_hardware.c b/src/system_info_hardware.c
deleted file mode 100644 (file)
index de956c0..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <unistd.h>
-
-#include <dlog.h>
-
-#include <system_info.h>
-#include <system_info_private.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
-int system_info_get_value_from_cpuinfo(char *field, char **value)
-{
-       int tmpStrlen = 0;
-       FILE *cpuinfo = NULL;
-       char *name = NULL;
-       char str[MAXBUFSIZE] = { 0, };
-       char tmpStr[MAXBUFSIZE] = { 0, };
-
-       if (system_info_get_system_info_model_type() == SYSTEM_INFO_MODEL_TYPE_EMULATOR) {
-               snprintf(tmpStr, sizeof(tmpStr), "default");
-               goto out;
-       }
-
-       cpuinfo = fopen(CPU_INFO_FILE_PATH, "r");
-       if (NULL == cpuinfo) {
-               LOGE("cannot file open %s file!!!", CPU_INFO_FILE_PATH);
-               if (errno == EPERM || errno == EACCES)
-                       return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       while (fgets(str, MAXBUFSIZE, cpuinfo)) {
-               if (strncmp(field, str, strlen(field)))
-                       continue;
-
-               name = strchr(str, ':');
-               tmpStrlen = strlen(name+2);
-               strncpy(tmpStr, name+2, tmpStrlen);
-               tmpStr[tmpStrlen-1] = '\0';
-               break;
-       }
-
-       fclose(cpuinfo);
-
-out:
-       if (strlen(tmpStr) == 0) {
-               LOGE("Failed to get (%s) info", field);
-               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-       }
-
-       *value = strdup(tmpStr);
-       if (*value == NULL) {
-               LOGE("malloc() failed to get (%s) info", field);
-               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-       }
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_bsp_info(const char *key, char **value)
-{
-       char *string = NULL;
-       char *model = NULL;
-       char *revision = NULL;
-       char Rrevision[MAXBUFSIZE] = "";
-       char file_path[MAXBUFSIZE] = "";
-       int ret;
-
-       if (!key)
-               return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
-
-       if (system_info_get_system_info_model_type() == SYSTEM_INFO_MODEL_TYPE_EMULATOR) {
-               LOGE("cannot get Hardware info in emulator!!!");
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       ret = system_info_get_value_from_cpuinfo("Hardware", &model);
-       if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("cannot get Hardware info from cpuinfo file!!!");
-               return ret;
-       }
-
-       ret = system_info_get_value_from_cpuinfo("Revision", &revision);
-       if (ret != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("cannot get Hardware info from cpuinfo file!!!");
-               free(model);
-               return ret;
-       }
-
-       if (!revision || !strcmp(revision, "default")) {
-               LOGE("cannot get revision info from cpuinfo file!!!");
-               free(model);
-               free(revision);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       snprintf(Rrevision, MAXBUFSIZE, "R%s", revision);
-       snprintf(file_path, MAXBUFSIZE, "/etc/config/board-config-%s.xml", model);
-
-       if (access(file_path, R_OK)) {
-               LOGE("cannot find file %s!!!", file_path);
-               free(model);
-               free(revision);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       if (system_info_get_value_from_xml(file_path, Rrevision, (char *)key, &string)) {
-               free(model);
-               free(revision);
-               LOGE("cannot get aud_amrwb info from %s!!!", file_path);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       free(model);
-       free(revision);
-
-       *value = string;
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
index 290e831..5bb2401 100644 (file)
@@ -19,8 +19,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <dlog.h>
-
 #include <system_info.h>
 #include <system_info_private.h>
 
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
 #define MODEL_CONFIG_TAG "model-config"
 
 int system_info_ini_get_string(char *ini_file, char *key, char **output)
@@ -47,14 +39,14 @@ int system_info_ini_get_string(char *ini_file, char *key, char **output)
        ini = iniparser_load(ini_file);
 
        if (ini == NULL) {
-               LOGE("cannot file open %s file!!!", ini_file);
+               _E("cannot file open %s file!!!", ini_file);
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
 
        str = iniparser_getstr(ini, key);
 
        if (str == NULL) {
-               LOGE("NOT found %s(0x%08x)", key, SYSTEM_INFO_ERROR_IO_ERROR);
+               _E("NOT found %s(0x%08x)", key, SYSTEM_INFO_ERROR_IO_ERROR);
                iniparser_freedict(ini);
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
@@ -62,7 +54,7 @@ int system_info_ini_get_string(char *ini_file, char *key, char **output)
        tmp = strdup(str);
 
        if (tmp == NULL) {
-               LOGE("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
+               _E("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
                iniparser_freedict(ini);
                return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
        }
@@ -73,121 +65,6 @@ int system_info_ini_get_string(char *ini_file, char *key, char **output)
        return SYSTEM_INFO_ERROR_NONE;
 }
 
-int system_info_get_value_from_xml(char *xml_file_path, char *model, char *id_field, char **value)
-{
-       xmlDocPtr doc = NULL;
-       xmlNodePtr cur = NULL;
-       xmlNodePtr default_node = NULL;
-       xmlNodePtr model_node = NULL;
-       xmlNode *cur_node = NULL;
-       char *id = NULL;
-       char *string = NULL;
-
-       doc = xmlParseFile(xml_file_path);
-
-       if (doc == NULL) {
-               LOGE("cannot file open %s file!!!", xml_file_path);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       cur = xmlDocGetRootElement(doc);
-       if (cur == NULL) {
-               LOGE("empty document %s file!!!", xml_file_path);
-               xmlFreeDoc(doc);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       for (cur_node = cur; cur_node; cur_node = cur_node->next) {
-               if (!xmlStrcmp(cur->name, (const xmlChar*)"sys-info"))
-                       break;
-       }
-
-       if (cur == NULL) {
-               LOGE("cannot find %s root element file!!!", "sys-info");
-               xmlFreeDoc(doc);
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       cur = cur->xmlChildrenNode;
-
-       for (cur_node = cur; cur_node; cur_node = cur_node->next) {
-               if (!xmlStrcmp(cur_node->name, (const xmlChar*)"default"))
-                       default_node = cur_node;
-               if (strcmp(model, "default") && !xmlStrcmp(cur_node->name, (const xmlChar*)model))
-                       model_node = cur_node;
-       }
-
-       if (model_node) {
-               cur = model_node->xmlChildrenNode;
-
-               for (cur_node = cur; cur_node; cur_node = cur_node->next) {
-                       if (cur_node->type == XML_ELEMENT_NODE) {
-                               id = (char *)xmlGetProp(cur_node, (const xmlChar*)"id");
-                               string = (char *) xmlGetProp(cur_node, (const xmlChar*)"string");
-
-                               if (!strncmp(id, id_field, strlen(id))) {
-                                       if (!strncmp(id, id_field, strlen(id_field))) {
-                                               if (!string) {
-                                                       free(id);
-                                                       continue;
-                                               }
-
-                                               *value = strdup(string);
-                                               free(id);
-                                               free(string);
-                                               xmlFreeDoc(doc);
-                                               if (*value == NULL) {
-                                                               LOGE("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
-                                                               xmlFreeDoc(doc);
-                                                               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-                                               }
-                                               return SYSTEM_INFO_ERROR_NONE;
-                                       }
-                               }
-                               free(id);
-                               free(string);
-                       }
-               }
-       }
-
-       if (*value == NULL && default_node) {
-               cur = default_node->xmlChildrenNode;
-
-               for (cur_node = cur; cur_node; cur_node = cur_node->next) {
-                       if (cur_node->type == XML_ELEMENT_NODE) {
-                               id = (char *)xmlGetProp(cur_node, (const xmlChar*)"id");
-                               string = (char *) xmlGetProp(cur_node, (const xmlChar*)"string");
-
-                               if (!strncmp(id, id_field, strlen(id))) {
-                                       if (!strncmp(id, id_field, strlen(id_field))) {
-                                               if (!string) {
-                                                       free(id);
-                                                       continue;
-                                               }
-
-                                               *value = strdup(string);
-                                               free(id);
-                                               free(string);
-                                               xmlFreeDoc(doc);
-                                               if (*value == NULL) {
-                                                               LOGE("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
-                                                               xmlFreeDoc(doc);
-                                                               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-                                               }
-                                               return SYSTEM_INFO_ERROR_NONE;
-                                       }
-                               }
-                               free(id);
-                               free(string);
-                       }
-               }
-       }
-
-       LOGE("cannot find %s field from %s file!!!", id_field, xml_file_path);
-       xmlFreeDoc(doc);
-       return SYSTEM_INFO_ERROR_IO_ERROR;
-}
-
 int system_info_get_value_from_config_xml(char *feature_tag, const char *name_field, char *type_field, char **value)
 {
        xmlDocPtr doc = NULL;
@@ -201,13 +78,13 @@ int system_info_get_value_from_config_xml(char *feature_tag, const char *name_fi
        doc = xmlParseFile(CONFIG_FILE_PATH);
 
        if (doc == NULL) {
-               LOGE("cannot file open %s file!!!", CONFIG_FILE_PATH);
+               _E("cannot file open %s file!!!", CONFIG_FILE_PATH);
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
 
        cur = xmlDocGetRootElement(doc);
        if (cur == NULL) {
-               LOGE("empty document %s file!!!", CONFIG_FILE_PATH);
+               _E("empty document %s file!!!", CONFIG_FILE_PATH);
                xmlFreeDoc(doc);
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
@@ -218,7 +95,7 @@ int system_info_get_value_from_config_xml(char *feature_tag, const char *name_fi
        }
 
        if (cur == NULL) {
-               LOGE("cannot find %s root element file!!!", MODEL_CONFIG_TAG);
+               _E("cannot find %s root element file!!!", MODEL_CONFIG_TAG);
                xmlFreeDoc(doc);
                return SYSTEM_INFO_ERROR_IO_ERROR;
        }
@@ -231,7 +108,7 @@ int system_info_get_value_from_config_xml(char *feature_tag, const char *name_fi
        }
 
        if (model_node == NULL) {
-               LOGE("cannot find %s field from %s file!!!", name_field, CONFIG_FILE_PATH);
+               _E("cannot find %s field from %s file!!!", name_field, CONFIG_FILE_PATH);
                xmlFreeDoc(doc);
                return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
        }
@@ -253,7 +130,7 @@ int system_info_get_value_from_config_xml(char *feature_tag, const char *name_fi
                                if (!strncmp(name, p_name, strlen(name))) {
                                        if (!strncmp(name, p_name, strlen(p_name))) {
                                                if (strncmp(type, type_field, strlen(type_field))) {
-                                                       LOGE("INVALID_PARAMETER(0x%08x) : invalid output param", SYSTEM_INFO_ERROR_INVALID_PARAMETER);
+                                                       _E("INVALID_PARAMETER(0x%08x) : invalid output param", SYSTEM_INFO_ERROR_INVALID_PARAMETER);
                                                        free(name);
                                                        free(type);
                                                        xmlFreeDoc(doc);
@@ -276,13 +153,13 @@ int system_info_get_value_from_config_xml(char *feature_tag, const char *name_fi
        }
 
        if (!cur_node) {
-               LOGE("cannot find %s field from %s file!!!", name_field, CONFIG_FILE_PATH);
+               _E("cannot find %s field from %s file!!!", name_field, CONFIG_FILE_PATH);
                xmlFreeDoc(doc);
                return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
        }
 
        if (*value == NULL) {
-               LOGE("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
+               _E("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
                xmlFreeDoc(doc);
                return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
        }
diff --git a/src/system_info_platform.c b/src/system_info_platform.c
deleted file mode 100644 (file)
index 49fac27..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <dlog.h>
-
-#include <system_info.h>
-#include <system_info_private.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
-int system_info_get_model(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_ini_get_string(INFO_FILE_PATH, "version:model", (char **)value);
-}
-
-int system_info_get_build_string(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_ini_get_string(INFO_FILE_PATH, "version:build", (char **)value);
-}
-
-int system_info_get_build_date(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_ini_get_string(INFO_FILE_PATH, "build:date", (char **)value);
-}
-
-int system_info_get_build_time(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_ini_get_string(INFO_FILE_PATH, "build:time", (char **)value);
-}
-
-int system_info_get_tizen_version(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_string("tizen.org/feature/platform.version", (char**)value);
-}
-
-int system_info_get_core_cpu_arch(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       bool cpu_arch;
-       char *CORE_CPU_ARCH = NULL;
-
-       if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.armv6", &cpu_arch) == SYSTEM_INFO_ERROR_NONE
-               && cpu_arch == true)
-               CORE_CPU_ARCH = strdup("armv6");
-       else if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.armv7", &cpu_arch) == SYSTEM_INFO_ERROR_NONE
-               && cpu_arch == true)
-               CORE_CPU_ARCH = strdup("armv7");
-       else if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.x86", &cpu_arch) == SYSTEM_INFO_ERROR_NONE
-               && cpu_arch == true)
-               CORE_CPU_ARCH = strdup("x86");
-
-       if (CORE_CPU_ARCH == NULL) {
-               LOGE("Unknown cpu");
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       *value = CORE_CPU_ARCH;
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_core_cpu_freq(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       double *count;
-       FILE *cpuinfo, *cpuinfo_max_freq;
-       double max_freq = 0.0;
-       char *name;
-       char str[MAXBUFSIZE];
-
-       if (system_info_get_system_info_model_type() != SYSTEM_INFO_MODEL_TYPE_EMULATOR) {
-               cpuinfo_max_freq = fopen(CPU_INFO_MAX_FREQ_PATH, "r");
-               if (NULL == cpuinfo_max_freq) {
-                       LOGE("cannot file open %s file!!!", CPU_INFO_MAX_FREQ_PATH);
-                       if (errno == EPERM || errno == EACCES)
-                               return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
-                       return SYSTEM_INFO_ERROR_IO_ERROR;
-               } else {
-                       if (fscanf(cpuinfo_max_freq, "%lf", &max_freq) < 1) {
-                               fclose(cpuinfo_max_freq);
-                               return SYSTEM_INFO_ERROR_IO_ERROR;
-                       }
-                       max_freq = max_freq / 1024;
-               }
-               fclose(cpuinfo_max_freq);
-       } else {
-               /* Emulator */
-               cpuinfo = fopen(CPU_INFO_FILE_PATH, "r");
-               if (NULL == cpuinfo) {
-                       LOGE("cannot file open %s file!!!", CPU_INFO_FILE_PATH);
-                       if (errno == EPERM || errno == EACCES)
-                               return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
-                       return SYSTEM_INFO_ERROR_IO_ERROR;
-               } else {
-                       while (fgets(str, MAXBUFSIZE, cpuinfo)) {
-                               if (!strncmp("cpu MHz", str, strlen("cpu MHz"))) {
-                                       name = strchr(str, ':');
-                                       max_freq = atof(name+2);
-                                       break;
-                               }
-                       }
-               }
-               fclose(cpuinfo);
-       }
-
-       count = (double *)value;
-
-       *count = max_freq;
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_platform_name(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       return system_info_get_platform_string("tizen.org/system/platform.name", (char**)value);
-}
-
-int system_info_get_tizen_version_name(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       char *TIZEN_VERSION_NAME = NULL;
-       char *name = NULL;
-       char str[MAXBUFSIZE];
-       char tmpStr[MAXBUFSIZE];
-       int tmpStrlen = 0;
-       FILE *info;
-       extern char *strcasestr(const char *s, const char *find);
-
-       info = fopen(OS_RELEASE_FILE_PATH, "r");
-       if (NULL == info) {
-               LOGE("cannot file open %s file!!!", OS_RELEASE_FILE_PATH);
-               if (errno == EPERM || errno == EACCES)
-                       return SYSTEM_INFO_ERROR_PERMISSION_DENIED;
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-       }
-
-       while (fgets(str, MAXBUFSIZE, info)) {
-               if (strcasestr(str, "VERSION")) {
-                       name = strchr(str, ',');
-                       name += 2;
-                       tmpStrlen = strlen(name);
-
-                       strncpy(tmpStr, name, tmpStrlen-2);
-                       tmpStr[tmpStrlen-2] = '\0';
-
-                       TIZEN_VERSION_NAME = strdup(tmpStr);
-                       if (TIZEN_VERSION_NAME == NULL) {
-                               LOGE("OUT_OF_MEMORY(0x%08x)", SYSTEM_INFO_ERROR_OUT_OF_MEMORY);
-                               fclose(info);
-                               return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
-                       }
-                       break;
-               }
-       }
-
-       *value = TIZEN_VERSION_NAME;
-       fclose(info);
-       return SYSTEM_INFO_ERROR_NONE;
-}
diff --git a/src/system_info_screen.c b/src/system_info_screen.c
deleted file mode 100644 (file)
index 946e993..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <dlog.h>
-
-#include <system_info.h>
-#include <system_info_private.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "CAPI_SYSTEM_INFO"
-
-int system_info_get_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       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)
-{
-       return system_info_get_platform_int("tizen.org/feature/screen.height", (int *)value);
-}
-
-int system_info_get_physical_screen_height(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       int *height;
-       char *str;
-
-       height = (int *)value;
-
-       if (system_info_get_bsp_info("board.display.height_mm", &str))
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-
-       *height = atoi(str);
-
-       free(str);
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
-
-int system_info_get_physical_screen_width(system_info_key_e key, system_info_data_type_e data_type, void **value)
-{
-       int *width;
-       char *str;
-
-       width = (int *)value;
-
-       if (system_info_get_bsp_info("board.display.width_mm", &str))
-               return SYSTEM_INFO_ERROR_IO_ERROR;
-
-       *width = atoi(str);
-
-       free(str);
-
-       return SYSTEM_INFO_ERROR_NONE;
-}
index 8ea9d4c..6fdaf6a 100755 (executable)
@@ -10,8 +10,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 INCLUDE(FindPkgConfig)
 pkg_check_modules(tizenid_pkgs REQUIRED
                dlog
+               glib-2.0
                openssl
-               cryptsvc
 )
 
 FOREACH(flag ${tizenid_pkgs_CFLAGS})
index bc79d86..95c15f3 100755 (executable)
@@ -29,7 +29,7 @@
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 #include <dlog.h>
-#include <SecCryptoSvc.h>
+#include <glib.h>
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -43,9 +43,7 @@
 
 #define KEY_MAX 20
 
-#define TIZEN_ID_PATH          "/opt/home/root/tizenid"
 #define RANDOM_PATH                    "/dev/random"
-#define MODEL_CONFIG_PATH      "/etc/config/model-config.xml"
 
 static int get_pw_key(char *pw, unsigned int len)
 {
@@ -90,9 +88,9 @@ static int get_salt_by_model(char *salt, unsigned int len)
        if (!salt)
                return -EINVAL;
 
-       fp = fopen(MODEL_CONFIG_PATH, "r");
+       fp = fopen(CONFIG_FILE_PATH, "r");
        if (!fp) {
-               _E("Failed to open (%s)", MODEL_CONFIG_PATH);
+               _E("Failed to open (%s)", CONFIG_FILE_PATH);
                return -ENOENT;
        }
 
@@ -156,7 +154,8 @@ static int store_tizen_id(char *id)
 static int make_tizen_id(void)
 {
        char salt[KEY_MAX], pw_key[KEY_MAX];
-       char *id = NULL, *id_64 = NULL;
+       char *id = NULL;
+       gchar *id_64 = NULL;
        int ret;
 
        ret = get_salt_by_model(salt, sizeof(salt));
@@ -190,7 +189,7 @@ static int make_tizen_id(void)
        id[KEY_MAX-1] = '\0';
        _I("ID: (%s)", id);
 
-       id_64 = Base64Encoding(id, KEY_MAX);
+       id_64 = g_base64_encode((const guchar *)id, KEY_MAX);
 
        ret = store_tizen_id(id_64);
        if (ret < 0) {
@@ -204,7 +203,7 @@ out:
        if (id)
                free(id);
        if (id_64)
-               free(id_64);
+               g_free(id_64);
 
        return ret;
 }