INCLUDE(FindPkgConfig)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
SET(SETTING_TZONE_SYMLINK_PATH "\"/opt/etc/localtime\"")
SET(EXTRA_FLAGS "-Wall -Werror -fvisibility=hidden")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS} -std=c++11")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
--- /dev/null
+/*
+ * Copyright (c) 2019-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 "sst_log.h"
+
+#ifdef API
+#undef API
+#endif
+#define API __attribute__((visibility("default")))
+
--- /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.
+ */
+#pragma once
+
+#define SST_LOG_RED "\033[31m"
+#define SST_LOG_GREEN "\033[32m"
+#define SST_LOG_BROWN "\033[33m"
+#define SST_LOG_BLUE "\033[34m"
+#define SST_LOG_END "\033[0m"
+
+#undef __DBG
+#undef __INFO
+#undef __WARN
+#undef __ERR
+
+#undef _DBG
+#undef _INFO
+#undef _WARN
+#undef _ERR
+
+#undef DBG
+#undef INFO
+#undef WARN
+#undef ERR
+
+#ifdef SST_STDOUT
+#include <stdio.h>
+#include <string.h>
+#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
+#define __DBG(fmt, arg...) printf("[SST]%s(%d):" fmt "\n", __FILENAME__, __LINE__, ##arg)
+#define __INFO(fmt, arg...) printf("[SST]%s(%d):" fmt "\n", __FILENAME__, __LINE__, ##arg)
+#define __WARN(fmt, arg...) printf("[SST]%s(%d):" fmt "\n", __FILENAME__, __LINE__, ##arg)
+#define __ERR(fmt, arg...) printf("[SST]%s(%d):" fmt "\n", __FILENAME__, __LINE__, ##arg)
+#define __SECU_DBG(fmt, arg...) printf("[SST]%s(%d):" fmt "\n", __FILENAME__, __LINE__, ##arg)
+#define __SECU_INFO(fmt, arg...) printf("[SST]%s(%d):" fmt "\n", __FILENAME__, __LINE__, ##arg)
+#else
+#define LOG_TAG "SYSTEM-SETTINGS"
+#include <dlog.h>
+#define __DBG(fmt, arg...) SLOGD(fmt, ##arg)
+#define __INFO(fmt, arg...) SLOGI(fmt, ##arg)
+#define __WARN(fmt, arg...) SLOGW(fmt, ##arg)
+#define __ERR(fmt, arg...) SLOGE(fmt, ##arg)
+#define __SECU_DBG(fmt, arg...) SECURE_SLOGD(fmt, ##arg)
+#define __SECU_INFO(fmt, arg...) SECURE_SLOGI(fmt, ##arg)
+#endif /* SST_STDOUT */
+
+
+#ifdef SST_TEST
+#define _DBG(fmt, arg...) __DBG(SST_LOG_BROWN "<Test>" SST_LOG_END fmt, ##arg)
+#define _INFO(fmt, arg...) __INFO(SST_LOG_BLUE "<Test>" SST_LOG_END fmt, ##arg)
+#define _WARN(fmt, arg...) __WARN(SST_LOG_GREEN "<Test>" SST_LOG_END fmt, ##arg)
+#define _ERR(fmt, arg...) __ERR(SST_LOG_RED "<Test>" SST_LOG_END fmt, ##arg)
+#else
+#define _DBG(fmt, arg...) __DBG(fmt, ##arg)
+#define _INFO(fmt, arg...) __INFO(fmt, ##arg)
+#define _WARN(fmt, arg...) __WARN(fmt, ##arg)
+#define _ERR(fmt, arg...) __ERR(fmt, ##arg)
+#endif
+
+#define SST_DEBUGGING
+
+#ifdef SST_DEBUGGING
+#define DBG(fmt, arg...) _DBG(fmt, ##arg)
+#define WARN(fmt, arg...) _WARN(fmt, ##arg)
+#define ERR(fmt, arg...) _ERR(fmt, ##arg)
+#define INFO(fmt, arg...) _INFO(fmt, ##arg)
+#define SST_SECURE_DEBUG(fmt, arg...) __SECU_DBG(SST_LOG_BROWN fmt SST_LOG_END, ##arg)
+#define SST_SECURE_TRACE(fmt, arg...) __SECU_INFO(SST_LOG_GREEN fmt SST_LOG_END, ##arg)
+#define SST_SECURE_BEGIN __SECU_DBG(SST_LOG_BLUE "ENTER FUNCTION: %s\n" SST_LOG_END, __FUNCTION__)
+#define SST_SECURE_END __SECU_DBG(SST_LOG_BLUE "EXIT FUNCTION: %s\n" SST_LOG_END, __FUNCTION__)
+
+#else /* SST_DEBUGGING */
+#define DBG(fmt, arg...)
+#define WARN(fmt, arg...)
+#define ERR(fmt, arg...)
+#define INFO(fmt, arg...)
+#define SECURE_DBG(fmt, arg...)
+#define SECURE_ERR(fmt, arg...)
+
+#endif /* SST_DEBUGGING */
+
+#define RET_IF(expr) \
+ do { \
+ if (expr) { \
+ ERR("(%s)", #expr); \
+ return; \
+ } \
+ } while (0)
+
+#define RETV_IF(expr, val) \
+ do { \
+ if (expr) { \
+ ERR("(%s)", #expr); \
+ return (val); \
+ } \
+ } while (0)
+
+#define RETM_IF(expr, fmt, arg...) \
+ do { \
+ if (expr) { \
+ ERR(fmt, ##arg); \
+ return; \
+ } \
+ } while (0)
+
+#define RETVM_IF(expr, val, fmt, arg...) \
+ do { \
+ if (expr) { \
+ ERR(fmt, ##arg); \
+ return (val); \
+ } \
+ } while (0)
+
+#define ERR_IF(expr) \
+ do { \
+ if (expr) { \
+ ERR("(%s)", #expr); \
+ } \
+ } while (0)
+
+#define WARN_IF(expr, fmt, arg...) \
+ do { \
+ if (expr) { \
+ WARN(fmt, ##arg); \
+ } \
+ } while (0)
export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
%endif
-%ifarch aarch64 x86_64
-export CFLAGS+="$CFLAGS -DSETTING_ARCH_64"
-export CXXFLAGS+="$CXXFLAGS -DSETTING_ARCH_64"
-export FFLAGS+="$FFLAGS -DSETTING_ARCH_64"
-%endif
-
%if 0%{?gcov:1}
export CFLAGS+=" -fprofile-arcs -ftest-coverage"
export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
%endif
%check
-#cd tests
-#bash ./run_coverage.sh
+bash tests/scripts/vconf_golden_master.sh
+LD_LIBRARY_PATH=.:tests:utils LD_PRELOAD=tests/libsys-settings-mock.so tests/sys-settings-test
%post unittests
XDG_RUNTIME_DIR=/run %{sys_setting_test_dir}/sys-settings-test
#include <vconf.h>
#include <dlog.h>
+#include "sst.h"
#include "system_settings.h"
#include "sys_settings.h"
}
/* LCOV_EXCL_STOP */
-int system_settings_get_value(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+API int system_settings_get_value(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
}
/* LCOV_EXCL_START */
-int system_settings_set_value(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+API int system_settings_set_value(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key) || value == NULL)
/* LCOV_EXCL_START */
-int system_settings_del_value(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+API int system_settings_del_value(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key) || value == NULL)
/* LCOV_EXCL_START */
-int system_settings_list_value(system_settings_key_e key, system_setting_data_type_e data_type, bool(*system_setting_data_iterator)(int, const char*, void *), void *user_data)
+API int system_settings_list_value(system_settings_key_e key, system_setting_data_type_e data_type, bool(*system_setting_data_iterator)(int, const char*, void *), void *user_data)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
-int system_settings_set_value_int(system_settings_key_e key, int value)
+API int system_settings_set_value_int(system_settings_key_e key, int value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
}
/* LCOV_EXCL_STOP */
-int system_settings_get_value_int(system_settings_key_e key, int *value)
+API int system_settings_get_value_int(system_settings_key_e key, int *value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
}
/* LCOV_EXCL_START */
-int system_settings_set_value_bool(system_settings_key_e key, bool value)
+API int system_settings_set_value_bool(system_settings_key_e key, bool value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
}
/* LCOV_EXCL_STOP */
-int system_settings_get_value_bool(system_settings_key_e key, bool *value)
+API int system_settings_get_value_bool(system_settings_key_e key, bool *value)
{
LOGE("Enter [%s]", __FUNCTION__);
SETTING_TRACE(" SIGNED LONG here ******************* log here *************** ");
}
/* LCOV_EXCL_START */
-int system_settings_set_value_string(system_settings_key_e key, const char *value)
+API int system_settings_set_value_string(system_settings_key_e key, const char *value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
}
/* LCOV_EXCL_STOP */
-int system_settings_get_value_string(system_settings_key_e key, char **value)
+API int system_settings_get_value_string(system_settings_key_e key, char **value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return system_setting_vconf_unset_changed_cb(item->vconf_key, GET_SLOT(item->key));
}
-/*PUBLIC*/
-int system_settings_set_changed_cb(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+API int system_settings_set_changed_cb(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
{
LOGE("Enter [%s]", __FUNCTION__);
system_setting_h system_setting_item;
}
-int system_settings_unset_changed_cb(system_settings_key_e key)
+API int system_settings_unset_changed_cb(system_settings_key_e key)
{
LOGE("Enter [%s]", __FUNCTION__);
system_setting_h system_setting_item;
return system_setting_unset_changed_cb(system_setting_item);
}
-int system_settings_add_changed_cb(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+API int system_settings_add_changed_cb(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
{
LOGE("Enter [%s]", __FUNCTION__);
system_setting_h system_setting_item;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-int system_settings_remove_changed_cb(system_settings_key_e key, system_settings_changed_cb callback)
+API int system_settings_remove_changed_cb(system_settings_key_e key, system_settings_changed_cb callback)
{
LOGE("Enter [%s]", __FUNCTION__);
system_setting_h system_setting_item;
// list
//////////////////////////////////////////////////////////////////////////////////////////////////
-int system_settings_foreach_value_string(system_settings_key_e key, system_settings_iter_cb callback, void *value)
+API int system_settings_foreach_value_string(system_settings_key_e key, system_settings_iter_cb callback, void *value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
// add
//////////////////////////////////////////////////////////////////////////////////////////////////
-int system_settings_add_value_string(system_settings_key_e key, const char* value)
+API int system_settings_add_value_string(system_settings_key_e key, const char* value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
// del
//////////////////////////////////////////////////////////////////////////////////////////////////
-int system_settings_delete_value_string(system_settings_key_e key, const char* value)
+API int system_settings_delete_value_string(system_settings_key_e key, const char* value)
{
LOGE("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
}
}
/* LCOV_EXCL_STOP */
-
-
} while (0);
#define FREE(arg) __FREE(free, arg)
-#ifdef SETTING_ARCH_64
-#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"
-#endif
+#define SETTING_UTILS_SO_FILE_PATH "libsystem-settings-util.so"
int _is_file_accessible(const char *path);
SET(UNITTEST "sys-settings-test")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")
+ADD_DEFINITIONS("-DSST_TEST")
-SET(VCONF_MOCK "vconf-mock")
-ADD_LIBRARY(${VCONF_MOCK} SHARED mocks/vconf.cpp)
+FILE(GLOB MOCK_SRCS mocks/*.c mocks/*.cpp)
+SET(MOCK_LIB "sys-settings-mock")
+ADD_LIBRARY(${MOCK_LIB} SHARED ${MOCK_SRCS})
-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)
+SET(EFL_EXTENSION_MOCK "efl-extension")
+ADD_LIBRARY(${EFL_EXTENSION_MOCK} SHARED mocks/efl-extension.c)
+SET_TARGET_PROPERTIES(${EFL_EXTENSION_MOCK} PROPERTIES SOVERSION 0)
FILE(GLOB TEST_SRCS *.c)
ADD_DEFINITIONS("-DN_THREADS=${N_THREADS}")
--- /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.
+ */
+#define _GNU_SOURCE
+#include <string.h>
+#include <unistd.h>
+#include <dlfcn.h>
+#include <dirent.h>
+#include <sys/types.h>
+#include "sst.h"
+
+API int access(const char *pathname, int mode)
+{
+ if (0 == strcmp(pathname, "/opt/usr/data/settings/Ringtones/ringtone_sdk.mp3"))
+ return 0;
+ if (0 == strcmp(pathname, "/opt/usr/data/settings/Alerts/Over the horizon.mp3"))
+ return 0;
+ if (0 == strcmp(pathname, "/usr/bin/sys-settings/ringtone_sdk.mp3"))
+ return 0;
+ if (0 == strcmp(pathname, "/opt/usr/test/big_buck_bunny.mp4"))
+ return 0;
+ if (0 == strcmp(pathname, "/opt/usr/test/daliTestVideo.mp4"))
+ return 0;
+ if (0 == strcmp(pathname, "/opt/usr/test/sound_5.wav"))
+ return 0;
+ if (0 == strcmp(pathname, "/opt/usr/test/tct-content-tizen-tests_video.mp4"))
+ return 0;
+
+ int (*org_fn)(const char *, int) = NULL;
+ org_fn = dlsym(RTLD_NEXT, "access");
+ return org_fn(pathname, mode);
+}
+
+API ssize_t readlink(const char *restrict path, char *restrict buf, size_t len)
+{
+ if (0 == strcmp(path, "/opt/etc/localtime")) {
+ memcpy(buf, "123456789012345678901234567890", len);
+ return 30;
+ }
+
+ ssize_t(*org_fn)(const char *restrict, char *restrict, size_t) = NULL;
+ org_fn = dlsym(RTLD_NEXT, "readlink");
+ return org_fn(path, buf, len);
+}
+
+API DIR* opendir(const char *name)
+{
+ DIR* (*org_fn)(const char *) = NULL;
+ org_fn = dlsym(RTLD_NEXT, "opendir");
+
+ if (0 == strcmp(name, SETTING_DEF_RES"/Ringtones")) {
+ org_fn = dlsym(RTLD_NEXT, "opendir");
+ return org_fn("tests/res");
+ }
+
+ return org_fn(name);
+}
#include <string.h>
#include <pkgmgr-info.h>
-
-#ifndef API
-#define API __attribute__ ((visibility("default")))
-#endif
+#include "sst.h"
API int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid,
pkgmgrinfo_appinfo_h *handle)
--- /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.
+ */
+#define _GNU_SOURCE
+#include <string.h>
+#include <dlfcn.h>
+#include <stdbool.h>
+#include "sst.h"
+
+API int system_info_get_platform_bool(const char *key, bool *value)
+{
+ if (0 == strcmp(key, "tizen.org/feature/systemsetting.font")) {
+ *value = true;
+ return 0;
+ }
+ if (0 == strcmp(key, "tizen.org/feature/systemsetting.incoming_call")) {
+ *value = true;
+ return 0;
+ }
+ if (0 == strcmp(key, "tizen.org/feature/systemsetting.home_screen")) {
+ *value = true;
+ return 0;
+ }
+ if (0 == strcmp(key, "tizen.org/feature/systemsetting.lock_screen")) {
+ *value = true;
+ return 0;
+ }
+ if (0 == strcmp(key, "tizen.org/feature/systemsetting.notification_email")) {
+ *value = true;
+ return 0;
+ }
+ if (0 == strcmp(key, "tizen.org/feature/network.wifi")) {
+ *value = true;
+ return 0;
+ }
+ if (0 == strcmp(key, "tizen.org/feature/network.telephony")) {
+ *value = true;
+ return 0;
+ }
+ if (0 == strcmp(key, "tizen.org/feature/accessibility.grayscale")) {
+ *value = true;
+ return 0;
+ }
+ if (0 == strcmp(key, "tizen.org/feature/accessibility.negative")) {
+ *value = true;
+ return 0;
+ }
+ if (0 == strcmp(key, "tizen.org/feature/input.rotating_bezel")) {
+ *value = true;
+ return 0;
+ }
+
+ int (*fn_org)(const char *, bool *) = NULL;
+ fn_org = dlsym(RTLD_NEXT, "system_info_get_platform_bool");
+ return fn_org(key, value);
+}
+
+API int system_info_get_platform_string(const char *key, char **value)
+{
+ if (0 == strcmp(key, "tizen.org/feature/profile")) {
+ *value = strdup("mobile");
+ return 0;
+ }
+
+ int (*fn_org)(const char *, char **) = NULL;
+ fn_org = dlsym(RTLD_NEXT, "system_info_get_platform_string");
+ return fn_org(key, value);
+}
#include <iostream>
#include <map>
#include <string>
+#include "sst.h"
#define LOG_D(fmt, arg...) //fprintf(fmt, arg...)
#define LOG_E fprintf
using namespace std;
-#ifndef EXPORT
-# define EXPORT __attribute__((visibility("default")))
-#endif
-
typedef std::map<string, pair<void*, void*>> NotifyMap;
static NotifyMap notifyCallBackMap;
/************************************************
* keynode handling APIs *
************************************************/
-EXPORT char *vconf_keynode_get_name(keynode_t *keynode)
+API char *vconf_keynode_get_name(keynode_t *keynode)
{
return NULL;
}
-EXPORT int vconf_keynode_get_type(keynode_t *keynode)
+API int vconf_keynode_get_type(keynode_t *keynode)
{
return 0;
}
-EXPORT int vconf_keynode_get_int(keynode_t *keynode)
+API int vconf_keynode_get_int(keynode_t *keynode)
{
return 0;
}
-EXPORT double vconf_keynode_get_dbl(keynode_t *keynode)
+API double vconf_keynode_get_dbl(keynode_t *keynode)
{
return 0;
}
-EXPORT int vconf_keynode_get_bool(keynode_t *keynode)
+API int vconf_keynode_get_bool(keynode_t *keynode)
{
return 0;
}
-EXPORT char *vconf_keynode_get_str(keynode_t *keynode)
+API char *vconf_keynode_get_str(keynode_t *keynode)
{
return NULL;
}
return NULL;
}
-EXPORT int vconf_keylist_rewind(keylist_t *keylist)
+API int vconf_keylist_rewind(keylist_t *keylist)
{
return 0;
}
-EXPORT int vconf_keylist_free(keylist_t *keylist)
+API int vconf_keylist_free(keylist_t *keylist)
{
return 0;
}
-EXPORT int vconf_keylist_lookup(keylist_t *keylist, const char *keyname,
+API int vconf_keylist_lookup(keylist_t *keylist, const char *keyname,
keynode_t **return_node)
{
return 0;
}
-EXPORT keynode_t *vconf_keylist_nextnode(keylist_t *keylist)
+API keynode_t *vconf_keylist_nextnode(keylist_t *keylist)
{
return NULL;
}
-EXPORT int vconf_keylist_add_int(keylist_t *keylist, const char *keyname,
+API int vconf_keylist_add_int(keylist_t *keylist, const char *keyname,
const int value)
{
return 0;
}
-EXPORT int vconf_keylist_add_bool(keylist_t *keylist, const char *keyname,
+API int vconf_keylist_add_bool(keylist_t *keylist, const char *keyname,
const int value)
{
return 0;
}
-EXPORT int vconf_keylist_add_dbl(keylist_t *keylist, const char *keyname,
+API int vconf_keylist_add_dbl(keylist_t *keylist, const char *keyname,
const double value)
{
return 0;
}
-EXPORT int vconf_keylist_add_str(keylist_t *keylist, const char *keyname,
+API int vconf_keylist_add_str(keylist_t *keylist, const char *keyname,
const char *value)
{
return 0;
}
-EXPORT int vconf_keylist_add_null(keylist_t *keylist, const char *keyname)
+API int vconf_keylist_add_null(keylist_t *keylist, const char *keyname)
{
return 0;
}
-EXPORT int vconf_keylist_del(keylist_t *keylist, const char *keyname)
+API int vconf_keylist_del(keylist_t *keylist, const char *keyname)
{
return 0;
}
return VCONF_OK;
}
-EXPORT int vconf_set(keylist_t *keylist)
+API int vconf_set(keylist_t *keylist)
{
return 0;
}
-EXPORT int vconf_set_int(const char *in_key, const int intval)
+API int vconf_set_int(const char *in_key, const int intval)
{
int rc;
char buf[MAX_BUF_LEN + 1];
return VCONF_OK;
}
-EXPORT int vconf_set_bool(const char *in_key, const int boolval)
+API int vconf_set_bool(const char *in_key, const int boolval)
{
int rc;
char buf[MAX_BUF_LEN + 1];
return VCONF_OK;
}
-EXPORT int vconf_set_dbl(const char *in_key, const double dblval)
+API int vconf_set_dbl(const char *in_key, const double dblval)
{
int rc;
char buf[MAX_BUF_LEN + 1];
return VCONF_OK;
}
-EXPORT int vconf_set_str(const char *in_key, const char *strval)
+API int vconf_set_str(const char *in_key, const char *strval)
{
int rc;
return VCONF_OK;
}
-EXPORT int vconf_get(keylist_t *keylist, const char *in_parentDIR, get_option_t option)
+API int vconf_get(keylist_t *keylist, const char *in_parentDIR, get_option_t option)
{
return 0;
}
-EXPORT char *vconf_get_str(const char *in_key)
+API char *vconf_get_str(const char *in_key)
{
int rc;
char sql[MAX_BUF_LEN + 1];
return str;
}
-EXPORT int vconf_get_int(const char *in_key, int *intval)
+API int vconf_get_int(const char *in_key, int *intval)
{
LOG_D(stdout, "[%s][%d] start!\n", __func__, __LINE__);
return VCONF_OK;
}
-EXPORT int vconf_get_bool(const char *in_key, int *boolval)
+API int vconf_get_bool(const char *in_key, int *boolval)
{
LOG_D(stdout, "[%s][%d] start! key [%s] \n", __func__, __LINE__, in_key);
return VCONF_OK;
}
-EXPORT int vconf_get_dbl(const char *in_key, double *dblval)
+API int vconf_get_dbl(const char *in_key, double *dblval)
{
LOG_D(stdout, "[%s][%d] start!\n", __func__, __LINE__);
return VCONF_OK;
}
-EXPORT int vconf_unset(const char *in_key)
+API int vconf_unset(const char *in_key)
{
return 0;
}
-EXPORT int vconf_sync_key(const char *in_key)
+API int vconf_sync_key(const char *in_key)
{
return 0;
}
-EXPORT int vconf_unset_recursive(const char *in_dir)
+API int vconf_unset_recursive(const char *in_dir)
{
return 0;
}
-EXPORT int vconf_notify_key_changed(const char *in_key, vconf_callback_fn cb,
+API int vconf_notify_key_changed(const char *in_key, vconf_callback_fn cb,
void *user_data)
{
string str;
return VCONF_OK;
}
-EXPORT int vconf_ignore_key_changed(const char *in_key, vconf_callback_fn cb)
+API int vconf_ignore_key_changed(const char *in_key, vconf_callback_fn cb)
{
string str;
str = in_key;
return VCONF_OK;
}
-EXPORT int vconf_get_ext_errno(void)
+API int vconf_get_ext_errno(void)
{
return 0;
}
+++ /dev/null
-#!/bin/bash
-pushd ../
-RootDir=$PWD
-popd
-
-createVconfDb() {
- pushd scripts
- ./convert_vconf_script_to_sql.sh
-
- if [ ! -f vconf.db ]
- then
- echo "vconf.db create failed!"
- exit -1
- fi
-
- cp vconf.db ../
- popd
-}
-
-
-if [ ! -f vconf.db ]
-then
- createVconfDb
-fi
-
-#========================================================================================
-# /etc/config/model-config.xml <= tm1
-system_info_init_db -k "tizen.org/feature/profile" -t string -g platform -v "mobile"
-system_info_init_db -k "tizen.org/feature/systemsetting.incoming_call" -t bool -g platform -v true
-system_info_init_db -k "tizen.org/feature/systemsetting.home_screen" -t bool -g platform -v true
-system_info_init_db -k "tizen.org/feature/systemsetting.lock_screen" -t bool -g platform -v true
-system_info_init_db -k "tizen.org/feature/systemsetting.notification_email" -t bool -g platform -v true
-system_info_init_db -k "tizen.org/feature/network.wifi" -t bool -g platform -v true
-system_info_init_db -k "tizen.org/feature/systemsetting.font" -t bool -g platform -v true
-system_info_init_db -k "tizen.org/feature/network.telephony" -t bool -g platform -v true
-system_info_init_db -k "tizen.org/feature/accessibility.grayscale" -t bool -g platform -v false
-system_info_init_db -k "tizen.org/feature/accessibility.negative" -t bool -g platform -v false
-system_info_init_db -k "tizen.org/feature/input.rotating_bezel" -t bool -g platform -v false
-#========================================================================================
-
-#========================================================================================
-# Causion : Need to root permission
-#========================================================================================
-cp -f ../utils/libsystem-settings-util.so* /usr/lib
-
-echo "link [/opt/etc/localtime]"
-ln -sf /etc/localtime /opt/etc/localtime
-
-if [ -f /usr/lib/libefl-extension.so.0 ]
-then
- cp -f /usr/lib/libefl-extension.so.0 /usr/lib/libefl-extension.so.0.back
-fi
-cp -f ./libefl-extension.so.0 /usr/lib/libefl-extension.so.0
-
-#========================================================================================
-# Dummy MP3 File List
-#========================================================================================
-mkdir -p "/opt/usr/data/settings/Ringtones"
-touch "/opt/usr/data/settings/Ringtones/ringtone_sdk.mp3"
-
-mkdir -p "/opt/usr/data/settings/Alerts"
-touch "/opt/usr/data/settings/Alerts/Over the horizon.mp3"
-
-mkdir -p "/opt/usr/share/"
-touch "/opt/usr/share/ringtone_sdk.mp3"
-
-mkdir -p "/opt/usr/test"
-touch "/opt/usr/test/big_buck_bunny.mp4"
-touch "/opt/usr/test/daliTestVideo.mp4"
-touch "/opt/usr/test/sound_5.wav"
-touch "/opt/usr/test/tct-content-tizen-tests_video.mp4"
-#========================================================================================
-
-unitTestFile=sys-settings-test
-if [ ! -x "${unitTestFile}" ]
-then
- echo "${unitTestFile} file does not exist!"
- exit -1
-fi
-
-LD_PRELOAD=./libvconf-mock.so:./libpkgmgr-info-mock.so ./${unitTestFile}
-
-#========================================================================================
-# Causion : Need to root permission
-#========================================================================================
-if [ -f /usr/lib/libefl-extension.so.0.back ]
-then
- cp -f /usr/lib/libefl-extension.so.0.back /usr/lib/libefl-extension.so.0
-fi
-#========================================================================================
-
-CMakeDir=${RootDir}/CMakeFiles/capi-system-system-settings.dir/src
-CoverageDir=${RootDir}/coverage
-
-pushd $CMakeDir
- for obj in `ls *.o`
- do
- gcov -b -c $obj
- done
-
- if [ -f /usr/bin/lcov ]
- then
- lcov -c -d . -o cov.info
- genhtml cov.info -o ${CoverageDir}
- echo "Coverage test result created! [${CoverageDir}]"
- else
- echo "lcov does not exist!"
- fi
-popd
-
#!/bin/bash
-
+MY_DIR="$( cd "$(dirname $(readlink -f "$0"))" ; pwd -P )"
db_name=vconf.db
tableName=vconf
-vconf_internal_keys_script=./vconf_all.sh
-vconf_internal_keys_script_copy=./vconf_all_copy.sh
+vconf_internal_keys_script=$MY_DIR/vconf_all.sh
+vconf_internal_keys_script_copy=$MY_DIR/vconf_all_copy.sh
dbScriptFile=vconf.sql
create_table(){
sed -i 's/\${TZ_SYS_GLOBALUSER_DATA}/\/opt\/usr\/data/g' ${vconf_internal_keys_script_copy}
- cat vconf_all_copy.sh | grep buxton2ctl | awk -v tableName=$tableName -F'\"' '{ printf "INSERT INTO %s ( layer, key, value, type, read_privilege, write_privilege ) values ( \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\" );\n", tableName, $4, $6, $8, $2, $10, $12 }' > ${dbScriptFile}
+ cat ${vconf_internal_keys_script_copy} | grep buxton2ctl | awk -v tableName=$tableName -F'\"' '{ printf "INSERT INTO %s ( layer, key, value, type, read_privilege, write_privilege ) values ( \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\" );\n", tableName, $4, $6, $8, $2, $10, $12 }' > ${dbScriptFile}
echo "COMMIT TRANSACTION;"
--- /dev/null
+#!/bin/bash
+CURRENT_DIR=$(pwd -P)
+MY_DIR="$( cd "$(dirname $(readlink -f "$0"))" ; pwd -P )"
+
+createVconfDb() {
+ $MY_DIR/convert_vconf_script_to_sql.sh
+
+ if [ ! -f vconf.db ]
+ then
+ echo "vconf.db create failed!"
+ exit -1
+ fi
+}
+
+if [ ! -f vconf.db ]
+then
+ createVconfDb
+fi
#include <tzplatform_config.h>
#include "system_settings.h"
+#include "sst.h"
#include "sys_settings.h"
#include "sys_settings_util.h"
#include "sys_settings_font.h"
#define SETTING_FONT_TIZEN_FONT_ALIAS "Tizen"
#define SETTING_FONT_TIZEN_DEFAULT_FONT_ALIAS "TizenDefaultFont"
-#define SETTING_FONT_CONFIG_SO_PATH "/usr/lib/libfontconfig.so.1"
-#define SETTING_ECORE_EVAS_SO_PATH "/usr/lib/libecore_evas.so.1"
-#define SETTING_EFL_EXTENSION_SO_PATH "/usr/lib/libefl-extension.so.0"
-#define SETTING_EVAS_SO_PATH "/usr/lib/libevas.so.1"
+#define SETTING_FONT_CONFIG_SO_PATH "libfontconfig.so.1"
+#define SETTING_ECORE_EVAS_SO_PATH "libecore_evas.so.1"
+#define SETTING_EFL_EXTENSION_SO_PATH "libefl-extension.so.0"
+#define SETTING_EVAS_SO_PATH "libevas.so.1"
static int __font_size_get();
}
/* LCOV_EXCL_START */
-bool __is_supported_image_type_load(char *path)
+API bool __is_supported_image_type_load(char *path)
{
SETTING_TRACE_BEGIN;
e_libs efl_libs;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
-void font_config_set_notification()
+API void font_config_set_notification()
{
SETTING_TRACE_BEGIN;
}
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
-int __is_available_font(char *font_name)
+API int __is_available_font(char *font_name)
{
SETTING_TRACE_BEGIN;
FcObjectSet *os = NULL;
/* LCOV_EXCL_STOP */
-char *_get_default_font()
+API char *_get_default_font()
{
return __get_main_font_family_name_by_alias(SETTING_FONT_TIZEN_DEFAULT_FONT_ALIAS);
}
/* LCOV_EXCL_START */
-bool font_config_set(char *font_name)
+API bool font_config_set(char *font_name)
{
SETTING_TRACE_BEGIN;
ex_libs eext_libs;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
-void __font_size_set()
+API void __font_size_set()
{
SETTING_TRACE_BEGIN;
ex_libs eext_libs;
bool font_config_set(char *font_name);
int __is_available_font(char *font_name);
char *_get_default_font();
-char *_get_cur_font();
bool __is_supported_image_type_load(char *path);
void __font_size_set();
void font_config_set_notification();