-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-system-system-settings")
-SET(unit_test "system-setting-unittest")
-
-PROJECT(${fw_name})
-
-SET(CMAKE_INSTALL_PREFIX /usr)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-
-SET(SYSTEM_SETTINGS_UTIL system-settings-util)
-SET(LIB_SYSTEM_SETTINGS_UTIL system-settings-util)
-
-#GCOV_PREFIX=/target/run’ and ‘GCOV_PREFIX_STRIP=1
-#---------------------------------------------------------------
-# code coverage
-#---------------------------------------------------------------
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake)
-IF ((CMAKE_BUILD_TYPE STREQUAL "UNITTEST") OR (CMAKE_BUILD_TYPE STREQUAL "GCOVTEST"))
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -g -O0 -fprofile-arcs -ftest-coverage --coverage")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -O0 -fprofile-arcs -ftest-coverage --coverage")
-ENDIF() #CMAKE_BUILD_TYPE STREQUAL "UNITTEST"
-#---------------------------------------------------------------
-# include/system-setting-config.h
-#---------------------------------------------------------------
-set (VERSION_MAJOR 1)
-set (VERSION_MINOR 0)
-set (SETTING_DEF_RES_PATH "\"${SETTING_DEF_RES}\"")
-
-set (SETTING_TIME_ZONEINFO_PATH "\"/usr/share/zoneinfo/\"")
-set (SETTING_TZONE_SYMLINK_PATH "\"/opt/etc/localtime\"")
-
-# DSETTING_DEF_RES
-configure_file (
- "${PROJECT_SOURCE_DIR}/system-setting-config.h.in"
- "${PROJECT_SOURCE_DIR}/include/system-setting-config.h"
-)
-
-
-SET(LIBDIR "${CMAKE_LIBDIR}")
-SET(INC_DIR include)
-INCLUDE_DIRECTORIES(${INC_DIR})
-
-SET(requires "dlog vconf fontconfig libxml-2.0 pkgmgr pkgmgr-info alarm-service capi-media-metadata-extractor aul json-glib-1.0 capi-appfw-app-manager capi-appfw-package-manager capi-system-info glib-2.0")
-SET(pc_requires "capi-base-common")
-
-
-IF(TIZEN_WEARABLE)
- ADD_DEFINITIONS(-DTIZEN_WEARABLE)
-ENDIF(TIZEN_WEARABLE)
-IF(TIZEN_MOBILE)
- ADD_DEFINITIONS(-DTIZEN_MOBILE)
-ENDIF(TIZEN_MOBILE)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
+PROJECT(capi-system-system-settings)
INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED ${requires})
-FOREACH(flag ${${fw_name}_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror-implicit-function-declaration")
+SET(SETTING_TZONE_SYMLINK_PATH "\"/opt/etc/localtime\"")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+SET(EXTRA_FLAGS "-Wall -Werror -fvisibility=hidden")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS} -std=c++11")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
-IF("${ARCH}" STREQUAL "arm")
- ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
+PKG_CHECK_MODULES(pkgs REQUIRED dlog vconf fontconfig libxml-2.0 pkgmgr pkgmgr-info
+ alarm-service capi-media-metadata-extractor aul json-glib-1.0 capi-appfw-app-manager
+ capi-appfw-package-manager capi-system-info glib-2.0)
+INCLUDE_DIRECTORIES(${pkgs_INCLUDE_DIRS})
+LINK_DIRECTORIES(${pkgs_LIBRARY_DIRS})
ADD_DEFINITIONS("-D_TZ_SYS_DATA=\"${TZ_SYS_DATA}\"")
ADD_DEFINITIONS("-D_TZ_SYS_ETC=\"${TZ_SYS_ETC}\"")
ADD_DEFINITIONS("-D_TZ_SYS_SHARE=\"${TZ_SYS_SHARE}\"")
ADD_DEFINITIONS("-DSETTING_DEF_RES=\"${SETTING_DEF_RES}\"")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
-IF (CMAKE_BUILD_TYPE STREQUAL "UNITTEST")
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
- ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/unit_test)
-ENDIF() #CMAKE_BUILD_TYPE STREQUAL "UNITTEST"
-
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SYSTEM_SETTINGS_UTIL}/include)
-ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${SYSTEM_SETTINGS_UTIL})
-
-#AUX_SOURCE_DIRECTORY(src SOURCES)
-SET(SOURCES "src/system_setting_platform.c"
- "src/system_settings.c"
- "src/system_settings_json.c"
- "src/system_settings_ringtones.c"
- "src/system_settings_multi_callback.c"
- "src/system_settings_vconf.c")
-
-#SET(UNITSOURES "system_setting_unittest.c")
-
-ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
-
-TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
-
-SET_TARGET_PROPERTIES(${fw_name}
- PROPERTIES
- VERSION ${FULLVER}
- SOVERSION ${MAJORVER}
- CLEAN_DIRECT_OUTPUT 1
-)
-
-IF (CMAKE_BUILD_TYPE STREQUAL "UNITTEST")
- # Coverage Testing
- INSTALL(
- DIRECTORY "CMakeFiles" DESTINATION /usr/src/packages/BUILD/capi-system-system-settings-${FULLVER}
- FILES_MATCHING
- PATTERN "*.gcno"
- PATTERN "*system_setting_unittest.c.gcno" EXCLUDE
- )
-ENDIF() #CMAKE_BUILD_TYPE STREQUAL "UNITTEST"
-
-
-INSTALL(TARGETS ${fw_name} DESTINATION ${LIBDIR})
-INSTALL(
- DIRECTORY ${INC_DIR}/ DESTINATION include/system
- FILES_MATCHING
- PATTERN "*_private.h" EXCLUDE
- PATTERN "*_json.h" EXCLUDE
- PATTERN "*_ringtones.h" EXCLUDE
- PATTERN "${INC_DIR}/*.h"
- )
-
-SET(PC_NAME ${fw_name})
-SET(PC_REQUIRED ${pc_requires})
-SET(PC_LDFLAGS -l${fw_name})
-SET(PC_CFLAGS -I\${includedir}/system)
-
-CONFIGURE_FILE(
- capi-system-system-settings.pc.in
- ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
- @ONLY
-)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIBDIR}/pkgconfig)
+IF(TIZEN_WEARABLE)
+ ADD_DEFINITIONS(-DTIZEN_WEARABLE)
+ENDIF(TIZEN_WEARABLE)
+IF(TIZEN_MOBILE)
+ ADD_DEFINITIONS(-DTIZEN_MOBILE)
+ENDIF(TIZEN_MOBILE)
-# INSTALL (TARGETS test DESTINATION bin)
+FILE(GLOB SRCS src/*.c)
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LIBRARIES})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER})
-IF(UNIX)
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
+FILE(GLOB HEADERS include/*.h)
+INSTALL(FILES ${HEADERS} DESTINATION ${INCLUDE_INSTALL_DIR}/system)
-ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
-ADD_CUSTOM_COMMAND(
- DEPENDS clean
- COMMENT "distribution clean"
- COMMAND find
- ARGS .
- -not -name config.cmake -and \(
- -name tester.c -or
- -name Testing -or
- -name CMakeFiles -or
- -name cmake.depends -or
- -name cmake.check_depends -or
- -name CMakeCache.txt -or
- -name cmake.check_cache -or
- -name *.cmake -or
- -name Makefile -or
- -name core -or
- -name core.* -or
- -name gmon.out -or
- -name install_manifest.txt -or
- -name *.pc -or
- -name *~ \)
- | grep -v TC | xargs rm -rf
- TARGET distclean
- VERBATIM
-)
-ENDIF(UNIX)
+CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
+INSTALL(FILES ${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+ADD_SUBDIRECTORY(utils)
+ADD_SUBDIRECTORY(tests)
-Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+Copyright (c) 2012 - 2020 Samsung Electronics Co., Ltd. All rights reserved.\r
\r
Apache License\r
Version 2.0, January 2004\r
See the License for the specific language governing permissions and\r
limitations under the License.\r
\r
-\r
-\r
+++ /dev/null
-
-
-# Unit Testing for system-settings API
-
-
-## HOW TO TEST
-
- #./unittest.sh /home/mjpark/GBS-ROOT/local/repos/slp/armv7l/RPMS capi-system-system-settings 0.0.3-3 armv7l 2>&1 | tee ./unittest.log
-
- ./unittest.sh /home/mjpark/GBS-ROOT/local/repos/slp/armv7l/RPMS armv7l 2>&1 | tee ./unittest.log
- ./unittest2.sh /home/mjpark/GBS-ROOT/local/repos/slp/armv7l/RPMS armv7l 2>&1 | tee ./unittest.log
-
-# Package Information for pkg-config
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@/system
-prefix=@PREFIX@
-exec_prefix=/usr
-libdir=/usr/lib
-includedir=/usr/include/system
-
-Name: @PC_NAME@
-Description: @PACKAGE_DESCRIPTION@
-Version: @VERSION@
-Requires: @PC_REQUIRED@
-Libs: -L${libdir} @PC_LDFLAGS@
+Name: @PROJECT_NAME@
+Description: Tizen Native API for System Settings
+Version: @FULLVER@
+Requires: capi-base-common
+Libs: -L${libdir} -l@PROJECT_NAME@
Cflags: -I${includedir}
-
+++ /dev/null
-/usr/include/*
-/usr/include/*/*
-/usr/lib/pkgconfig/*.pc
-
+++ /dev/null
-/usr/lib/lib*.so*
+++ /dev/null
-capi-system-system-settings (0.0.1-7ubuntu1) precise; urgency=low
-
- * release
- * font-type API refinement
-
- -- mjpark <mjpark@localhost> Wed, 23 Jan 2013 15:25:21 +0900
-
-capi-system-system-settings (0.0.1-7) unstable; urgency=low
-
- * release
-
- -- MyoungJune Park <mj2004.park@samsung.com> Tue, 04 Sep 2012 10:34:54 +0900
-
-capi-system-system-settings (0.0.1-6) unstable; urgency=low
-
- * tizen build
-
- -- MyoungJune Park <mj2004.park@samsung.com> Tue, 14 Aug 2012 10:20:07 +0900
-
-capi-system-system-settings (0.0.1-5) unstable; urgency=low
-
- * Initial upload
- * Git: slp/api/system-settings
- * Tag: capi-system-system-settings_0.0.1-5
-
- -- MyoungJune Park <mj2004.park@samsung.com> Mon, 21 May 2012 15:45:32 +0900
-
-capi-system-system-settings (0.0.1-1) unstable; urgency=low
-
- * Initial upload
- * Git: slp-info.sec.samsung.net:slp/api/system-settings
- * Tag: capi-system-system-settings_0.0.1-1
-
- -- Junghyuk Park <junghyuk.park@samsung.com> Tue, 06 Dec 2011 21:16:07 +0900
+++ /dev/null
-
-Source: capi-system-system-settings
-Section: libs
-Priority: extra
-Maintainer: Woongsuk Cho <ws77.cho@samsung.com>, junghyuk park <junghyuk.park@samsung.com>, MyoungJune Park <mj2004.park@samsung.com>
-Build-Depends: debhelper (>= 5), libecore-dev, dlog-dev, libelm-dev, libappcore-efl-dev, libvconf-dev, capi-base-common-dev, libfontconfig1-dev, libxml2-dev ,libglib2.0-dev
-
-Package: capi-system-system-settings
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: A System Settings library in Tizen Native API
-
-Package: capi-system-system-settings-dev
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, capi-system-system-settings (= ${Source-Version}), capi-base-common-dev
-Description: A System Settings library in Tizen Native API (DEV)
-
-Package: capi-system-system-settings-dbg
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, capi-system-system-settings (= ${Source-Version})
-Description: A System Settings library in Tizen Native API (DBG)
-
+++ /dev/null
-#!/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-system-settings-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
-
/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2015-2019 Samsung Electronics Co., Ltd All Rights Reserved
*
- * Licensed under the Apache License, Version 2.0 (the License);
+ * 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,
+ * 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.
*/
-
/**
* @ingroup CAPI_SYSTEM_FRAMEWORK
* @defgroup CAPI_SYSTEM_SYSTEM_SETTINGS_MODULE System Settings
/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2020 Samsung Electronics Co., Ltd All Rights Reserved
*
- * Licensed under the Apache License, Version 2.0 (the License);
+ * 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,
+ * 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_SETTINGS_H__
#define __TIZEN_SYSTEM_SYSTEM_SETTINGS_H__
+++ /dev/null
-#ifndef __TIZEN_SYSTEM_SETTING_MULTI_CALLBACK_H__
-#define __TIZEN_SYSTEM_SETTING_MULTI_CALLBACK_H__
-#include <system_settings.h>
-#include <system-setting-config.h>
-#include <glib.h>
-
-typedef struct __st_multi_callback_node_
-{
- system_settings_changed_cb callback;
- void* user_data;
-}callback_node;
-
-typedef struct __st_multi_callback_list_
-{
- GList * list;
- int is_registered;
-}callback_list;
-
-int add_multi_callback(callback_list *handle, system_settings_changed_cb ptr, void* user_data);
-int delete_multi_callback(callback_list *handle, system_settings_changed_cb ptr);
-int invoke_callback_list(callback_list *handle, system_settings_key_e key);
-
-
-#endif /* __TIZEN_SYSTEM_SETTING_MULTI_CALLBACK_H__ */
+++ /dev/null
-#ifndef __SYSTEM_SETTINGS_RINGTONES_H__
-#define __SYSTEM_SETTINGS_RINGTONES_H__
-
-#include <sys/types.h>
-#include <dirent.h>
-#include <metadata_extractor.h>
-
-typedef struct _ugFsNodeInfo fileNodeInfo;
-struct _ugFsNodeInfo {
- char *path;
- char *name;
- char *media_name;
-};
-
-int get_filelist_from_dir_path(char *path, GList **file_list);
-char *get_filename_from_fullname(const char *fullname);
-
-#if 0
-void ringtone_play_sound(const char *sound_file, player_h **mp_handle);
-void ringtone_stop_sound(void *data);
-#endif
-
-#endif /* __SYSTEM_SETTINGS_RINGTONES_H__ */
Summary: A System Settings library in Tizen Native API
Version: 0.0.4
Release: 5
+
Group: System/System Info
License: Apache-2.0
+URL : https://git.tizen.org/cgit/platform/core/api/system-settings
Source0: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(capi-media-metadata-extractor)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(libsystemd)
-
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-appfw-package-manager)
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
-%if 0%{?run_tests:1}
BuildRequires: pkgconfig(sqlite3)
BuildRequires: efl
BuildRequires: capi-system-info-test
BuildRequires: default-fonts-sdk
# BuildRequires: model-config-tm1
+%if 0%{?gcov:1}
BuildRequires: lcov
%endif
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
-
%description
System setting api for get,set configuration
%description devel
System setting api for get,set configuration
+%package unittests
+Summary: Test Programs for %{name}
+Group: System/Testing
+
+%description unittests
+The %{name}-unittests pacakge contains programs for checking the %{name}.
+
%if 0%{?gcov:1}
%package gcov
Summary: A System Settings library in Tizen Native API
-Group: System/System Info/Testing
+Group: System/Testing
+
%description gcov
System Settings library gcov objects
%endif
+%define tizen_profile_name mobile
+%define sys_setting_test_dir %{_bindir}/sys-settings
%prep
%setup -q
-
-%define tizen_profile_name mobile
+cp %{SOURCE1001} ./%{name}.manifest
%build
-
%if "%{?tizen_profile_name}" == "wearable"
export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_WEARABLE"
export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
%endif
-
-%ifarch aarch64
+%ifarch aarch64 x86_64
export CFLAGS+="$CFLAGS -DSETTING_ARCH_64"
export CXXFLAGS+="$CXXFLAGS -DSETTING_ARCH_64"
export FFLAGS+="$FFLAGS -DSETTING_ARCH_64"
%endif
-%ifarch x86_64
-export CFLAGS+="$CFLAGS -DSETTING_ARCH_64"
-export CXXFLAGS+="$CXXFLAGS -DSETTING_ARCH_64"
-export FFLAGS+="$FFLAGS -DSETTING_ARCH_64"
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
+export FFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov"
%endif
-
-
-VERSION=`echo %{version} | grep Version: | awk '{ print $2 }'`
-RELEASE=`echo %{version} | grep Version: | awk '{ print $2 }'`
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-
-cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DCMAKE_LIBDIR=%{_libdir} \
- -DCMAKE_INCLUDEDIR=%{_includedir} \
+%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
+ -DCMAKE_VERBOSE_MAKEFILE=OFF \
-DTZ_SYS_DATA=%{TZ_SYS_DATA} \
-DTZ_SYS_ETC=%{TZ_SYS_ETC} \
-DTZ_SYS_RO_SHARE=%{TZ_SYS_RO_SHARE} \
-DTZ_SYS_SHARE=%{TZ_SYS_SHARE} \
- -DSETTING_DEF_RES=%{TZ_SYS_GLOBALUSER_DATA}/settings \
-%if 0%{?gcov:1}
- -DCMAKE_BUILD_TYPE=GCOVTEST \
-%endif
+ -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
+ -DTEST_INSTALL_DIR:PATH=%{sys_setting_test_dir} \
%if 0%{?thread_number}
-DN_THREADS=%{thread_number} \
-%endif
-%if 0%{?run_tests:1}
- -DCMAKE_BUILD_TYPE=UNITTEST \
- -DUNIT_TEST=1 \
- -DGCOV_PREFIX="%{buildroot}" \
- -DGCOV_PREFIX_STRIP=1
%else
-
-# add empty line
-%endif
-
-
-make %{?jobs:-j%jobs}
-
-%if 0%{?gcov:1}
-mkdir -p gcov-obj
-find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+ -DN_THREADS=1 \
%endif
+ -DSETTING_DEF_RES=%{TZ_SYS_GLOBALUSER_DATA}/settings
+make %{?_smp_mflags}
%install
-#rm -rf %{buildroot}
%make_install
%if 0%{?gcov:1}
-mkdir -p %{buildroot}%{_datadir}/gcov/obj
-install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+find .. -name '*.gcno' | tar cf %{name}-gcov.tar -T -
+install -d -m 755 %{buildroot}%{_datadir}/gcov/obj
+tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj
%endif
%check
-###############################################
-# Causion : unit test need to root permission
-###############################################
-# pushd unit_test
-# ./run_coverage.sh
-# popd
+#cd tests
+#bash ./run_coverage.sh
+
+%post unittests
+XDG_RUNTIME_DIR=/run %{sys_setting_test_dir}/sys-settings-test
%post -p /sbin/ldconfig
%files
%manifest %{name}.manifest
-%{_libdir}/lib*.so.*
-%if 0%{?run_tests:1}
-/usr/local/bin/system-setting-unittest
-
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_setting_platform.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings_json.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings_ringtones.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings_vconf.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/CMakeFiles/%{name}.dir/src/system_settings_multi_callback.c.gcno
-/usr/src/packages/BUILD/%{name}-%{version}/system-settings-util/CMakeFiles/system-settings-util.dir/src/system_settings_util.c.gcno
-%endif
-%license LICENSE
-# /usr/local/bin/test_system_settings
-#/usr/local/bin/test_system_settings_gui
+%{_libdir}/lib*settings.so.*
+%{_libdir}/lib*settings-util.so
+%license LICENSE.APLv2
%files devel
%manifest %{name}.manifest
-%license LICENSE
-%{_includedir}/system/*.h
-%{_includedir}/system_settings_util.h
+%{_libdir}/lib*settings.so
%{_libdir}/pkgconfig/*.pc
-%{_libdir}/lib*.so
+%{_includedir}/system/*.h
+
+%files unittests
+%manifest %{name}.manifest
+%{sys_setting_test_dir}/*
+%license LICENSE.APLv2
%if 0%{?gcov:1}
%files gcov
-%{_datadir}/gcov/obj/*
+%{_datadir}/gcov/*
%endif
/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2020 Samsung Electronics Co., Ltd All Rights Reserved
*
- * Licensed under the Apache License, Version 2.0 (the License);
+ * 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,
+ * 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 <vconf.h>
#include <dlog.h>
-#include <system_settings.h>
-#include <system_settings_private.h>
+#include "system_settings.h"
+#include "sys_settings.h"
#include <glib.h>
/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2020 Samsung Electronics Co., Ltd All Rights Reserved
*
- * Licensed under the Apache License, Version 2.0 (the License);
+ * 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,
+ * 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_SETTING_PRIVATE_H__
#define __TIZEN_SYSTEM_SETTING_PRIVATE_H__
#endif
#include <dlog.h>
-#include <system_settings.h>
-#include <system_settings_multi_callback.h>
+#include "system_settings.h"
+#include "sys_settings_multi_callback.h"
#ifndef VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST
#define VCONFKEY_SETAPPL_ACCESSIBILITY_HIGH_CONTRAST "db/setting/accessibility/high_contrast"
-
-#include <system_settings.h>
-#include <system_settings_private.h>
-#include <system_settings_json.h>
-
+/*
+ * Copyright (c) 2016-2020 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 <vconf.h>
+#include "system_settings.h"
+#include "sys_settings.h"
+#include "sys_settings_json.h"
+
//#define VCONFKEY_SETAPPL_CALL_RINGTONE_USER_LIST
/* LCOV_EXCL_START */
/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2020 Samsung Electronics Co., Ltd All Rights Reserved
*
- * Licensed under the Apache License, Version 2.0 (the License);
+ * 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,
+ * 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_SETTING_JSON_H__
#define __TIZEN_SYSTEM_SETTING_JSON_H__
+/*
+ * Copyright (c) 2017-2020 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 <stdlib.h>
-#include <system_settings_private.h>
+#include "sys_settings.h"
void clean_node(callback_node* node)
{
--- /dev/null
+/*
+ * Copyright (c) 2017 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_SETTING_MULTI_CALLBACK_H__
+#define __TIZEN_SYSTEM_SETTING_MULTI_CALLBACK_H__
+
+#include <glib.h>
+#include "system_settings.h"
+
+typedef struct __st_multi_callback_node_
+{
+ system_settings_changed_cb callback;
+ void* user_data;
+}callback_node;
+
+typedef struct __st_multi_callback_list_
+{
+ GList * list;
+ int is_registered;
+}callback_list;
+
+int add_multi_callback(callback_list *handle, system_settings_changed_cb ptr, void* user_data);
+int delete_multi_callback(callback_list *handle, system_settings_changed_cb ptr);
+int invoke_callback_list(callback_list *handle, system_settings_key_e key);
+
+
+#endif /* __TIZEN_SYSTEM_SETTING_MULTI_CALLBACK_H__ */
/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2020 Samsung Electronics Co., Ltd All Rights Reserved
*
- * Licensed under the Apache License, Version 2.0 (the License);
+ * 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,
+ * 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 <pkgmgr-info.h>
#include <package_manager.h>
#include <app_manager.h>
-
-#include <system_settings.h>
-#include <system_settings_private.h>
-#include <system_settings_ringtones.h>
-#include <system_settings_json.h>
-
-#include <system-setting-config.h>
-
#include <tzplatform_config.h>
#include <alarm.h>
-
#include <system_info.h>
+#include "system_settings.h"
+#include "sys_settings.h"
+#include "sys_settings_ringtones.h"
+#include "sys_settings_json.h"
+
#define SETTING_FONT_CONF_FILE _TZ_SYS_ETC"/fonts/conf.avail/99-tizen.conf"
#define SETTING_DEFAULT_FONT_CONF_FILE _TZ_SYS_ETC"/fonts/conf.avail/99-tizen.conf"
#define FREE(arg) __FREE(free, arg)
#ifdef SETTING_ARCH_64
-#define SETTING_UTILS_SO_FILE_PATH "/usr/lib64/libsystem-settings-util.so.0.1.0"
+#define SETTING_UTILS_SO_FILE_PATH "/usr/lib64/libsystem-settings-util.so"
#else
-#define SETTING_UTILS_SO_FILE_PATH "/usr/lib/libsystem-settings-util.so.0.1.0"
+#define SETTING_UTILS_SO_FILE_PATH "/usr/lib/libsystem-settings-util.so"
#endif
int _is_file_accessible(const char *path);
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
return false;
}
image_type_check = dlsym(handle, "__is_supported_image_type_load");
if ((error = dlerror()) != NULL) {
- SETTING_TRACE("ERROR!! canNOT find __is_supported_image_type_load function at libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find __is_supported_image_type_load function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return false;
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
return false;
}
check_available_font = dlsym(handle, "__is_available_font");
if ((error = dlerror()) != NULL) {
- SETTING_TRACE("ERROR!! canNOT find __is_available_font function at libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find __is_available_font function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return false;
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
return;
}
set_font_size = dlsym(handle, "__font_size_set");
if ((error = dlerror()) != NULL) {
- SETTING_TRACE("ERROR!! canNOT find __font_size_set function at libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find __font_size_set function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return;
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
return;
}
set_font_nodification = dlsym(handle, "font_config_set_notification");
if ((error = dlerror()) != NULL) {
- SETTING_TRACE("ERROR!! canNOT find font_config_set_notification function at libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find font_config_set_notification function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return;
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
return false;
}
check_font_type = dlsym(handle, "font_config_set");
if ((error = dlerror()) != NULL) {
- SETTING_TRACE("ERROR!! canNOT find font_config_set function at libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find font_config_set function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return false;
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
return false;
}
get_font_info = dlsym(handle, "_get_default_font");
if ((error = dlerror()) != NULL) {
- SETTING_TRACE("ERROR!! canNOT find _get_default_font function at libsystem-settings-util.so.0.1.0");
+ SETTING_TRACE("ERROR!! canNOT find _get_default_font function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return false;
/*
- * system_settings_ringtones.c
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Contact: MyoungJune Park <mj2004.park@samsung.com>
+ * Copyright (c) 2016-2020 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.
* 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 <pthread.h>
#include <stdio.h>
#include <glib.h>
-#include <system_settings.h>
-#include <system_settings_private.h>
-#include "system_settings_ringtones.h"
-#include "system_settings_json.h"
+#include "system_settings.h"
+#include "sys_settings.h"
+#include "sys_settings_ringtones.h"
+#include "sys_settings_json.h"
/* LCOV_EXCL_START */
/*remove ext name */
--- /dev/null
+/*
+ * Copyright (c) 2011-2020 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 __SYSTEM_SETTINGS_RINGTONES_H__
+#define __SYSTEM_SETTINGS_RINGTONES_H__
+
+#include <sys/types.h>
+#include <dirent.h>
+#include <metadata_extractor.h>
+
+typedef struct _ugFsNodeInfo fileNodeInfo;
+struct _ugFsNodeInfo {
+ char *path;
+ char *name;
+ char *media_name;
+};
+
+int get_filelist_from_dir_path(char *path, GList **file_list);
+char *get_filename_from_fullname(const char *fullname);
+
+#if 0
+void ringtone_play_sound(const char *sound_file, player_h **mp_handle);
+void ringtone_stop_sound(void *data);
+#endif
+
+#endif /* __SYSTEM_SETTINGS_RINGTONES_H__ */
/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2020 Samsung Electronics Co., Ltd All Rights Reserved
*
- * Licensed under the Apache License, Version 2.0 (the License);
+ * 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,
+ * 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 <vconf.h>
#include <dlog.h>
-#include <system_settings.h>
-#include <system_settings_private.h>
+#include "system_settings.h"
+#include "sys_settings.h"
#ifdef LOG_TAG
#undef LOG_TAG
+++ /dev/null
-#ifndef __SYSTEM_SETTING_CONFIG_IN_H
-#define __SYSTEM_SETTING_CONFIG_IN_H
-
-#define VERSION_MAJOR @VERSION_MAJOR@
-
-#define VERSION_MINOR @VERSION_MINOR@
-
-#define SETTING_DEF_RES_PATH @SETTING_DEF_RES_PATH@
-
-#define SETTING_TIME_ZONEINFO_PATH @SETTING_TIME_ZONEINFO_PATH@
-
-#define SETTING_TZONE_SYMLINK_PATH @SETTING_TZONE_SYMLINK_PATH@
-
-#endif /* __SYSTEM_SETTING_CONFIG_IN_H */
+++ /dev/null
-#set variable
-# SYSTEM_SETTINGS_UTIL - setting-common
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(${SYSTEM_SETTINGS_UTIL})
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-SET(requires "dlog vconf fontconfig libxml-2.0 pkgmgr pkgmgr-info libsystemd")
-
-PKG_CHECK_MODULES(system_settings_util REQUIRED ${requires})
-
-FOREACH(flag ${system_settings_util_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Werror-implicit-function-declaration ${COVERAGE_TEST_FLAGS}")
-
-IF (CMAKE_BUILD_TYPE STREQUAL "UNITTEST")
- SET(COVERAGE_TEST_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage --coverage")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_TEST_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-ADD_DEFINITIONS("-DUNIT_TEST")
-ENDIF() #CMAKE_BUILD_TYPE STREQUAL "UNITTEST"
-
-
-
-
-IF("${ARCH}" STREQUAL "arm")
- ADD_DEFINITIONS("-DTARGET")
- MESSAGE("add -DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
-ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
-ADD_DEFINITIONS("-DSLP_DEBUG")
-ADD_DEFINITIONS("-shared")
-
-#SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl, --rpath=/usr/lib")
-
-#make lib-${LIB_SYSTEM_SETTINGS_UTIL}.so files
-ADD_LIBRARY(${LIB_SYSTEM_SETTINGS_UTIL} SHARED
- ./src/system_settings_util.c
-)
-
-TARGET_LINK_LIBRARIES(${LIB_SYSTEM_SETTINGS_UTIL} ${system_settings_util_LDFLAGS})
-SET_TARGET_PROPERTIES(${LIB_SYSTEM_SETTINGS_UTIL} PROPERTIES VERSION 0.1.0 SOVERSION 1)
-INSTALL(TARGETS ${LIB_SYSTEM_SETTINGS_UTIL} DESTINATION ${CMAKE_LIBDIR})
-
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/system_settings_util.h DESTINATION ${CMAKE_INCLUDEDIR})
-IF (CMAKE_BUILD_TYPE STREQUAL "UNITTEST")
-INSTALL(
- DIRECTORY "CMakeFiles" DESTINATION /usr/src/packages/BUILD/capi-system-system-settings-${FULLVER}/system-settings-util/
- FILES_MATCHING
- PATTERN "*.gcno"
- )
-ENDIF() #CMAKE_BUILD_TYPE STREQUAL "UNITTEST"
--- /dev/null
+SET(UNITTEST "sys-settings-test")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")
+
+SET(VCONF_MOCK "vconf-mock")
+ADD_LIBRARY(${VCONF_MOCK} SHARED mocks/vconf.cpp)
+
+SET(PKGMGR_INFO_MOCK "pkgmgr-info-mock")
+ADD_LIBRARY(${PKGMGR_INFO_MOCK} SHARED mocks/pkgmgrinfo_appinfo.c)
+
+SET(EFL_EXTENSION_INFO_MOCK "efl-extension-mock")
+ADD_LIBRARY(${EFL_EXTENSION_INFO_MOCK} SHARED mocks/efl-extension.c)
+
+FILE(GLOB TEST_SRCS *.c)
+ADD_DEFINITIONS("-DN_THREADS=${N_THREADS}")
+ADD_DEFINITIONS(-DSYS_SETTINGS_TEST_DIR=\"${TEST_INSTALL_DIR}\")
+ADD_EXECUTABLE(${UNITTEST} ${TEST_SRCS})
+TARGET_LINK_LIBRARIES(${UNITTEST} ${PROJECT_NAME} dl)
+INSTALL(TARGETS ${UNITTEST} DESTINATION ${TEST_INSTALL_DIR})
+
+FILE(GLOB TEST_RES res/*)
+INSTALL(FILES ${TEST_RES} DESTINATION ${TEST_INSTALL_DIR})
--- /dev/null
+/*
+ * Copyright (c) 2020 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 <stdbool.h>
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+API bool eext_config_font_set(char *name, int size)
+{
+ return true;
+}
+
+/*
+ * Copyright (c) 2020 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 <stdbool.h>
/*
- * Copyright (C) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
*
- * Licensed under the Apache License, Version 2.0 (the License);
+ * 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
+ * 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,
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-#pragma once
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sqlite3.h>
#include <unistd.h>
-
#include <iostream>
#include <map>
#include <string>
-#define LOG_D //fprintf
+#define LOG_D(fmt, arg...) //fprintf(fmt, arg...)
#define LOG_E fprintf
using namespace std;
case VCONF_TYPE_BOOL:
node.value.b = value->b;
break;
-defalut:
+ default:
LOG_D(stdout, "[%s][%d] invalid type [%d] \n", __func__, __LINE__, node.type );
return;
}
static sqlite3 *db = NULL;
- int _sqlite_close() {
+ void _sqlite_close() {
if( db != NULL ){
sqlite3_close(db);
db = NULL;
}
int _sqlite_connect() {
-
- int rc;
- char *err_msg = 0;
- char sql[MAX_BUF_LEN+1];
-
if( db != NULL ) {
return VCONF_OK;
}
- rc = sqlite3_open(DB_NAME, &db);
+ int rc = sqlite3_open(DB_NAME, &db);
if (rc != SQLITE_OK) {
LOG_E(stderr, "[%s][%d] sqlite3_open error: rc [%d] sqlerrcode[%d] sqlexterrcode[%d] sqlmessage[%s]\n", __func__, __LINE__, rc, sqlite3_errcode(db), sqlite3_extended_errcode(db), sqlite3_errmsg(db));
_sqlite_close();
return VCONF_ERROR;
}
+ return VCONF_OK;
}
/************************************************
popd
createVconfDb() {
- pushd script
+ pushd scripts
./convert_vconf_script_to_sql.sh
if [ ! -f vconf.db ]
#========================================================================================
# Causion : Need to root permission
#========================================================================================
-cp -f ../system-settings-util/libsystem-settings-util.so* /usr/lib
+cp -f ../utils/libsystem-settings-util.so* /usr/lib
echo "link [/opt/etc/localtime]"
ln -sf /etc/localtime /opt/etc/localtime
touch "/opt/usr/test/tct-content-tizen-tests_video.mp4"
#========================================================================================
-unitTestFile=system-setting-unittest
+unitTestFile=sys-settings-test
if [ ! -x "${unitTestFile}" ]
then
echo "${unitTestFile} file does not exist!"
set logging file /opt/usr/share/unit_test_gdb_logs.txt
set logging on
set confirm off
-file /usr/local/bin/system-setting-unittest
+file /usr/bin/sys-settings/sys-settings-test
r # run it once
break exit
commands
sudo cp -rf . /home/abuild/rpmbuild/BUILD/$APP-$VERSHORT
SDB=/usr/bin/sdb
-GDB_SCRIPT=$PWD/unit_test/script/unit_test_gdb_script
-UNIT_TEST_RESOURCE=$PWD/unit_test/resource/*
+GDB_SCRIPT=$PWD/tests/scripts/unit_test_gdb_script
+UNIT_TEST_RESOURCE=$PWD/tests/res/*
$SDB root on
$SDB shell mount -o remount,rw /
$SDB push $RPM_ROOT/$APP-$VER.$ARCH.rpm /opt
export GCOV_PREFIX=/opt
if [ -z $GDB_TEST]; then
-$SDB shell su - -c "G_DEBUG=fatal-criticals GCOV_PREFIX=/usr/src/packages GCOV_PREFIX_STRIP=3 /usr/local/bin/system-setting-unittest"
+$SDB shell su - -c "G_DEBUG=fatal-criticals GCOV_PREFIX=/usr/src/packages GCOV_PREFIX_STRIP=3 /usr/bin/sys-settings/sys-settings-test"
else
$SDB shell su - -c "G_DEBUG=fatal-criticals GCOV_PREFIX=/usr/src/packages GCOV_PREFIX_STRIP=3 gdb -x /usr/local/bin/unit_test_gdb_script"
fi
echo "UNIT TEST----------------------------------------------------"
export GCOV_PREFIX=/opt
-$SDB shell G_DEBUG=fatal-criticals GCOV_PREFIX=/usr/src/packages GCOV_PREFIX_STRIP=3 /usr/local/bin/system-setting-unittest
+$SDB shell G_DEBUG=fatal-criticals GCOV_PREFIX=/usr/src/packages GCOV_PREFIX_STRIP=3 /usr/bin/sys-settings/sys-settings-test
echo "COVERAGE TEST----------------------------------------------------"
sdb pull /usr/src/packages/BUILD/$APP-$VERSHORT/CMakeFiles > /dev/null 2>&1
-#include <system_settings.h>
-
-#include <unit_test_fw.h>
+/*
+ * Copyright (c) 2017-2020 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 <system_settings.h>
+#include "sys_settings_test_fw.h"
void unit_test_callback0(system_settings_key_e key, void *user_data) { }
void unit_test_callback1(system_settings_key_e key, void *user_data) { }
#define my_assert_ret(retcode) do{ \
if (retcode != SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED) { \
if (retcode != SYSTEM_SETTINGS_ERROR_NONE) \
- printf("Error!!\n"); \
+ printf("Error!!(%d)\n", retcode); \
assert(retcode == SYSTEM_SETTINGS_ERROR_NONE); \
} \
}while(0)
}
static bool _callback_called = false;
-static char *new_ringtonepath = "/opt/usr/share/ringtone_sdk.mp3";
+static char *new_ringtonepath = SYS_SETTINGS_TEST_DIR "/ringtone_sdk.mp3";
/**
* @function utc_system_settings_startup
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// 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 _ASSERT_H_
-#define _ASSERT_H_
+/*
+ * Copyright (c) 2020 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.
+ */
+#pragma once
+
#include <stdio.h>
#include <stdlib.h>
#define assert_leq(var, ref) g_assert(var <= ref)
#endif //GLIB_MODE
-
-#endif // _ASSERT_H_
-#include <unit_test_fw.h>
+/*
+ * Copyright (c) 2017-2020 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 "sys_settings_test_fw.h"
typedef struct __thread_test_table {
char * test_name;
--- /dev/null
+/*
+ * Copyright (c) 2017-2020 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 __UNIT_TEST_FW__
+#define __UNIT_TEST_FW__
+
+#define GLIB_MODE
+
+#include <stdio.h>
+#include <glib.h>
+#include <unistd.h>
+
+#include "sys_settings_test.h"
+
+void add_test_func(char * test_name, GTestFunc func_pointer);
+void unittest_api();
+
+#ifndef SYS_SETTINGS_TEST_DIR
+#define SYS_SETTINGS_TEST_DIR "/usr/bin/sys-settings"
+#warning "SYS_SETTINGS_TEST_DIR is redefined"
+#endif
+
+#ifdef GLIB_MODE
+#define RETTYPE void
+#define RETURN(a) return
+#else
+#define RETTYPE int
+#define RETURN(a) return a
+#endif
+
+#ifndef N_THREADS
+#define N_THERADS 0
+#endif
+
+#define MAX_TEST_CASE 1000
+
+#endif
+++ /dev/null
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(fw_name "capi-system-system-settings")
-SET(unit_test "system-setting-unittest")
-
-SET(requires "dlog vconf fontconfig libxml-2.0 sqlite3 pkgmgr pkgmgr-info alarm-service capi-media-metadata-extractor aul json-glib-1.0 capi-appfw-app-manager capi-appfw-package-manager capi-system-info glib-2.0")
-
-PROJECT(${unit_test})
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_name} REQUIRED ${requires})
-FOREACH(flag ${${fw_name}_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(${unit_test} REQUIRED ${requires})
-FOREACH(flag ${${unit_test}_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-#=======================================================================================#
-SET(VCONF_MOCK "vconf-mock")
-SET(VCONF_MOCK_SRCS src/vconf.cpp )
-SET(VCONF_MOCK_CFLAGS "${CMAKE_C_FLAGS}" )
-ADD_LIBRARY(${VCONF_MOCK} SHARED ${VCONF_MOCK_SRCS})
-SET_TARGET_PROPERTIES(${VCONF_MOCK} PROPERTIES
- COMPILE_FLAGS ${VCONF_MOCK_CFLAGS}
-)
-#=======================================================================================#
-SET(PKGMGR_INFO_MOCK "pkgmgr-info-mock")
-SET(PKGMGR_INFO_MOCK_SRCS src/pkgmgrinfo_appinfo.c )
-SET(PKGMGR_INFO_MOCK_CFLAGS "${CMAKE_C_FLAGS}" )
-ADD_LIBRARY(${PKGMGR_INFO_MOCK} SHARED ${PKGMGR_INFO_MOCK_SRCS})
-SET_TARGET_PROPERTIES(${PKGMGR_INFO_MOCK} PROPERTIES
- COMPILE_FLAGS ${PKGMGR_INFO_MOCK_CFLAGS}
-)
-#=======================================================================================#
-SET(EFL_EXTENSION_INFO_MOCK "efl-extension-mock")
-SET(EFL_EXTENSION_INFO_MOCK_SRCS src/efl-extension.c )
-SET(EFL_EXTENSION_INFO_MOCK_CFLAGS "${CMAKE_C_FLAGS}" )
-ADD_LIBRARY(${EFL_EXTENSION_INFO_MOCK} SHARED ${EFL_EXTENSION_INFO_MOCK_SRCS})
-SET_TARGET_PROPERTIES(${EFL_EXTENSION_INFO_MOCK} PROPERTIES
- COMPILE_FLAGS ${EFL_EXTENSION_INFO_MOCK_CFLAGS}
-)
-#=======================================================================================#
-SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
-ADD_DEFINITIONS("-DN_THREADS=${N_THREADS}")
-ADD_EXECUTABLE(${unit_test} src/unit_test.c
- src/unit_test_fw.c)
-
-TARGET_LINK_LIBRARIES(${unit_test} ${fw_name} "-ldl")
-INSTALL(TARGETS ${unit_test} DESTINATION /usr/local/bin)
-
+++ /dev/null
-#ifndef __UNIT_TEST_FW__
-#define __UNIT_TEST_FW__
-
-#define GLIB_MODE
-
-#include <stdio.h>
-#include <glib.h>
-#include <unistd.h>
-
-#include <unit_test_assert.h>
-
-void add_test_func(char * test_name, GTestFunc func_pointer);
-void unittest_api();
-
-#ifdef GLIB_MODE
-#define RETTYPE void
-#define RETURN(a) return
-#else
-#define RETTYPE int
-#define RETURN(a) return a
-#endif
-
-#ifndef N_THREADS
-#define N_THERADS 0
-#endif
-
-#define MAX_TEST_CASE 1000
-
-#endif
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdbool.h>
-
-#ifndef API
-#define API __attribute__ ((visibility("default")))
-#endif
-
-API bool eext_config_font_set(char *name, int size)
-{
- return true;
-}
-
+++ /dev/null
-VCONF_BUXTON_1.0 {
- global:
- vconf_keynode_get_name;
- vconf_keynode_get_type;
- vconf_keynode_get_int;
- vconf_keynode_get_dbl;
- vconf_keynode_get_bool;
- vconf_keynode_get_str;
- vconf_notify_key_changed;
- vconf_ignore_key_changed;
- vconf_set_int;
- vconf_set_bool;
- vconf_set_str;
- vconf_set_dbl;
- vconf_get_int;
- vconf_get_bool;
- vconf_get_str;
- vconf_get_dbl;
- vconf_get_ext_errno;
- vconf_keylist_new;
- vconf_keylist_free;
- vconf_keylist_add_int;
- vconf_keylist_add_bool;
- vconf_keylist_add_dbl;
- vconf_keylist_add_str;
- vconf_keylist_add_null;
- vconf_keylist_del;
- vconf_keylist_nextnode;
- vconf_keylist_rewind;
- vconf_get;
- vconf_set;
- vconf_unset;
- vconf_unset_recursive;
- vconf_sync_key;
- vconf_keylist_lookup;
- local:
- *;
-};
--- /dev/null
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
+
+SET(LIB_UTILS system-settings-util)
+
+FILE(GLOB UTILS_SRCS *.c)
+
+PKG_CHECK_MODULES(utils_pkgs REQUIRED dlog vconf fontconfig libxml-2.0 pkgmgr pkgmgr-info libsystemd)
+INCLUDE_DIRECTORIES(${client_pkgs_INCLUDE_DIRS})
+LINK_DIRECTORIES(${client_pkgs_LIBRARY_DIRS})
+
+ADD_LIBRARY(${LIB_UTILS} SHARED ${UTILS_SRCS})
+TARGET_LINK_LIBRARIES(${LIB_UTILS} ${utils_LIBRARIES})
+INSTALL(TARGETS ${LIB_UTILS} DESTINATION ${LIB_INSTALL_DIR})
#include <fontconfig/fontconfig.h>
#include <pkgmgr-info.h>
-
-#include <system_settings.h>
-#include <system_settings_private.h>
-
#include <tzplatform_config.h>
-#include <system_settings_util.h>
-#include <system_settings_font.h>
+
+#include "system_settings.h"
+#include "sys_settings.h"
+#include "sys_settings_util.h"
+#include "sys_settings_font.h"
#ifdef TIZEN_WEARABLE
#define SMALL_FONT_DPI (-90)