ADD_DEFINITIONS("-DSETTING_DEF_RES=\"${SETTING_DEF_RES}\"")
IF(TIZEN_WEARABLE)
- ADD_DEFINITIONS(-DTIZEN_WEARABLE)
+ ADD_DEFINITIONS(-DTIZEN_WEARABLE)
ENDIF(TIZEN_WEARABLE)
IF(TIZEN_MOBILE)
- ADD_DEFINITIONS(-DTIZEN_MOBILE)
+ ADD_DEFINITIONS(-DTIZEN_MOBILE)
ENDIF(TIZEN_MOBILE)
+IF(STDOUT_LOG)
+ ADD_DEFINITIONS("-DSST_STDOUT")
+ENDIF(STDOUT_LOG)
+
FILE(GLOB SRCS src/*.c)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LIBRARIES})
*/
#pragma once
-//#include "sst_log.h"
-
-#ifdef API
-#undef API
-#endif
-#define API __attribute__((visibility("default")))
-
+#include "sst_log.h"
+#include "sst_define.h"
--- /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
+
+#ifdef API
+#undef API
+#endif
+#define API __attribute__((visibility("default")))
+
+#ifndef SETTING_DEF_RES
+#define SETTING_DEF_RES "/opt/usr/data/settings"
+#warning "SETTING_DEF_RES is redefined"
+#endif
+#define DEF_RINGTONE_FILE_PATH SETTING_DEF_RES"/Ringtones"
+
+#define USR_RINGTONE_FILE_PATH "/home/owner/content/Sounds/Ringtones"
+#define SST_RINGTONE_JSONFILE "/opt/home/owner/apps_rw/org.tizen.setting/data/.user-ringtones.json"
+
+#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 SETTING_TIME_ZONEINFO_PATH "/usr/share/zoneinfo/"
+#define SETTING_TIME_SHARE_LOCAL_PATH "/usr/share/locale"
+#define SETTING_TZONE_SYMLINK_PATH "/opt/etc/localtime"
\ No newline at end of file
#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(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__)
+#define SST_SECURE_TRACE(fmt, arg...) __SECU_DBG(SST_LOG_GREEN fmt SST_LOG_END, ##arg)
#else /* SST_DEBUGGING */
#define DBG(fmt, arg...)
* @{
*/
-
/**
* @brief Enumeration for system settings error.
* @since_tizen 2.3
SYSTEM_SETTINGS_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
SYSTEM_SETTINGS_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- SYSTEM_SETTINGS_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< Internal I/O error */
- SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
- SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported @if MOBILE (Since 2.3.1) @endif */
+ SYSTEM_SETTINGS_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< Internal I/O error */
+ SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+ SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported @if MOBILE (Since 2.3.1) @endif */
SYSTEM_SETTINGS_ERROR_CALL_UNSUPPORTED_API = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported @if MOBILE (Since 2.3.1) @endif */
/* lock screen app error code */
SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE = TIZEN_ERROR_SYSTEM_SETTING | 0x01, /**< Current lock screen app set 'password' type */
} system_settings_error_e;
-
/**
* @brief Enumeration for System Settings Key.
* @since_tizen 2.3
SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, /**< (string) The file path of the current email alert ringtone */
SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED, /**< (bool) Indicates whether the USB debugging is enabled (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED, /**< (bool) Indicates whether the 3G data network is enabled (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
- SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP = SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED+2, /**< (string) Indicates lockscreen app pkg name */
+ SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP = SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED + 2, /**< (string) Indicates lockscreen app pkg name */
SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE,/**< (string) The current system default font type (only support Get) */
SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, /**< (string) Indicates the current country setting in the <LANGUAGE>_<REGION> syntax. The country setting is in the ISO 639-2 format, and the region setting is in the ISO 3166-1 alpha-2 format */
SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, /**< (string) Indicates the current language setting in the <LANGUAGE>_<REGION> syntax. The language setting is in the ISO 639-2 format and the region setting is in the ISO 3166-1 alpha-2 format. */
SYSTEM_SETTINGS_LOCK_STATE_LAUNCHING_LOCK /**< Device is being locked */
} system_settings_idle_lock_state_e;
-
/**
* @brief Enumeration for font size.
* @since_tizen 2.3
SYSTEM_SETTINGS_UDS_ON_WHITELISTED, /**< UDS on and the app is whitelisted */
} system_settings_uds_state_e;
-
-
/**
* @brief Called when the system settings changes.
* @since_tizen 2.3
*/
int system_settings_get_value_int(system_settings_key_e key, int *value);
-
/**
* @platform
* @brief Sets the system settings value associated with the given key as a boolean.
*/
int system_settings_unset_changed_cb(system_settings_key_e key);
-
/**
* @platform
* @brief Called to get each string value from string typed list.
* @param[in] cb_data The user data passed from the foreach function
* @return @c true to continue with the next iteration of the loop, otherwise false to break out of the loop
*/
-typedef bool (*system_settings_iter_cb)(int index, const char* value, void *cb_data);
+typedef bool (*system_settings_iter_cb)(int index, const char *value, void *cb_data);
/**
* @platform
*/
int system_settings_delete_value_string(system_settings_key_e key, const char *value);
-
/**
* @brief Adds a change event callback for the given system settings key.
* @details The difference between this function and system_settings_set_changed_cb() is that system_settings_set_changed_cb() can set only one callback for a given key, while system_settings_add_changed_cb() can set multiple callbacks for a given key.
* @}
*/
-
#ifdef __cplusplus
}
#endif
export FFLAGS="$FFLAGS -DTIZEN_MOBILE"
%endif
-%if 0%{?sec_build_binary_debug_enable}
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
-export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-%endif
-
-%if 0%{?tizen_build_binary_release_type_eng}
-export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
-export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
-export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
-%endif
-
%if 0%{?gcov:1}
export CFLAGS+=" -fprofile-arcs -ftest-coverage"
export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
-DTZ_SYS_SHARE=%{TZ_SYS_SHARE} \
-DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
-DTEST_INSTALL_DIR:PATH=%{sys_setting_test_dir} \
+ -DSETTING_DEF_RES=%{TZ_SYS_GLOBALUSER_DATA}/settings \
+ -DSTDOUT_LOG=%{?stdlog:1}%{!?stdlog:0} \
%if 0%{?thread_number}
- -DN_THREADS=%{thread_number} \
+ -DN_THREADS=%{thread_number}
%else
- -DN_THREADS=1 \
+ -DN_THREADS=1
%endif
- -DSETTING_DEF_RES=%{TZ_SYS_GLOBALUSER_DATA}/settings
+
make %{?_smp_mflags}
%install
#include <stdio.h>
#include <stdlib.h>
#include <vconf.h>
-#include <dlog.h>
#include "sst.h"
#include "system_settings.h"
#include <glib.h>
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "TIZEN_N_SYSTEM_SETTINGS"
-
#define SYSTEM_SETTINGS_MAX -1
#define GET_SLOT(x) ((x)%4)
system_setting_s system_setting_table[] = {
-
{
SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE,
VCONFKEY_SETAPPL_CALL_RINGTONE_PATH_STR,
int max = sizeof(system_setting_table) / sizeof(system_setting_s) - 1;
for (i = 0; i < max; i++) {
- LOGE("[%s] system_setting_table[i].key = %d", __FUNCTION__, system_setting_table[i].key);
- LOGE("[%s] system_setting_table[i].data_type = %d", __FUNCTION__, system_setting_table[i].data_type);
- LOGE("[%s] system_setting_table[i].get_value_cb = %x", __FUNCTION__, system_setting_table[i].get_value_cb);
- LOGE("[%s] system_setting_table[i].set_value_cb = %x", __FUNCTION__, system_setting_table[i].set_value_cb);
-
- LOGE("[%s] system_setting_table[i].set_changed_cb = %x <---", __FUNCTION__, system_setting_table[i].set_changed_cb);
- LOGE("[%s] system_setting_table[i].unset_changed_cb = %x", __FUNCTION__, system_setting_table[i].unset_changed_cb);
- LOGE("[%s] system_setting_table[i].changed_cb = %x", __FUNCTION__, system_setting_table[i].changed_cb);
+ ERR("[%s] system_setting_table[i].key = %d", __FUNCTION__, system_setting_table[i].key);
+ ERR("[%s] system_setting_table[i].data_type = %d", __FUNCTION__, system_setting_table[i].data_type);
+ ERR("[%s] system_setting_table[i].get_value_cb = %x", __FUNCTION__, system_setting_table[i].get_value_cb);
+ ERR("[%s] system_setting_table[i].set_value_cb = %x", __FUNCTION__, system_setting_table[i].set_value_cb);
+
+ ERR("[%s] system_setting_table[i].set_changed_cb = %x <---", __FUNCTION__, system_setting_table[i].set_changed_cb);
+ ERR("[%s] system_setting_table[i].unset_changed_cb = %x", __FUNCTION__, system_setting_table[i].unset_changed_cb);
+ ERR("[%s] system_setting_table[i].changed_cb = %x", __FUNCTION__, system_setting_table[i].changed_cb);
}
}
#endif
-/* LCOV_EXCL_START */
static int _dump_context_node(int key)
{
int index = 0;
while (system_setting_table[index].key != SYSTEM_SETTINGS_MAX) {
if (system_setting_table[index].key == key) {
int i = index;
- LOGE("[%s] system_setting_table[i].key = %d", __FUNCTION__, system_setting_table[i].key);
- LOGE("[%s] system_setting_table[i].data_type = %d", __FUNCTION__, system_setting_table[i].data_type);
- LOGE("[%s] system_setting_table[i].get_value_cb = %p", __FUNCTION__, system_setting_table[i].get_value_cb);
- LOGE("[%s] system_setting_table[i].set_value_cb = %p", __FUNCTION__, system_setting_table[i].set_value_cb);
- LOGE("[%s] system_setting_table[i].set_changed_cb = %p <---", __FUNCTION__, system_setting_table[i].set_changed_cb);
- LOGE("[%s] system_setting_table[i].unset_changed_cb = %p", __FUNCTION__, system_setting_table[i].unset_changed_cb);
- LOGE("[%s] system_setting_table[i].changed_cb = %p", __FUNCTION__, system_setting_table[i].changed_cb);
+ ERR("[%s] system_setting_table[i].key = %d", __FUNCTION__, system_setting_table[i].key);
+ ERR("[%s] system_setting_table[i].data_type = %d", __FUNCTION__, system_setting_table[i].data_type);
+ ERR("[%s] system_setting_table[i].get_value_cb = %p", __FUNCTION__, system_setting_table[i].get_value_cb);
+ ERR("[%s] system_setting_table[i].set_value_cb = %p", __FUNCTION__, system_setting_table[i].set_value_cb);
+ ERR("[%s] system_setting_table[i].set_changed_cb = %p <---", __FUNCTION__, system_setting_table[i].set_changed_cb);
+ ERR("[%s] system_setting_table[i].unset_changed_cb = %p", __FUNCTION__, system_setting_table[i].unset_changed_cb);
+ ERR("[%s] system_setting_table[i].changed_cb = %p", __FUNCTION__, system_setting_table[i].changed_cb);
return 0;
}
index++;
return -1;
}
-/* LCOV_EXCL_STOP */
#if 0
int system_settings_get_item(system_settings_key_e key, system_setting_h *item)
{
- LOGE("Enter [%s], key=%d", __FUNCTION__, key);
+ ERR("Enter [%s], key=%d", __FUNCTION__, key);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key)) {
- LOGE("Enter [%s] catch invalid parameter error (%d) ", __FUNCTION__, key);
+ ERR("Enter [%s] catch invalid parameter error (%d) ", __FUNCTION__, key);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
#if DEBUG_DUMP_CONTEXT
while (system_setting_table[index].key != SYSTEM_SETTINGS_MAX) {
if (system_setting_table[index].key == key) {
*item = &system_setting_table[index];
- LOGE("Enter [%s], index = %d, key = %d, type = %d", __FUNCTION__, index, key, (*item)->data_type);
+ ERR("Enter [%s], index = %d, key = %d, type = %d", __FUNCTION__, index, key, (*item)->data_type);
if (system_setting_table[index].feature_check_cb != NULL) {
int ret = system_setting_table[index].feature_check_cb(item);
if (ret == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED)
- LOGE("Not supported API, because there is no feature!");
+ ERR("Not supported API, because there is no feature!");
return ret;
} else {
}
#else
-/* LCOV_EXCL_START */
int binary_search_for_item(system_settings_key_e key)
{
int start = 0;
end = mid - 1;
}
- LOGE("Enter [%s], key=%d, Can NOT find the key", __FUNCTION__, key);
+ ERR("Enter [%s], key=%d, Can NOT find the key", __FUNCTION__, key);
return -1;
}
-/* LCOV_EXCL_STOP */
-
-/* LCOV_EXCL_START */
int system_settings_get_item(system_settings_key_e key, system_setting_h *item)
{
- LOGE("Enter [%s], key=%d", __FUNCTION__, key);
+ ERR("Enter [%s], key=%d", __FUNCTION__, key);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key)) {
- LOGE("Enter [%s] catch invalid parameter error (%d) ", __FUNCTION__, key);
+ ERR("Enter [%s] catch invalid parameter error (%d) ", __FUNCTION__, key);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
#if DEBUG_DUMP_CONTEXT
return TIZEN_ERROR_INVALID_PARAMETER;
*item = &system_setting_table[idx];
- LOGE("Enter [%s], key = %d, type = %d", __FUNCTION__, key, (*item)->data_type);
+ ERR("Enter [%s], key = %d, type = %d", __FUNCTION__, key, (*item)->data_type);
if (system_setting_table[idx].feature_check_cb != NULL) {
int ret = system_setting_table[idx].feature_check_cb(item);
if (ret == SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED)
- LOGE("Not supported API, because there is no feature!");
+ ERR("Not supported API, because there is no feature!");
return ret;
}
return SYSTEM_SETTINGS_ERROR_NONE;
-
}
#endif
-/* LCOV_EXCL_STOP */
int system_setting_get_vconf(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
char *vconf_char;
int vconf_int;
int **val = (int**)value;
case SYSTEM_SETTING_DATA_TYPE_BOOL:
if (system_setting_vconf_get_value_bool(item->vconf_key, &vconf_bool))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
- *value = (void *)vconf_bool;
+ *value = (void*)vconf_bool;
break;
default:
- LOGE("Error system_setting_h struct data_type");
+ ERR("Error system_setting_h struct data_type");
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
return SYSTEM_SETTINGS_ERROR_NONE;
}
-
-/* LCOV_EXCL_START */
int system_setting_set_vconf(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
char *vconf_char;
int vconf_int;
bool vconf_bool;
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
break;
default:
- LOGE("Error system_setting_h struct data_type");
+ ERR("Error system_setting_h struct data_type");
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
API int system_settings_get_value(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER) {
_dump_context_node(key);
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
}
return ret;
}
if (system_setting_item->data_type != data_type) {
_dump_context_node(key);
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid data type --- key:(%d), datatype:(%d)", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER, key, data_type);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid data type --- key:(%d), datatype:(%d)", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER, key, data_type);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
system_setting_getter = system_setting_item->get_value_cb;
if (system_setting_getter == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to call getter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_IO_ERROR);
+ ERR("[%s] IO_ERROR(0x%08x) : failed to call getter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_IO_ERROR);
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
return system_setting_getter(system_setting_item, value);
}
-/* LCOV_EXCL_START */
API int system_settings_set_value(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key) || value == NULL)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return ret;
}
/* type check */
if (system_setting_item->data_type != data_type) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid data type", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid data type", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
system_setting_setter = system_setting_item->set_value_cb;
if (system_setting_setter == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to call setter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
+ ERR("[%s] IO_ERROR(0x%08x) : failed to call setter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
}
return system_setting_setter(system_setting_item, value);
}
-/* LCOV_EXCL_STOP */
-
-
-/* LCOV_EXCL_START */
int system_settings_add_value(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key) || value == NULL)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return ret;
}
/* type check */
if (system_setting_item->data_type != data_type) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid data type", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid data type", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
system_setting_adder = system_setting_item->add_value_cb;
if (system_setting_adder == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to call setter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
+ ERR("[%s] IO_ERROR(0x%08x) : failed to call setter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
}
return system_setting_adder(key, value);
}
-/* LCOV_EXCL_STOP */
-
-/* LCOV_EXCL_START */
API int system_settings_del_value(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key) || value == NULL)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
int ret = system_settings_get_item(key, &system_setting_item);
if (0 != ret) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
}
/* type check */
if (system_setting_item->data_type != data_type) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid data type", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid data type", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
system_setting_deler = system_setting_item->del_value_cb;
if (system_setting_deler == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to call setter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
+ ERR("[%s] IO_ERROR(0x%08x) : failed to call setter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
}
return system_setting_deler(key, value);
}
-/* LCOV_EXCL_STOP */
-
-/* LCOV_EXCL_START */
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__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return ret;
}
/* type check */
if (system_setting_item->data_type != data_type) {
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid data type", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid data type", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
system_setting_lister = system_setting_item->list_value_cb;
if (system_setting_lister == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to call setter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
+ ERR("[%s] IO_ERROR(0x%08x) : failed to call setter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED);
return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
}
return system_setting_lister(key, system_setting_data_iterator, user_data);
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
API int system_settings_set_value_int(system_settings_key_e key, int value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
int *ptr = &value;
int **p_ptr = &ptr;
- return system_settings_set_value(key, SYSTEM_SETTING_DATA_TYPE_INT, (void *)p_ptr);
+ return system_settings_set_value(key, SYSTEM_SETTING_DATA_TYPE_INT, (void*)p_ptr);
}
-/* LCOV_EXCL_STOP */
API int system_settings_get_value_int(system_settings_key_e key, int *value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
return ret;
}
-/* LCOV_EXCL_START */
API int system_settings_set_value_bool(system_settings_key_e key, bool value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
bool *ptr = &value;
- return system_settings_set_value(key, SYSTEM_SETTING_DATA_TYPE_BOOL, (void *)ptr);
+ return system_settings_set_value(key, SYSTEM_SETTING_DATA_TYPE_BOOL, (void*)ptr);
}
-/* LCOV_EXCL_STOP */
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 *************** ");
+ ERR("Enter [%s]", __FUNCTION__);
+ SST_SECURE_TRACE(" SIGNED LONG here ******************* log here *************** ");
signed long flag = 0;
int ret;
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
ret = system_settings_get_value(key, SYSTEM_SETTING_DATA_TYPE_BOOL, (void **)&flag);
- SETTING_TRACE(" inf (flag) value : %ld ", flag);
+ SST_SECURE_TRACE(" inf (flag) value : %ld ", flag);
if (flag == 0) {
*value = false;
- SETTING_TRACE(" flag == 0 ");
+ SST_SECURE_TRACE(" flag == 0 ");
} else if (flag == 1) {
*value = true;
- SETTING_TRACE(" flag == 1 ");
+ SST_SECURE_TRACE(" flag == 1 ");
} else {
*value = false;
- SETTING_TRACE(" exception here!!! ");
+ SST_SECURE_TRACE(" exception here!!! ");
}
return ret;
}
-/* LCOV_EXCL_START */
API int system_settings_set_value_string(system_settings_key_e key, const char *value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
if (key == SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
- return system_settings_set_value(key, SYSTEM_SETTING_DATA_TYPE_STRING, (void *)value);
+ return system_settings_set_value(key, SYSTEM_SETTING_DATA_TYPE_STRING, (void*)value);
}
-/* LCOV_EXCL_STOP */
API int system_settings_get_value_string(system_settings_key_e key, char **value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
int system_setting_set_changed_vconf_genernal_callback(system_setting_h item, void *user_data)
{
- SETTING_TRACE_BEGIN;
return system_setting_vconf_set_changed_cb(item->vconf_key, item->key, GET_SLOT(item->key), user_data);
}
int system_setting_unset_changed_vconf_genernal_callback(system_setting_h item)
{
- SETTING_TRACE_BEGIN;
return system_setting_vconf_unset_changed_cb(item->vconf_key, GET_SLOT(item->key));
}
API int system_settings_set_changed_cb(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
system_setting_h system_setting_item;
system_setting_set_changed_callback_cb system_setting_set_changed_cb;
int ret = system_settings_get_item(key, &system_setting_item);
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return ret;
}
system_setting_set_changed_cb = system_setting_item->set_changed_cb;
-
/* Store the callback function from application side */
if (callback)
system_setting_item->changed_cb = callback;
system_setting_item->user_data = user_data;
if (system_setting_set_changed_cb == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to call getter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_IO_ERROR);
+ ERR("[%s] IO_ERROR(0x%08x) : failed to call getter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_IO_ERROR);
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
return system_setting_set_changed_cb(system_setting_item, user_data);
}
-
API int system_settings_unset_changed_cb(system_settings_key_e key)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
system_setting_h system_setting_item;
system_setting_unset_changed_callback_cb system_setting_unset_changed_cb;
int ret = system_settings_get_item(key, &system_setting_item);
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return ret;
}
/*----------------------------------------------------- */
if (system_setting_unset_changed_cb == NULL) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to call getter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_IO_ERROR);
+ ERR("[%s] IO_ERROR(0x%08x) : failed to call getter for the system settings", __FUNCTION__, SYSTEM_SETTINGS_ERROR_IO_ERROR);
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
API int system_settings_add_changed_cb(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
system_setting_h system_setting_item;
if (callback == NULL)
int ret = system_settings_get_item(key, &system_setting_item);
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return ret;
}
if (system_setting_item->vconf_key == NULL)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
- LOGE("[%s] key = %d %s", __FUNCTION__, key, system_setting_item->vconf_key);
+ ERR("[%s] key = %d %s", __FUNCTION__, key, system_setting_item->vconf_key);
/* Store the callback function from application side */
ret = add_multi_callback(&system_setting_item->changed_cb_list, callback, user_data);
if (ret != SYSTEM_SETTINGS_ERROR_NONE) {
- LOGE("[%s] IO_ERROR(0x%08x) : failed to add muti-callback for the system settings", __FUNCTION__, ret);
+ ERR("[%s] IO_ERROR(0x%08x) : failed to add muti-callback for the system settings", __FUNCTION__, ret);
return ret;
}
int ret = system_setting_vconf_set_changed_multi_cb(system_setting_item->vconf_key, key);
if (ret == SYSTEM_SETTINGS_ERROR_NONE)
system_setting_item->changed_cb_list.is_registered = 1;
- LOGE("Leave [%s]", __FUNCTION__);
+ ERR("Leave [%s]", __FUNCTION__);
return ret;
}
- LOGE("Leave [%s]", __FUNCTION__);
+ ERR("Leave [%s]", __FUNCTION__);
return SYSTEM_SETTINGS_ERROR_NONE;
}
API int system_settings_remove_changed_cb(system_settings_key_e key, system_settings_changed_cb callback)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
system_setting_h system_setting_item;
if (callback == NULL)
int ret = system_settings_get_item(key, &system_setting_item);
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
return ret;
}
ret = system_setting_vconf_unset_changed_multi_cb(system_setting_item->vconf_key, key);
if (ret == SYSTEM_SETTINGS_ERROR_NONE)
system_setting_item->changed_cb_list.is_registered = 0;
- LOGE("Leave [%s]", __FUNCTION__);
+ ERR("Leave [%s]", __FUNCTION__);
return ret;
}
- LOGE("Leave [%s]", __FUNCTION__);
+ ERR("Leave [%s]", __FUNCTION__);
return SYSTEM_SETTINGS_ERROR_NONE;
}
API int system_settings_foreach_value_string(system_settings_key_e key, system_settings_iter_cb callback, void *value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
- return system_settings_list_value(key, SYSTEM_SETTING_DATA_TYPE_STRING, callback, (void *)value);
+ return system_settings_list_value(key, SYSTEM_SETTING_DATA_TYPE_STRING, callback, (void*)value);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
API int system_settings_add_value_string(system_settings_key_e key, const char* value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
- return system_settings_add_value(key, SYSTEM_SETTING_DATA_TYPE_STRING, (void *)value);
+ return system_settings_add_value(key, SYSTEM_SETTING_DATA_TYPE_STRING, (void*)value);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
API int system_settings_delete_value_string(system_settings_key_e key, const char* value)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
if (!(key >= 0 && SYSTEM_SETTINGS_KEY_MAX > key))
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
- return system_settings_del_value(key, SYSTEM_SETTING_DATA_TYPE_STRING, (void *)value);
+ return system_settings_del_value(key, SYSTEM_SETTING_DATA_TYPE_STRING, (void*)value);
}
-
{
#endif
-#include <dlog.h>
+#include "sst.h"
#include "system_settings.h"
#include "sys_settings_multi_callback.h"
#define VCONFKEY_SETAPPL_ACCESSIBILITY_GREYSCALE "db/setting/accessibility/greyscale"
#endif
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "SYSTEM-SETTINGS"
-
-/* #define DEBUG_DUMP_CONTEXT */
-#define SYSTEM_SETTINGS_ENABLE_TRACE
-
-#ifdef SYSTEM_SETTINGS_ENABLE_TRACE
-
-
-#define SETTING_TRACE_DEBUG(fmt, arg...) \
- do {\
- SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
- } while (0);
-
-#define SETTING_TRACE(fmt, arg...) \
- do {\
- SECURE_LOGI("\033[0;36m" fmt "\033[0m\n", ##arg);\
- } while (0);
-
-#define SETTING_TRACE_BEGIN do {\
- SECURE_LOGD("\033[0;35mENTER FUNCTION: %s. \033[0m\n", __FUNCTION__);\
- } while (0);
-
-#define SETTING_TRACE_END do {\
- SECURE_LOGD("\033[0;35mEXIT FUNCTION: %s. \033[0m\n", __FUNCTION__);\
- } while (0);
-#else
-#define SETTING_TRACE_DEBUG(fmt, arg...)
-#define SETTING_TRACE(fmt, arg...)
-#define SETTING_TRACE_BEGIN
-#define SETTING_TRACE_END
-#endif
-
-
#define SETTING_PROFILE_PATH "tizen.org/feature/profile"
#define SETTING_INCOMING_CALL_PATH "tizen.org/feature/systemsetting.incoming_call"
#define SETTING_HOME_SCREEN_PATH "tizen.org/feature/systemsetting.home_screen"
*/
typedef int (*system_setting_unset_changed_callback_cb)(system_setting_h item);
-
/**
* @internal
* @since_tizen 2.3
*/
typedef struct _system_setting_s {
system_settings_key_e key; /**< key */
- const char * const vconf_key; /**< vconf key */
+ const char* const vconf_key; /**< vconf key */
system_setting_data_type_e data_type; /**< data type */
system_setting_get_value_cb get_value_cb; /**< function pointer for getter */
system_setting_set_value_cb set_value_cb; /**< function pointer for setter */
callback_list changed_cb_list;
void *user_data; /* user_data */
-
} system_setting_s;
-
-
/**
* @internal
* @since_tizen 2.3
*/
int system_settings_get_item(system_settings_key_e key, system_setting_h *item);
-
/* get */
/**
*/
int system_settings_vconf_get_key_string(system_settings_key_e key, char **key_string);
-
/**
* @internal
* @brief Unset the system settings notification callback
*/
int system_setting_set_incoming_call_ringtone(system_setting_h item, void *value);
-
/**
* @todo add comment here
*/
int system_setting_add_incoming_call_ringtone(system_settings_key_e key, void *value);
-
/**
* @todo add comment here
*/
int system_setting_del_incoming_call_ringtone(system_settings_key_e key, void *value);
-
/**
* @todo add comment here
*/
* @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
* @retval #SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED Not support system-settings API
*/
-int system_setting_feature_check_incoming_call(void * value);
+int system_setting_feature_check_incoming_call(void *value);
/**
* @internal
* @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
* @retval #SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED Not support system-settings API
*/
-int system_setting_feature_check_home_screen(void * value);
+int system_setting_feature_check_home_screen(void *value);
/**
* @internal
* @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
* @retval #SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED Not support system-settings API
*/
-int system_setting_feature_check_lock_screen(void * value);
+int system_setting_feature_check_lock_screen(void *value);
/**
* @internal
* @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
* @retval #SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED Not support system-settings API
*/
-int system_setting_feature_check_notification_email(void * value);
+int system_setting_feature_check_notification_email(void *value);
/**
* @internal
* @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
* @retval #SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED Not support system-settings API
*/
-int system_setting_feature_check_wifi(void * value);
+int system_setting_feature_check_wifi(void *value);
/**
* @internal
#endif
#endif /* __TIZEN_SYSTEM_SETTING_PRIVATE_H__ */
-
-
-
GError *error = NULL;
gboolean ret = json_generator_to_file(generator, filename, &error);
#else
- gchar* result = json_generator_to_data(generator, NULL);
+ gchar *result = json_generator_to_data(generator, NULL);
vconf_set_str(VCONFKEY_SETAPPL_CALL_RINGTONE_USER_LIST, (char*)result);
#endif
g_object_unref(generator);
}
/* LCOV_EXCL_STOP */
-
/* LCOV_EXCL_START */
-JsonParser* ss_json_ringtone_open_file(char* path)
+JsonParser* ss_json_ringtone_open_file(char *path)
{
JsonParser *parser;
//JsonNode *root;
error = NULL;
json_parser_load_from_file(parser, path, &error);
if (error) {
- SETTING_TRACE("Unable to parse `%s': %s\n", path, error->message);
+ SST_SECURE_TRACE("Unable to parse `%s': %s\n", path, error->message);
g_error_free(error);
g_object_unref(parser);
return NULL;
parser = json_parser_new();
error = NULL;
- char* load_data = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_USER_LIST);
+ char *load_data = vconf_get_str(VCONFKEY_SETAPPL_CALL_RINGTONE_USER_LIST);
json_parser_load_from_data(parser, load_data, -1, &error);
if (error) {
- SETTING_TRACE("Unable to load data : %s \n", error->message);
+ SST_SECURE_TRACE("Unable to load data : %s \n", error->message);
g_error_free(error);
g_object_unref(parser);
return NULL;
return parser;
}
-void ss_json_ringtone_add(JsonNode *root, char* filename, char* nameval, char* pathval)
+void ss_json_ringtone_add(JsonNode *root, char *filename, char *nameval, char *pathval)
{
- SETTING_TRACE_BEGIN;
-
- JsonNode* menu_item = json_node_new(JSON_NODE_OBJECT);
+ JsonNode *menu_item = json_node_new(JSON_NODE_OBJECT);
JsonObject *object = json_object_new();
json_node_take_object(menu_item, object);
json_object_set_string_member(object, "name", nameval);
json_object_set_string_member(object, "path", pathval);
- JsonArray* menu = json_node_get_array(root);
+ JsonArray *menu = json_node_get_array(root);
json_array_add_element(menu, menu_item);
ss_json_ringtone_save(root);
json_generator_set_pretty(generator, TRUE);
gchar *data = json_generator_to_data(generator, NULL);
//SETTING_TRACE("%s", (char * )data);
- SETTING_TRACE("-------------------------------------------------------\n");
- SETTING_TRACE("%s", data);
- SETTING_TRACE("-------------------------------------------------------\n");
+ SST_SECURE_TRACE("-------------------------------------------------------\n");
+ SST_SECURE_TRACE("%s", data);
+ SST_SECURE_TRACE("-------------------------------------------------------\n");
- SETTING_TRACE("VCONFKEY_SETAPPL_CALL_RINGTONE_USER_LIST SET !!!!\n");
+ SST_SECURE_TRACE("VCONFKEY_SETAPPL_CALL_RINGTONE_USER_LIST SET !!!!\n");
vconf_set_str(VCONFKEY_SETAPPL_CALL_RINGTONE_USER_LIST, (char*)data);
g_free(data);
g_object_unref(generator);
}
-void ss_json_ringtone_remove(JsonNode *root, char* filename, char* path_to_del)
+void ss_json_ringtone_remove(JsonNode *root, char *filename, char *path_to_del)
{
int size = json_array_get_length(json_node_get_array(root));
- SETTING_TRACE("BBB size : (%d) \n", size);
+ SST_SECURE_TRACE("BBB size : (%d) \n", size);
int i = 0;
for (i = 0; i < size; i++) {
JsonObject *ringtone = json_array_get_object_element(json_node_get_array(root), i);
- //char *nameval = (char *)json_object_get_string_member(ringtone, "name");
- char *pathval = (char *)json_object_get_string_member(ringtone, "path");
+ //char *nameval = (char*)json_object_get_string_member(ringtone, "name");
+ char *pathval = (char*)json_object_get_string_member(ringtone, "path");
if (pathval && !strcmp(pathval, path_to_del)) {
json_array_remove_element(json_node_get_array(root), i);
- SETTING_TRACE("remove BBB : (%s) --- (%s) \n", pathval, path_to_del);
+ SST_SECURE_TRACE("remove BBB : (%s) --- (%s) \n", pathval, path_to_del);
}
}
ss_json_ringtone_save(root);
}
-bool ss_json_ringtone_contain(JsonNode *root, char* newfile)
+bool ss_json_ringtone_contain(JsonNode *root, char *newfile)
{
int size = json_array_get_length(json_node_get_array(root));
int i = 0;
for (i = 0; i < size; i++) {
JsonObject *ringtone = json_array_get_object_element(json_node_get_array(root), i);
- //char *nameval = (char *)json_object_get_string_member(ringtone, "name");
- char *pathval = (char *)json_object_get_string_member(ringtone, "path");
+ //char *nameval = (char*)json_object_get_string_member(ringtone, "name");
+ char *pathval = (char*)json_object_get_string_member(ringtone, "path");
//SETTING_TRACE("(%s) --- (%s) \n", name, path);
-
if (pathval && !strcmp(pathval, newfile)) {
//SETTING_TRACE("FOUND\n");
ret = true;
int i = 0;
for (i = 0; i < size; i++) {
JsonObject *ringtone = json_array_get_object_element(json_node_get_array(root), i);
- char *name = (char *)json_object_get_string_member(ringtone, "name");
- char *path = (char *)json_object_get_string_member(ringtone, "path");
- SETTING_TRACE("(%s) --- (%s) \n", name, path);
+ char *name = (char*)json_object_get_string_member(ringtone, "name");
+ char *path = (char*)json_object_get_string_member(ringtone, "path");
+ SST_SECURE_TRACE("(%s) --- (%s) \n", name, path);
}
}
/* LCOV_EXCL_STOP */
#include <stdlib.h>
#include "sys_settings.h"
-void clean_node(callback_node* node)
+void clean_node(callback_node *node)
{
if (!node)
return;
node->user_data = NULL;
}
-
callback_node* alloc_multi_callback_node()
{
- callback_node* node = NULL;
+ callback_node *node = NULL;
node = (callback_node*)malloc(sizeof(callback_node));
if (node == NULL) {
- SETTING_TRACE("Not enough node....");
+ SST_SECURE_TRACE("Not enough node....");
return NULL;
}
return node;
}
-void free_multi_callback_node(callback_node* node)
+void free_multi_callback_node(callback_node *node)
{
if (node)
free(node);
if (NULL == val) return 1;
if (NULL == s_val) return 1;
- callback_node* node = (callback_node*)val;
+ callback_node *node = (callback_node*)val;
if (node->callback == s_val)
return 0;
return -1;
int delete_multi_callback(callback_list *handle, system_settings_changed_cb ptr)
{
- SETTING_TRACE_BEGIN;
if (!handle || !ptr)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
g_list_free(found);
}
- SETTING_TRACE_END;
return SYSTEM_SETTINGS_ERROR_NONE;
}
int add_multi_callback(callback_list *handle, system_settings_changed_cb ptr, void *user_data)
{
- SETTING_TRACE_BEGIN;
if (!handle || !ptr)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
if (found != NULL)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
- callback_node* node = alloc_multi_callback_node();
+ callback_node *node = alloc_multi_callback_node();
if (node == NULL)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
/* append the node to list. free_multi_callback_node will free the node */
handle->list = g_list_append(handle->list, node);
- SETTING_TRACE_END;
return SYSTEM_SETTINGS_ERROR_NONE;
}
int invoke_callback_list(callback_list *handle, system_settings_key_e key)
{
- SETTING_TRACE_BEGIN;
if (!handle)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
GList *itr = handle->list;
while (itr != NULL) {
- callback_node* node = (callback_node*)itr->data;
+ callback_node *node = (callback_node*)itr->data;
if (node->callback)
node->callback(key, node->user_data);
itr = g_list_next(itr);
}
- SETTING_TRACE_END;
return SYSTEM_SETTINGS_ERROR_NONE;
}
#include <regex.h>
#include <aul.h>
-#include <dlog.h>
#include <vconf.h>
#include <glib.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 SETTING_TIME_ZONEINFO_PATH "/usr/share/zoneinfo/"
-#define SETTING_TIME_SHARE_LOCAL_PATH "/usr/share/locale"
-#define SETTING_TZONE_SYMLINK_PATH "/opt/etc/localtime"
-
-
-#define __FREE(del, arg) do { \
- if (arg) { \
- del((void *)(arg)); /*cast any argument to (void*) to avoid build warring*/\
- arg = NULL; \
- } \
-} while (0);
-#define FREE(arg) __FREE(free, arg)
-
#define SETTING_UTILS_SO_FILE_PATH "libsystem-settings-util.so"
int _is_file_accessible(const char *path);
*/
int system_setting_get_incoming_call_ringtone(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
char *vconf_value = NULL;
if (system_setting_vconf_get_value_string(item->vconf_key, &vconf_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-
-/* LCOV_EXCL_START */
int system_setting_get_email_alert_ringtone(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
char *vconf_value = NULL;
if (system_setting_vconf_get_value_string(item->vconf_key, &vconf_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-
int system_setting_get_default_font_type(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
char *font_name = dl_get_default_font_info();
if (font_name) {
- *value = (void *)font_name;
+ *value = (void*)font_name;
return SYSTEM_SETTINGS_ERROR_NONE;
} else {
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
}
-
/*////////////////////////////////////////////////////////////////////////////////////////////////// */
/**
* get current lock scren app package name (string)
*
* @return SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE raise exception if current lock type is 'password'
*/
-/* LCOV_EXCL_START */
int system_setting_get_lockscreen_app(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
char *pkg_name = NULL;
int locktype = -1;
if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &locktype))
*value = pkg_name;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
/*////////////////////////////////////////////////////////////////////////////////////////////////// */
int _is_file_accessible(const char *path)
{
- SETTING_TRACE_BEGIN;
int ret = access(path, R_OK);
if (ret == 0) {
- SETTING_TRACE("found the file %s", path);
+ SST_SECURE_TRACE("found the file %s", path);
return 0;
} else {
/* error code : 13 */
- SETTING_TRACE("found the file %s --- error code : %d ", path, errno);
+ SST_SECURE_TRACE("found the file %s --- error code : %d ", path, errno);
return -errno;
}
}
-
-
-/*////////////////////////////////////////////////////////////////////////////////////////////////// */
-// @todo move to CMake
-#define DEF_RINGTONE_FILE_PATH SETTING_DEF_RES"/Ringtones"
-
-#define USR_RINGTONE_FILE_PATH "/home/owner/content/Sounds/Ringtones"
-#define JSONFILE "/opt/home/owner/apps_rw/org.tizen.setting/data/.user-ringtones.json"
-
int system_setting_add_incoming_call_ringtone(system_settings_key_e key, void *value)
{
- SETTING_TRACE_BEGIN;
- char* pathval = (char*)value;
- char* dnameval = NULL;
- char* baseval = NULL;
+ char *pathval = value;
+ char *dnameval = NULL;
+ char *baseval = NULL;
#ifdef USE_JSONFILE
// NOT IN USE
int ret = SYSTEM_SETTINGS_ERROR_NONE;
if (false == ss_json_ringtone_contain(root, pathval)) {
// @todo : MAKE SURE THE ACTUAL FILE IS THERE ON PATHVAL(SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- ss_json_ringtone_add(root, JSONFILE, pathval, pathval);
- SETTING_TRACE("pathval is : %s -- OK", pathval);
+ ss_json_ringtone_add(root, SST_RINGTONE_JSONFILE, pathval, pathval);
+ SST_SECURE_TRACE("pathval is : %s -- OK", pathval);
} else {
- SETTING_TRACE("pathval is duplicated : %s", pathval);
+ SST_SECURE_TRACE("pathval is duplicated : %s", pathval);
ret = SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
dnameval = strdup(pathval);
baseval = strdup(pathval);
if (dnameval && baseval) {
- SETTING_TRACE("---> dirname is : %s ", dirname(dnameval));
- SETTING_TRACE("---> basename is : %s ", basename(baseval));
+ SST_SECURE_TRACE("---> dirname is : %s ", dirname(dnameval));
+ SST_SECURE_TRACE("---> basename is : %s ", basename(baseval));
}
- FREE(dnameval);
- FREE(baseval);
+ free(dnameval);
+ free(baseval);
if (parser) {
g_object_unref(parser);
int system_setting_del_incoming_call_ringtone(system_settings_key_e key, void *value)
{
- SETTING_TRACE_BEGIN;
- char* pathval = (char*)value;
+ char *pathval = value;
#ifdef USE_JSONFILE
// NOT IN USE
- JsonParser* parser = ss_json_ringtone_open_file(JSONFILE);
+ JsonParser *parser = ss_json_ringtone_open_file(JSONFILE);
#else
- JsonParser* parser = ss_json_ringtone_load_from_data();
+ JsonParser *parser = ss_json_ringtone_load_from_data();
#endif
JsonNode *root = json_parser_get_root(parser);
- ss_json_ringtone_remove(root, JSONFILE, pathval);
+ ss_json_ringtone_remove(root, SST_RINGTONE_JSONFILE, pathval);
//void ss_json_ringtone_remove(JsonNode *root, char* filename, char* path_to_del)
ss_json_ringtone_print(root);
return SYSTEM_SETTINGS_ERROR_NONE;
}
-
-/* LCOV_EXCL_START */
gint _compare_cb(gconstpointer d1, gconstpointer d2)
{
- fileNodeInfo *pNode1 = (fileNodeInfo *)d1;
- fileNodeInfo *pNode2 = (fileNodeInfo *)d2;
+ fileNodeInfo *pNode1 = (fileNodeInfo*)d1;
+ fileNodeInfo *pNode2 = (fileNodeInfo*)d2;
return strcmp(pNode1->media_name, pNode2->media_name);
}
-/* LCOV_EXCL_STOP */
/*
* get the RINGTONE list
*/
static void _get_default_ringtones(system_settings_key_e key, system_settings_iter_cb callback, void *data)
{
- SETTING_TRACE_BEGIN;
/*Get file list */
GList *filelist = NULL;
GList *iter;
//-----------------------------------------------------------------------------------------------------------------
int ret = get_filelist_from_dir_path(DEF_RINGTONE_FILE_PATH, &filelist);
if (ret != 0)
- SETTING_TRACE("Failed to get filelist, ret = %d %s", ret, DEF_RINGTONE_FILE_PATH);
+ SST_SECURE_TRACE("Failed to get filelist, ret = %d %s", ret, DEF_RINGTONE_FILE_PATH);
filelist = g_list_sort(filelist, _compare_cb);
for (iter = filelist; iter != NULL; iter = g_list_next(iter)) {
- node = (fileNodeInfo *)iter->data;
- SETTING_TRACE("file path = (%d) : name:%s path:%s [%s]", ret, node->name, node->path, node->media_name);
+ node = (fileNodeInfo*)iter->data;
+ SST_SECURE_TRACE("file path = (%d) : name:%s path:%s [%s]", ret, node->name, node->path, node->media_name);
// @todo assert NULL check
if (callback) {
char temp[1024];
snprintf(temp, 1024, "%s/%s", node->path, node->name);
- char* path = strdup(temp);
+ char *path = strdup(temp);
bool ret = callback(idx, (void *)(path), data);
if (path) {
free(path);
path = NULL;
}
if (ret == false) {
- SETTING_TRACE("quit the iteration by return value == false : %d", ret);
+ SST_SECURE_TRACE("quit the iteration by return value == false : %d", ret);
break;
}
-
} else {
- SETTING_TRACE("--> system_setting_data_iterator is NULL");
+ SST_SECURE_TRACE("--> system_setting_data_iterator is NULL");
}
}
for (iter = filelist; iter != NULL; iter = g_list_next(iter)) {
- node = (fileNodeInfo *)iter->data;
- FREE(node->path);
- FREE(node->name);
- FREE(node->media_name);
- FREE(node);
+ node = (fileNodeInfo*)iter->data;
+ free(node->path);
+ node->path = NULL;
+ free(node->name);
+ node->name = NULL;
+ free(node->media_name);
+ node->media_name = NULL;
+ free(node);
}
g_list_free(filelist);
filelist = NULL;
-
}
static void _get_user_ringtones(system_settings_key_e key, system_settings_iter_cb callback, void *data)
{
- SETTING_TRACE_BEGIN;
-
#ifdef USE_JSONFILE
// NOT IN USE
- JsonParser* parser = ss_json_ringtone_open_file(JSONFILE);
+ JsonParser *parser = ss_json_ringtone_open_file(JSONFILE);
#else
- JsonParser* parser = ss_json_ringtone_load_from_data();
+ JsonParser *parser = ss_json_ringtone_load_from_data();
#endif
JsonNode *root = json_parser_get_root(parser);
int i = 0;
for (i = 0; i < size; i++) {
JsonObject *ringtone = json_array_get_object_element(json_node_get_array(root), i);
- char *nameval = (char *)json_object_get_string_member(ringtone, "name");
- char *pathval = (char *)json_object_get_string_member(ringtone, "path");
- SETTING_TRACE("(%s) --- (%s) \n", nameval, pathval);
+ char *nameval = (char*)json_object_get_string_member(ringtone, "name");
+ char *pathval = (char*)json_object_get_string_member(ringtone, "path");
+ SST_SECURE_TRACE("(%s) --- (%s) \n", nameval, pathval);
if (callback && pathval) {
- char* path = strdup(pathval);
+ char *path = strdup(pathval);
bool ret = callback(i, (void *)(path), data);
if (ret == false) {
- SETTING_TRACE("quit the iteration by return value == false : %d", ret);
+ SST_SECURE_TRACE("quit the iteration by return value == false : %d", ret);
break;
}
- FREE(path);
+ free(path);
} else {
- SETTING_TRACE("--> callback is NULL");
+ SST_SECURE_TRACE("--> callback is NULL");
}
}
int system_setting_list_incoming_call_ringtone(system_settings_key_e key, system_settings_iter_cb callback, void *data)
{
- SETTING_TRACE_BEGIN;
-
_get_default_ringtones(key, callback, data);
//-----------------------------------------------------------------------------------------------------------------
// 2. get the USER ringtone list
return SYSTEM_SETTINGS_ERROR_NONE;
}
-
-/* LCOV_EXCL_START */
int system_setting_set_incoming_call_ringtone(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
- char *vconf_value;
- vconf_value = (char *)value;
+ char *vconf_value = value;
int ret = _is_file_accessible(vconf_value);
if (ret == 0) {
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-
-/* LCOV_EXCL_START */
int system_setting_set_email_alert_ringtone(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
- char *vconf_value;
- vconf_value = (char *)value;
+ char *vconf_value = value;
int ret = _is_file_accessible(vconf_value);
if (ret == 0) {
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static bool dl_is_supported_image_type_load(char *path)
{
void *handle = NULL;
char *error;
bool ret = false;
- bool(*image_type_check)(char *path);
+ bool (*image_type_check)(char *path);
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
+ SST_SECURE_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");
+ SST_SECURE_TRACE("ERROR!! canNOT find __is_supported_image_type_load function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return false;
dlclose(handle);
return ret;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static int dl_is_available_font(char *str)
{
void *handle = NULL;
char *error;
int ret = false;
- int(*check_available_font)(char *font_name);
+ int (*check_available_font)(char *font_name);
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
+ SST_SECURE_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");
+ SST_SECURE_TRACE("ERROR!! canNOT find __is_available_font function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return false;
dlclose(handle);
return ret;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static void dl_font_size_set()
{
void *handle = NULL;
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
+ SST_SECURE_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");
+ SST_SECURE_TRACE("ERROR!! canNOT find __font_size_set function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return;
dlclose(handle);
return;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static void dl_font_config_set_notification()
{
void *handle = NULL;
char *error;
- void(*set_font_nodification)();
+ void (*set_font_nodification)();
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
+ SST_SECURE_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");
+ SST_SECURE_TRACE("ERROR!! canNOT find font_config_set_notification function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return;
dlclose(handle);
return;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static bool dl_font_config_set(char *font_name)
{
void *handle = NULL;
char *error;
bool ret = false;
- bool(*check_font_type)(char *font_name);
+ bool (*check_font_type)(char *font_name);
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
+ SST_SECURE_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");
+ SST_SECURE_TRACE("ERROR!! canNOT find font_config_set function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return false;
dlclose(handle);
return ret;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static char *dl_get_default_font_info()
{
void *handle = NULL;
handle = dlopen(SETTING_UTILS_SO_FILE_PATH, RTLD_LAZY);
if (!handle) {
- SETTING_TRACE("ERROR!! canNOT find libsystem-settings-util.so");
+ SST_SECURE_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");
+ SST_SECURE_TRACE("ERROR!! canNOT find _get_default_font function at libsystem-settings-util.so");
if (handle)
dlclose(handle);
return false;
dlclose(handle);
return ret;
}
-/* LCOV_EXCL_STOP */
#ifdef TIZEN_WEARABLE
-/* LCOV_EXCL_START */
static int system_setting_get_extended_wallpaper_num(const char *file_path, unsigned int *num)
{
SETTING_TRACE_BEGIN;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static int system_setting_copy_extended_wallpaper(const char *dest_file_path, const char *source_file_path)
{
SETTING_TRACE_BEGIN;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static int system_setting_remove_oldest_extended_wallpaper()
{
SETTING_TRACE_BEGIN;
continue;
if (system_setting_get_extended_wallpaper_num(dirp->d_name, &temp_image_num)
- != SYSTEM_SETTINGS_ERROR_NONE) {
+ != SYSTEM_SETTINGS_ERROR_NONE) {
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static int system_setting_check_extended_wallpaper(const char *file_path)
{
char buffer[512];
snprintf(buffer, 512, "%s/.bgwallpaper", tzplatform_getenv(TZ_USER_CONTENT));
return (strstr(file_path, buffer) != NULL);
}
-/* LCOV_EXCL_STOP */
#define WALLPAPER_MAX_COUNT 10
#endif
-/* LCOV_EXCL_START */
int system_setting_set_wallpaper_home_screen(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
- char *vconf_value;
- vconf_value = (char *)value;
+ char *vconf_value = value;
bool isok = dl_is_supported_image_type_load(vconf_value);
if (!isok) {
/* not supported */
- SETTING_TRACE("path : %s is not supported file format", vconf_value);
+ SST_SECURE_TRACE("path : %s is not supported file format", vconf_value);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
} else {
- SETTING_TRACE("path : %s is SUPPORT file format", vconf_value);
+ SST_SECURE_TRACE("path : %s is SUPPORT file format", vconf_value);
}
/* error handling here */
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
if (system_setting_vconf_set_value_int(VCONFKEY_SETAPPL_WALLPAPER_CHANGED_NOTI_INT,
- VCONFKEY_WALLPAPER_CHANGED_NOTI_GEAR)) {
+ VCONFKEY_WALLPAPER_CHANGED_NOTI_GEAR)) {
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
} else {
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_set_wallpaper_lock_screen(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
- char *vconf_value;
- vconf_value = (char *)value;
+ char *vconf_value = value;
bool isok = dl_is_supported_image_type_load(vconf_value);
if (!isok) {
/* not supported */
- SETTING_TRACE("path : %s is not supported file format", vconf_value);
+ SST_SECURE_TRACE("path : %s is not supported file format", vconf_value);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
} else {
- SETTING_TRACE("path : %s is SUPPORT file format", vconf_value);
+ SST_SECURE_TRACE("path : %s is SUPPORT file format", vconf_value);
}
/* error handling here */
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_set_font_size(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
int *vconf_value;
vconf_value = *(int **)value;
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
dl_font_size_set();
- SETTING_TRACE_END;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
/**
* [internal API]
*/
-/* LCOV_EXCL_START */
-void *font_conf_doc_parse(char *doc_name, char *font_name)
+void* font_conf_doc_parse(char *doc_name, char *font_name)
{
- SETTING_TRACE_BEGIN;
xmlDocPtr doc = NULL;
xmlNodePtr cur = NULL;
xmlNodePtr cur2 = NULL;
return NULL;
}
- if (xmlStrcmp(cur->name, (const xmlChar *)"fontconfig")) {
+ if (xmlStrcmp(cur->name, (const xmlChar*)"fontconfig")) {
xmlFreeDoc(doc);
doc = NULL;
return NULL;
bool is_changed = false;
while (cur != NULL) {
- if ((!xmlStrcmp(cur->name, (const xmlChar *)"match"))) {
+ if ((!xmlStrcmp(cur->name, (const xmlChar*)"match"))) {
cur2 = cur->xmlChildrenNode;
while (cur2 != NULL) {
- if ((!xmlStrcmp(cur2->name, (const xmlChar *)"edit"))) {
- xmlChar *name = xmlGetProp(cur2, (const xmlChar *)"name");
+ if ((!xmlStrcmp(cur2->name, (const xmlChar*)"edit"))) {
+ xmlChar *name = xmlGetProp(cur2, (const xmlChar*)"name");
/* if name is not 'family', break */
- if (xmlStrcmp(name, (const xmlChar *)"family")) {
+ if (xmlStrcmp(name, (const xmlChar*)"family")) {
xmlFree(name);
name = NULL;
break;
cur3 = cur2->xmlChildrenNode;
while (cur3 != NULL) {
- if ((!xmlStrcmp(cur3->name, (const xmlChar *)"string"))) {
- xmlNodeSetContent(cur3->xmlChildrenNode, (const xmlChar *)font_name);
+ if ((!xmlStrcmp(cur3->name, (const xmlChar*)"string"))) {
+ xmlNodeSetContent(cur3->xmlChildrenNode, (const xmlChar*)font_name);
key = xmlNodeListGetString(doc, cur3->xmlChildrenNode, 1);
xmlFree(key);
key = NULL;
}
cur2 = cur2->next;
}
- } else if ((!xmlStrcmp(cur->name, (const xmlChar *)"alias"))) {
+ } else if ((!xmlStrcmp(cur->name, (const xmlChar*)"alias"))) {
cur2 = cur->xmlChildrenNode;
while (cur2 != NULL) {
- if ((!xmlStrcmp(cur2->name, (const xmlChar *)"family"))) {
- xmlNodeSetContent(cur2->xmlChildrenNode, (const xmlChar *)font_name);
+ if ((!xmlStrcmp(cur2->name, (const xmlChar*)"family"))) {
+ xmlNodeSetContent(cur2->xmlChildrenNode, (const xmlChar*)font_name);
key = xmlNodeListGetString(doc, cur2->xmlChildrenNode, 1);
xmlFree(key);
key = NULL;
is_changed = true;
- } else if ((!xmlStrcmp(cur2->name, (const xmlChar *)"prefer"))) {
+ } else if ((!xmlStrcmp(cur2->name, (const xmlChar*)"prefer"))) {
cur3 = cur2->xmlChildrenNode;
while (cur3 != NULL) {
- if ((!xmlStrcmp(cur3->name, (const xmlChar *)"family"))) {
- xmlNodeSetContent(cur3->xmlChildrenNode, (const xmlChar *)font_name);
+ if ((!xmlStrcmp(cur3->name, (const xmlChar*)"family"))) {
+ xmlNodeSetContent(cur3->xmlChildrenNode, (const xmlChar*)font_name);
key = xmlNodeListGetString(doc, cur3->xmlChildrenNode, 1);
xmlFree(key);
key = NULL;
return NULL;
}
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_set_font_type(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
char *font_name = NULL;
- font_name = (char *)value;
+ font_name = (char*)value;
/* get current font list */
int is_found = dl_is_available_font(font_name);
if (is_found == 1) {
- SETTING_TRACE("found font : %s ", font_name);
+ SST_SECURE_TRACE("found font : %s ", font_name);
} else {
- SETTING_TRACE(" NOT found font : %s ", font_name);
+ SST_SECURE_TRACE(" NOT found font : %s ", font_name);
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
bool bsave = dl_font_config_set(font_name);
if (!bsave) {
- SETTING_TRACE(" font type save error by font_config_set() ");
+ SST_SECURE_TRACE(" font type save error by font_config_set() ");
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
} else {
- SETTING_TRACE(" save OK - font_config_set() ");
+ SST_SECURE_TRACE(" save OK - font_config_set() ");
}
xmlDocPtr doc = (xmlDocPtr)font_conf_doc_parse(SETTING_FONT_CONF_FILE, font_name);
dl_font_config_set_notification();
char *vconf_value;
- vconf_value = (char *)value;
+ vconf_value = (char*)value;
if (system_setting_vconf_set_value_string(item->vconf_key, vconf_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static int category_func(const char *name, void *user_data)
{
- SETTING_TRACE_BEGIN;
static char *category = "lock-screen";
if (name && !strcmp(name, category)) {
- SETTING_TRACE(" SAME ");
+ SST_SECURE_TRACE(" SAME ");
return -1;
} else {
- SETTING_TRACE(" DIFFERENT -- %s, category -- %s ", name, category);
+ SST_SECURE_TRACE(" DIFFERENT -- %s, category -- %s ", name, category);
return 0;
}
return 0;
}
-/* LCOV_EXCL_STOP */
/**
*
*
*/
-/* LCOV_EXCL_START */
int system_setting_set_lockscreen_app(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
char *vconf_value;
- vconf_value = (char *)value; /* ex) com.samsung.lockscreen */
+ vconf_value = (char*)value; /* ex) com.samsung.lockscreen */
int r = 0;
pkgmgrinfo_appinfo_h handle;
r = pkgmgrinfo_appinfo_get_appinfo(vconf_value, &handle);
if (r != PMINFO_R_OK) {
- SETTING_TRACE("*** pkginfo failed ");
+ SST_SECURE_TRACE("*** pkginfo failed ");
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
} else {
- SETTING_TRACE("%p", handle);
+ SST_SECURE_TRACE("%p", handle);
}
- int ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)"lock-screen");
+ int ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void*)"lock-screen");
if (ret != PMINFO_R_OK) {
pkgmgrinfo_appinfo_destroy_appinfo(handle);
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
/*/////////////////////////////////////////////////////////////////////////////////////////////// */
/**
* @todo need to add custom event notification method
*/
-
/*//////////////////////////////////////////////////////////////////////////////////////// */
/*--------------------------------------- */
int system_setting_get_locale_country(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
char *vconf_value = NULL;
if (system_setting_vconf_get_value_string(item->vconf_key, &vconf_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
/* parsing validation */
/* en_US.UTF-8 */
- char arr[21] = { 0, };
+ char arr[21] = {0};
snprintf(arr, 20, "%s", vconf_value);
for (int i = 0; i < strlen(arr); i++) {
if ('.' == arr[i]) {
arr[i] = 0;
- SETTING_TRACE("replace . to NULL : %d", i);
+ SST_SECURE_TRACE("replace . to NULL : %d", i);
break;
}
}
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_START */
int system_setting_set_locale_country(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
char *vconf_value = NULL;
- vconf_value = (char *)value;
+ vconf_value = (char*)value;
char *ext = "UTF-8";
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
/*--------------------------------------- */
int system_setting_get_locale_language(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
char *vconf_value = NULL;
if (system_setting_vconf_get_value_string(item->vconf_key, &vconf_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
/* parsing validation */
/* en_US.UTF-8 */
- char arr[21] = { 0, };
+ char arr[21] = {0};
snprintf(arr, 20, "%s", vconf_value);
for (int i = 0; i < strlen(arr); i++) {
if ('.' == arr[i]) {
arr[i] = 0;
- SETTING_TRACE("replace . to NULL : %d", i);
+ SST_SECURE_TRACE("replace . to NULL : %d", i);
break;
}
}
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_START */
int system_setting_set_locale_language(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
char *vconf_value = NULL;
- vconf_value = (char *)value;
+ vconf_value = (char*)value;
char *ext = "UTF-8";
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
/*--------------------------------------- */
-/* LCOV_EXCL_START */
int system_setting_get_locale_timeformat_24hour(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
int vconf_value;
if (system_setting_vconf_get_value_int(item->vconf_key, &vconf_value))
else if (vconf_value == VCONFKEY_TIME_FORMAT_24)
ret_value = true;
- *value = (void *)ret_value;
+ *value = (void*)ret_value;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_set_locale_timeformat_24hour(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
bool *vconf_value;
- vconf_value = (bool *)value;
+ vconf_value = (bool*)value;
if (*vconf_value) {
if (system_setting_vconf_set_value_int(item->vconf_key, VCONFKEY_TIME_FORMAT_24))
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_get_locale_timezone(system_setting_h item, void **value)
{
char tzpath[256];
if (len != -1) {
tzpath[len] = '\0';
} else {
- SETTING_TRACE("parse error for SETTING_TZONE_SYMLINK_PATH");
+ SST_SECURE_TRACE("parse error for SETTING_TZONE_SYMLINK_PATH");
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
- SETTING_TRACE("tzpath : %s ", &tzpath[20]);
+ SST_SECURE_TRACE("tzpath : %s ", &tzpath[20]);
*value = strdup(&tzpath[20]);
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_set_locale_timezone(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
char *timezone_value = NULL;
- timezone_value = (char *)value;
+ timezone_value = (char*)value;
char tz_path[1024];
snprintf(tz_path, 1024, "/usr/share/zoneinfo/%s", timezone_value);
}
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_get_time_changed(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
time_t cur_tick;
- int ** val = (int**)value;
+ int **val = (int**)value;
cur_tick = time(NULL);
**val = cur_tick;
/* struct tm * localtime = time (cur_tick); */
/* printf("%s\n", ctime(&cur_tick); */
return SYSTEM_SETTINGS_ERROR_NONE;
-
}
-/* LCOV_EXCL_STOP */
/**
* a = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL(==item->vconf_key) b = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL
* a == true, b == false --> sound mode
* a == false, b == true --> vibration mode
*/
-/* LCOV_EXCL_START */
int system_setting_get_sound_silent_mode(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
bool sound_cond;
bool vib_cond;
if (sound_cond == false && vib_cond == false) {
vconf_value = true;
- *value = (void *)vconf_value;
+ *value = (void*)vconf_value;
} else {
vconf_value = false;
- *value = (void *)vconf_value;
+ *value = (void*)vconf_value;
}
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
/**
* a = VCONFKEY_SETAPPL_SOUND_STATUS_BOOL(==item->vconf_key) b = VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL
*/
int system_setting_set_sound_silent_mode(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
- bool *vconf_value;
-
- vconf_value = (bool *)value;
+ bool *vconf_value = value;
bool vconf_sound = false;
bool vconf_vib = false;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_START */
int system_setting_set_screen_backlight_time(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
- int *vconf_value;
- vconf_value = *(int **)value;
+ int *vconf_value = *(int **)value;
if (!(*vconf_value > 0 && *vconf_value <= 600)) {
- SETTING_TRACE(" ERR Betweeny here 0 ~ 600");
+ SST_SECURE_TRACE(" ERR Betweeny here 0 ~ 600");
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
}
if (system_setting_vconf_set_value_int(item->vconf_key, *vconf_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
- SETTING_TRACE_END;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_set_sound_notification(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
- char *vconf_value = NULL;
- vconf_value = (char *)value;
+ char *vconf_value = value;
int is_load = _is_file_accessible(vconf_value);
if (is_load == 0) {
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_set_device_name(system_settings_key_e key, void *value)
{
- SETTING_TRACE_BEGIN;
- char *vconf_value = NULL;
- vconf_value = (char *)value;
+ char *vconf_value = value;
if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_DEVICE_NAME_STR, vconf_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-/* LCOV_EXCL_STOP */
int system_setting_get_network_wifi_notification(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
int vconf_value;
if (system_setting_vconf_get_value_int(item->vconf_key, &vconf_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
bool bret;
bret = (vconf_value == VCONFKEY_WIFI_QS_ENABLE) ? true : false;
- *value = (void *)bret;
+ *value = (void*)bret;
return SYSTEM_SETTINGS_ERROR_NONE;
}
int system_setting_get_ads_id(system_setting_h item, void **value)
{
- SETTING_TRACE_BEGIN;
int optout_value = 0;
if (system_setting_vconf_get_value_int(VCONFKEY_SETAPPL_AD_ID_OPT_OUT, &optout_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
return SYSTEM_SETTINGS_ERROR_NONE;
}
-
#if DEBUG_DUMP_CONTEXT
void make_ad_id(void)
{
uuid_t uuid_value;
- char uuid_unparsed[50] = { 0 };
+ char uuid_unparsed[50] = {0};
uuid_generate(uuid_value);
uuid_unparse(uuid_value, uuid_unparsed);
system_setting_set_ad_id(key, uuid_unparsed); //example of setting the value
#endif
int system_setting_set_ads_id(system_setting_h item, void *value)
{
- SETTING_TRACE_BEGIN;
- char *vconf_value = NULL;
- vconf_value = (char *)value;
+ char *vconf_value = value;
if (system_setting_vconf_set_value_string(item->vconf_key, vconf_value)) {
- SETTING_TRACE("Setting VCONFKEY_SETAPPL_AD_ID failed");
+ SST_SECURE_TRACE("Setting VCONFKEY_SETAPPL_AD_ID failed");
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
bool feature_data = false;
int ret = system_info_get_platform_bool(path, &feature_data);
if (ret != SYSTEM_INFO_ERROR_NONE) {
- SETTING_TRACE("Setting - reading feature data failed, %d", ret);
+ SST_SECURE_TRACE("Setting - reading feature data failed, %d", ret);
return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
}
ret = (feature_data == true) ? SYSTEM_SETTINGS_ERROR_NONE : SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
return ret;
-
}
int system_setting_feature_check_incoming_call(void *value)
return ret;
}
-
int system_setting_feature_check_font(void *value)
{
static bool first_query = true;
return ret;
}
-/* LCOV_EXCL_START */
int system_setting_feature_check_wearable_profile(void *value)
{
static bool first_query = true;
int rotary_feature = SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
ret = system_info_get_platform_string(SETTING_PROFILE_PATH, &profile_data);
if (ret != SYSTEM_INFO_ERROR_NONE) {
- SETTING_TRACE("Setting - reading profile string failed, %d", ret);
+ SST_SECURE_TRACE("Setting - reading profile string failed, %d", ret);
return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
}
return ret;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
int system_setting_get_uds_state(system_setting_h item, void **value)
{
- int ** p_value = (int**)value;
+ int **p_value = (int**)value;
int vconf_value;
char *vconf_string_value = NULL;
if (system_setting_vconf_get_value_int(item->vconf_key, &vconf_value))
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
- SETTING_TRACE("[%s] udsm: %d", __FUNCTION__, vconf_value);
+ SST_SECURE_TRACE("[%s] udsm: %d", __FUNCTION__, vconf_value);
if (vconf_value == SYSTEM_SETTINGS_UDS_ON) {
if (system_setting_vconf_get_value_string(VCONFKEY_SETAPPL_UDSM_PKGID_LIST, &vconf_string_value))
int result = 0;
result = package_manager_get_package_id_by_app_id(app_id, &package_id);
if (result != PACKAGE_MANAGER_ERROR_NONE) {
- SETTING_TRACE("package_manager_get_package_id_by_app_id returned error! %d", result);
+ SST_SECURE_TRACE("package_manager_get_package_id_by_app_id returned error! %d", result);
free(app_id);
free(vconf_string_value);
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
- SETTING_TRACE("[%s] udsm_pkg_list : %s", __FUNCTION__, vconf_string_value);
+ SST_SECURE_TRACE("[%s] udsm_pkg_list : %s", __FUNCTION__, vconf_string_value);
}
if (package_id && strstr(vconf_string_value, package_id)) {
vconf_value = SYSTEM_SETTINGS_UDS_ON_WHITELISTED;
- SETTING_TRACE("[%s] pkg id : %s", __FUNCTION__, package_id);
+ SST_SECURE_TRACE("[%s] pkg id : %s", __FUNCTION__, package_id);
} else {
vconf_value = SYSTEM_SETTINGS_UDS_ON;
}
-
}
free(vconf_string_value);
}
**p_value = vconf_value;
-
return SYSTEM_SETTINGS_ERROR_NONE;
}
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
/*remove ext name */
-char *get_filename_from_fullname(const char *fullname)
+char* get_filename_from_fullname(const char *fullname)
{
//retvm_if(fullname == NULL, NULL, "fullname == NULL");
if (fullname == NULL) return NULL;
}
/* LCOV_EXCL_STOP */
-char *get_media_basename(const char *dir_path, const char *name)
+char* get_media_basename(const char *dir_path, const char *name)
{
//retv_if(isEmptyStr(dir_path) || isEmptyStr(name), NULL);
if (dir_path == NULL) return NULL;
- char path[512] = { 0 };
+ char path[512] = {0};
snprintf(path, sizeof(path), "%s/%s", dir_path, name);
metadata_extractor_h metadata = NULL;
ret = metadata_extractor_set_path(metadata, path);
if (ret == METADATA_EXTRACTOR_ERROR_NONE) {
ret = metadata_extractor_get_metadata(
- metadata, METADATA_TITLE, &title);
+ metadata, METADATA_TITLE, &title);
metadata_extractor_destroy(metadata);
if (title)
- /*return (char *)g_strdup(title);*/
- return (char *)title;
+ return title;
else
return strdup(name);
} else {
int get_filelist_from_dir_path(char *path, GList **file_list)
{
- SETTING_TRACE_BEGIN;
DIR *pDir = NULL;
struct dirent *ent;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
if (path == NULL) {
- SETTING_TRACE("dir path is null");
+ SST_SECURE_TRACE("dir path is null");
return -1;
}
if (file_list == NULL) {
- SETTING_TRACE("file_list is null");
+ SST_SECURE_TRACE("file_list is null");
return -1;
}
pNode->path = strdup(path);
pNode->name = strdup(ent->d_name);
pNode->media_name = get_media_basename(
- pNode->path, pNode->name);
+ pNode->path, pNode->name);
*file_list = g_list_append(*file_list, pNode);
}
pthread_mutex_unlock(&mutex);
closedir(pDir);
- //SETTING_TRACE_END;
-
return 0;
}
-
#include <string.h>
#include <vconf.h>
-#include <dlog.h>
#include "system_settings.h"
#include "sys_settings.h"
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "TIZEN_N_SYSTEM_SETTINGS"
-
int system_setting_vconf_get_value_int(const char *vconf_key, int *value)
{
return vconf_get_int(vconf_key, value);
typedef void (*system_setting_vconf_event_cb)(keynode_t *node, void *event_data);
-/* LCOV_EXCL_START */
static void system_setting_vconf_event_cb0(keynode_t *node, void *event_data)
{
system_settings_key_e pkey = (system_settings_key_e)event_data;
int ret = system_settings_get_item(pkey, &system_setting_item);
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
}
void *user_data = NULL;
system_setting_item->changed_cb(pkey, user_data);
}
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static void system_setting_vconf_event_cb1(keynode_t *node, void *event_data)
{
system_setting_vconf_event_cb0(node, event_data);
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static void system_setting_vconf_event_cb2(keynode_t *node, void *event_data)
{
system_setting_vconf_event_cb0(node, event_data);
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static void system_setting_vconf_event_cb3(keynode_t *node, void *event_data)
{
system_setting_vconf_event_cb0(node, event_data);
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static void system_setting_vconf_event_cb4(keynode_t *node, void *event_data)
{
system_setting_vconf_event_cb0(node, event_data);
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static system_setting_vconf_event_cb system_setting_vconf_get_event_cb_slot(system_setting_callback_slot_e slot)
{
switch (slot) {
return NULL;
}
}
-/* LCOV_EXCL_STOP */
int system_setting_vconf_set_changed_cb(const char *vconf_key, system_settings_key_e key, system_setting_callback_slot_e slot, void *user_data)
{
vconf_event_cb = system_setting_vconf_get_event_cb_slot(slot);
if (vconf_event_cb == NULL) {
- LOGE("[%s] INVALID_error , %s", __FUNCTION__, "vconf_event_cb == 0");
+ ERR("[%s] INVALID_error , %s", __FUNCTION__, "vconf_event_cb == 0");
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
- if (vconf_notify_key_changed(vconf_key, vconf_event_cb, (void *)key)) {
- LOGE("[%s] INVALID_error , %s", __FUNCTION__, "vconf_notify_key_changed error");
+ if (vconf_notify_key_changed(vconf_key, vconf_event_cb, (void*)key)) {
+ ERR("[%s] INVALID_error , %s", __FUNCTION__, "vconf_notify_key_changed error");
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
static void system_setting_vconf_event_multi_cb(keynode_t *node, void *event_data)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
system_settings_key_e pkey = (system_settings_key_e)event_data;
if (node != NULL) {
int ret = system_settings_get_item(pkey, &system_setting_item);
if (ret != 0) {
if (ret == SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER)
- LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
+ ERR("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
}
invoke_callback_list(&system_setting_item->changed_cb_list, pkey);
}
- LOGE("Leave [%s]", __FUNCTION__);
+ ERR("Leave [%s]", __FUNCTION__);
}
-/* LCOV_EXCL_START */
static void system_setting_vconf_event_multi_cb_slot_0(keynode_t *node, void *event_data)
{
system_setting_vconf_event_multi_cb(node, event_data);
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static void system_setting_vconf_event_multi_cb_slot_1(keynode_t *node, void *event_data)
{
system_setting_vconf_event_multi_cb(node, event_data);
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static void system_setting_vconf_event_multi_cb_slot_2(keynode_t *node, void *event_data)
{
system_setting_vconf_event_multi_cb(node, event_data);
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static void system_setting_vconf_event_multi_cb_slot_3(keynode_t *node, void *event_data)
{
system_setting_vconf_event_multi_cb(node, event_data);
}
-/* LCOV_EXCL_STOP */
static system_setting_vconf_event_cb system_setting_vconf_get_event_multi_cb_slot(system_settings_key_e key)
{
int system_setting_vconf_set_changed_multi_cb(const char *vconf_key, system_settings_key_e key)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
system_setting_vconf_event_cb vconf_event_cb;
vconf_event_cb = system_setting_vconf_get_event_multi_cb_slot(key);
if (vconf_event_cb == NULL)
return SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER;
- int ret = vconf_notify_key_changed(vconf_key, vconf_event_cb, (void *)key);
+ int ret = vconf_notify_key_changed(vconf_key, vconf_event_cb, (void*)key);
if (ret != 0) {
- LOGE("[%s] INVALID_error , ret = %d, %s", __FUNCTION__, ret, "vconf_notify_key_changed error");
+ ERR("[%s] INVALID_error , ret = %d, %s", __FUNCTION__, ret, "vconf_notify_key_changed error");
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
- LOGE("Leave [%s]", __FUNCTION__);
+ ERR("Leave [%s]", __FUNCTION__);
return SYSTEM_SETTINGS_ERROR_NONE;
}
int system_setting_vconf_unset_changed_multi_cb(const char *vconf_key, system_settings_key_e key)
{
- LOGE("Enter [%s]", __FUNCTION__);
+ ERR("Enter [%s]", __FUNCTION__);
system_setting_vconf_event_cb vconf_event_cb;
vconf_event_cb = system_setting_vconf_get_event_multi_cb_slot(key);
int ret = vconf_ignore_key_changed(vconf_key, vconf_event_cb);
if (ret != 0) {
- LOGE("[%s] INVALID_error , ret = %d, %s", __FUNCTION__, ret, "vconf_ignore_key_changed error");
+ ERR("[%s] INVALID_error , ret = %d, %s", __FUNCTION__, ret, "vconf_ignore_key_changed error");
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
- LOGE("Leave [%s]", __FUNCTION__);
+ ERR("Leave [%s]", __FUNCTION__);
return SYSTEM_SETTINGS_ERROR_NONE;
}
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
-
-#ifndef API
-#define API __attribute__ ((visibility("default")))
-#endif
+#include "sst.h"
API bool eext_config_font_set(char *name, int size)
{
return true;
}
-
if (0 == strcmp(pathname, "/opt/usr/test/tct-content-tizen-tests_video.mp4"))
return 0;
- int (*org_fn)(const char *, int) = NULL;
+ int (*org_fn)(const char *, int);
org_fn = dlsym(RTLD_NEXT, "access");
return org_fn(pathname, mode);
}
return 30;
}
- ssize_t(*org_fn)(const char *restrict, char *restrict, size_t) = NULL;
+ ssize_t(*org_fn)(const char *restrict, char *restrict, size_t);
org_fn = dlsym(RTLD_NEXT, "readlink");
return org_fn(path, buf, len);
}
-API DIR* opendir(const char *name)
+API DIR *opendir(const char *name)
{
- DIR* (*org_fn)(const char *) = NULL;
+ DIR *(*org_fn)(const char *);
org_fn = dlsym(RTLD_NEXT, "opendir");
if (0 == strcmp(name, SETTING_DEF_RES"/Ringtones")) {
char *s; /**< String type */
}; /**< Value for keynode */
-void checkNotifyCallBack(const char* in_key, int type, UnionValue* value)
+void checkNotifyCallBack(const char *in_key, int type, UnionValue *value)
{
string str;
str = in_key;
if (str.compare(itr->first) == 0) {
vconf_callback_fn cb = (vconf_callback_fn)itr->second.first;
- void* user_data = itr->second.second;
+ void *user_data = itr->second.second;
keynode_t node;
node.keyname = (char*)str.c_str();
return NULL;
}
-
/************************************************
* keylist handling APIs
************************************************/
}
API int vconf_keylist_lookup(keylist_t *keylist, const char *keyname,
- keynode_t **return_node)
+ keynode_t **return_node)
{
return 0;
}
-API keynode_t *vconf_keylist_nextnode(keylist_t *keylist)
+API keynode_t* vconf_keylist_nextnode(keylist_t *keylist)
{
return NULL;
}
API int vconf_keylist_add_int(keylist_t *keylist, const char *keyname,
- const int value)
+ const int value)
{
return 0;
}
API int vconf_keylist_add_bool(keylist_t *keylist, const char *keyname,
- const int value)
+ const int value)
{
return 0;
}
API int vconf_keylist_add_dbl(keylist_t *keylist, const char *keyname,
- const double value)
+ const double value)
{
return 0;
}
API int vconf_keylist_add_str(keylist_t *keylist, const char *keyname,
- const char *value)
+ const char *value)
{
return 0;
}
}
#endif
-
#if 0 /* select key */
{
sqlite3_stmt *stmt = NULL;
}
LOG_D(stdout, "vconf get: layer[%s] key[%s], value[%s]\n",
- sqlite3_column_text(stmt, 0),
- sqlite3_column_text(stmt, 1),
- sqlite3_column_text(stmt, 2));
+ sqlite3_column_text(stmt, 0),
+ sqlite3_column_text(stmt, 1),
+ sqlite3_column_text(stmt, 2));
sqlite3_finalize(stmt);
}
{
LOG_D(stdout, "[%s][%d] key[%s] value[%s]\n", __func__, __LINE__, in_key, strval);
snprintf(sql, MAX_BUF_LEN, "INSERT OR REPLACE INTO vconf ( layer, key, value ) "
- "VALUES ( \"%s\", \"%s\", \'%s\');", "system", in_key, strval);
+ "VALUES ( \"%s\", \"%s\", \'%s\');", "system", in_key, strval);
rc = sqlite3_exec(db, sql, 0, 0, &err_msg);
if (rc != SQLITE_OK) {
sqlite3_stmt *stmt = NULL;
LOG_D(stdout, "[%s][%d] key[%s] value[%s]\n", __func__, __LINE__, in_key, strval);
snprintf(sql, MAX_BUF_LEN, "INSERT OR REPLACE INTO vconf ( layer, key, value ) "
- "VALUES ( \"%s\", ?, ?);", "system");
+ "VALUES ( \"%s\", ?, ?);", "system");
rc = sqlite3_prepare(db, sql, strlen(sql), &stmt, 0);
if (rc != SQLITE_OK) {
{
int rc;
char sql[MAX_BUF_LEN + 1];
- char* str = NULL;
+ char *str = NULL;
LOG_D(stdout, "[%s][%d] start! key [%s] \n", __func__, __LINE__, in_key);
count++;
usleep(1000000);
-
} else {
break;
}
}
LOG_D(stdout, "[%s][%d] vconf get: layer[%s] key[%s], value[%s]\n",
- __func__, __LINE__,
- sqlite3_column_text(stmt, 0),
- sqlite3_column_text(stmt, 1),
- sqlite3_column_text(stmt, 2));
+ __func__, __LINE__,
+ sqlite3_column_text(stmt, 0),
+ sqlite3_column_text(stmt, 1),
+ sqlite3_column_text(stmt, 2));
str = (char*)malloc(MAX_BUF_LEN + 1);
strncpy(str, (char*)sqlite3_column_text(stmt, 2), MAX_BUF_LEN);
{
LOG_D(stdout, "[%s][%d] start!\n", __func__, __LINE__);
- char* value = vconf_get_str(in_key);
+ char *value = vconf_get_str(in_key);
if (value == NULL)
return VCONF_ERROR;
{
LOG_D(stdout, "[%s][%d] start! key [%s] \n", __func__, __LINE__, in_key);
- char* value = vconf_get_str(in_key);
+ char *value = vconf_get_str(in_key);
if (value == NULL) {
LOG_E(stdout, "[%s][%d] value is NULL! \n", __func__, __LINE__);
{
LOG_D(stdout, "[%s][%d] start!\n", __func__, __LINE__);
- char* value = vconf_get_str(in_key);
+ char *value = vconf_get_str(in_key);
char *ptr;
if (value == NULL)
}
API int vconf_notify_key_changed(const char *in_key, vconf_callback_fn cb,
- void *user_data)
+ void *user_data)
{
string str;
str = in_key;
#ifdef __cplusplus
}
#endif
-
-
#include <string.h>
#include <system_settings.h>
+#include "sst.h"
#include "sys_settings_test_fw.h"
void unit_test_callback0(system_settings_key_e key, void *user_data) { }
#include "sys_settings_test.h"
-void add_test_func(char * test_name, GTestFunc func_pointer);
+void add_test_func(char *test_name, GTestFunc func_pointer);
void unittest_api();
#ifndef SYS_SETTINGS_TEST_DIR
FILE(GLOB UTILS_SRCS *.c)
-PKG_CHECK_MODULES(utils_pkgs REQUIRED dlog vconf fontconfig libxml-2.0 pkgmgr pkgmgr-info libsystemd)
+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})
} e_libs;
typedef struct _eext_libs {
- bool(*d_eext_config_font_set)(char *name, int size);
+ bool (*d_eext_config_font_set)(char *name, int size);
} ex_libs;
#include <errno.h>
#include <time.h>
#include <locale.h>
-
#include <regex.h>
-
-#include <dlog.h>
#include <vconf.h>
-
#include <glib.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#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"
void *d_evas_handle = NULL;
void *d_efl_eext_handle = NULL;
-
-
#define DYM_FUNC_LOADING(error, handle, pfunc, func_name) do { \
pfunc = (void*)dlsym(handle, func_name); \
if ((error = dlerror()) != NULL) { \
- SETTING_TRACE("ERROR!! canNOT find %s function at %s", func_name, #handle); \
+ SST_SECURE_TRACE("ERROR!! canNOT find %s function at %s", func_name, #handle); \
if (handle) \
dlclose(handle); \
return false; \
if (!d_font_handle) {
d_font_handle = dlopen(SETTING_FONT_CONFIG_SO_PATH, RTLD_LAZY);
if (!d_font_handle) {
- SETTING_TRACE("ERROR!! canNOT find "SETTING_FONT_CONFIG_SO_PATH);
+ SST_SECURE_TRACE("ERROR!! canNOT find "SETTING_FONT_CONFIG_SO_PATH);
return false;
}
}
if (!d_ecore_evas_handle) {
d_ecore_evas_handle = dlopen(SETTING_ECORE_EVAS_SO_PATH, RTLD_LAZY);
if (!d_ecore_evas_handle) {
- SETTING_TRACE("ERROR!! canNOT find "SETTING_ECORE_EVAS_SO_PATH" %s", dlerror());
+ SST_SECURE_TRACE("ERROR!! canNOT find "SETTING_ECORE_EVAS_SO_PATH" %s", dlerror());
return false;
}
if (!d_evas_handle) {
d_evas_handle = dlopen(SETTING_EVAS_SO_PATH, RTLD_LAZY);
if (!d_evas_handle) {
- SETTING_TRACE("ERROR!! canNOT find "SETTING_EVAS_SO_PATH" %s", dlerror());
+ SST_SECURE_TRACE("ERROR!! canNOT find "SETTING_EVAS_SO_PATH" %s", dlerror());
return false;
}
}
if (!d_efl_eext_handle) {
d_efl_eext_handle = dlopen(SETTING_EFL_EXTENSION_SO_PATH, RTLD_LAZY);
if (!d_efl_eext_handle) {
- SETTING_TRACE("ERROR!! canNOT find "SETTING_EFL_EXTENSION_SO_PATH" %s", dlerror());
+ SST_SECURE_TRACE("ERROR!! canNOT find "SETTING_EFL_EXTENSION_SO_PATH" %s", dlerror());
return false;
}
}
}
/* Returned family name should be free'd manually. */
-char *__get_main_font_family_name_by_alias(char *alias)
+char* __get_main_font_family_name_by_alias(char *alias)
{
- SETTING_TRACE_BEGIN;
FcFontSet *set = NULL;
FcPattern *pat = NULL;
FcConfig *font_config = NULL;
return ret;
}
- pat = font_libs.d_FcPatternBuild(0, FC_FAMILY, FcTypeString, alias, (char *)0);
+ pat = font_libs.d_FcPatternBuild(0, FC_FAMILY, FcTypeString, alias, (char*)0);
if (pat == NULL) {
if (font_config != NULL) {
if (set != NULL && (set->nfont > 0)) {
font_libs.d_FcPatternGetString(set->fonts[0], FC_FAMILY, 0, &family);
- ret = g_strdup((char *)family);
+ ret = g_strdup((char*)family);
font_libs.d_FcFontSetDestroy(set);
set = NULL;
return ret;
}
-/* LCOV_EXCL_START */
API bool __is_supported_image_type_load(char *path)
{
- SETTING_TRACE_BEGIN;
e_libs efl_libs;
if (!loading_dym_efl(&efl_libs)) {
- SETTING_TRACE("ERROR!! canNOT loading efl!!");
+ SST_SECURE_TRACE("ERROR!! canNOT loading efl!!");
return false;
}
bool result = false;
if (ret == 0) {
- SETTING_TRACE("%s - OK", path);
+ SST_SECURE_TRACE("%s - OK", path);
result = true;
} else {
- SETTING_TRACE("%s - NO", path);
+ SST_SECURE_TRACE("%s - NO", path);
result = false;
}
efl_libs.d_ecore_evas_free(ee);
close_dym_efl();
return result;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
API void font_config_set_notification()
{
- SETTING_TRACE_BEGIN;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
API int __is_available_font(char *font_name)
{
- SETTING_TRACE_BEGIN;
FcObjectSet *os = NULL;
FcFontSet *fs = NULL;
FcPattern *pat = NULL;
FcConfig *font_config = NULL;
int ret = 0;
- f_libs font_libs = { 0 };
+ f_libs font_libs = {0};
if (!loading_dym_font(&font_libs))
return -1;
pat = font_libs.d_FcPatternCreate();
- os = font_libs.d_FcObjectSetBuild(FC_FAMILY, FC_FILE, FC_FAMILYLANG, (char *)0);
+ os = font_libs.d_FcObjectSetBuild(FC_FAMILY, FC_FILE, FC_FAMILYLANG, (char*)0);
if (os) {
fs = font_libs.d_FcFontList(font_config, pat, os);
if (fs) {
int j;
- SETTING_TRACE("fs->nfont = %d", fs->nfont);
+ SST_SECURE_TRACE("fs->nfont = %d", fs->nfont);
for (j = 0; j < fs->nfont; j++) {
FcChar8 *family = NULL;
int preload_path_len = strlen(SETTING_FONT_PRELOAD_FONT_PATH);
int download_path_len = strlen(SETTING_FONT_DOWNLOADED_FONT_PATH);
- if (file && (!strncmp((const char *)file, SETTING_FONT_PRELOAD_FONT_PATH, preload_path_len)
- || !strncmp((const char *)file, SETTING_FONT_DOWNLOADED_FONT_PATH, download_path_len))) {
+ if (file && (!strncmp((const char*)file, SETTING_FONT_PRELOAD_FONT_PATH, preload_path_len)
+ || !strncmp((const char*)file, SETTING_FONT_DOWNLOADED_FONT_PATH, download_path_len))) {
char *family_result = NULL;
FcChar8 *lang = NULL;
int id = 0;
break;
if (font_libs.d_FcPatternGetString(fs->fonts[j], FC_FAMILYLANG, id, &lang) != FcResultMatch)
break;
- family_result = (char *)family;
+ family_result = (char*)family;
/* Find proper family name for current locale. */
while (locale && family && lang) {
- if (!strncmp(locale, (char *)lang, strlen((char *)lang))) {
- family_result = (char *)family;
+ if (!strncmp(locale, (char*)lang, strlen((char*)lang))) {
+ family_result = (char*)family;
break;
}
/* I will set english as default family language. */
/* If there is no proper family language for current locale, */
/* we have to show the english family name. */
- if (!strcmp((char *)lang, (char *)"en"))
- family_result = (char *)family;
+ if (!strcmp((char*)lang, (char*)"en"))
+ family_result = (char*)family;
id++;
if (font_libs.d_FcPatternGetString(fs->fonts[j], FC_FAMILY, id, &family) != FcResultMatch)
}
if (family_result) {
- SETTING_TRACE("-------- FONT - family_result = %s", (char *)family_result);
+ SST_SECURE_TRACE("-------- FONT - family_result = %s", (char*)family_result);
if (strcmp(family_result, font_name) == 0) {
ret = 1;
break;
DYM_CLOSE_HANDLE(d_font_handle);
return ret;
}
-/* LCOV_EXCL_STOP */
-
-API 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 */
API bool font_config_set(char *font_name)
{
- SETTING_TRACE_BEGIN;
ex_libs eext_libs;
if (!loading_dym_efl_eext(&eext_libs))
return false;
DYM_CLOSE_HANDLE(d_efl_eext_handle);
return ret;
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
API void __font_size_set()
{
- SETTING_TRACE_BEGIN;
ex_libs eext_libs;
if (!loading_dym_efl_eext(&eext_libs))
return;
DYM_CLOSE_HANDLE(d_efl_eext_handle);
free(font_name);
}
-/* LCOV_EXCL_STOP */
-/* LCOV_EXCL_START */
static int __font_size_get()
{
- SETTING_TRACE_BEGIN;
int font_size = -1;
int vconf_value = -1;