From c2cbce38315cc45bf55cc7a35960e3e6e51d630c Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Thu, 3 Aug 2017 16:45:41 +0900 Subject: [PATCH] Add feature check code for download feature Change-Id: I3b2b0b3ec897d5956957aa30970cb978ac190d4c --- CMakeLists.txt | 3 +- doc/download_doc.h | 1 + include/download_private.h | 77 ++++++++++++++++++++++++ packaging/capi-web-url-download.spec | 4 +- src/download-private.c | 55 +++++++++++++++++ src/download-wrapping.c | 112 ++++++++++++++++------------------- 6 files changed, 189 insertions(+), 63 deletions(-) create mode 100644 include/download_private.h create mode 100755 src/download-private.c diff --git a/CMakeLists.txt b/CMakeLists.txt index b62431f..7459acd 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ ADD_DEFINITIONS(-DDP_SUPPORT_DBUS_ACTIVATION) SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}") -SET(SOURCES src/download-wrapping.c) +SET(SOURCES src/download-wrapping.c src/download-private.c) MESSAGE(STATUS "SOURCES : ${SOURCES}") ADD_LIBRARY(${fw_name} SHARED ${SOURCES}) @@ -47,6 +47,7 @@ SET_TARGET_PROPERTIES(${fw_name} PROPERTIES SOVERSION ${VERSION_MAJOR}) INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR}) INSTALL(FILES ${INC_DIR}/download.h DESTINATION include/web/) INSTALL(FILES ${INC_DIR}/download_product.h DESTINATION include/web/) +INSTALL(FILES ${INC_DIR}/download_private.h DESTINATION include/web/) INSTALL(FILES ${DOC_DIR}/download_doc.h DESTINATION include/web/) SET(PC_NAME ${fw_name}) diff --git a/doc/download_doc.h b/doc/download_doc.h index 38c8acf..d5726b3 100644 --- a/doc/download_doc.h +++ b/doc/download_doc.h @@ -37,6 +37,7 @@ * * @section CAPI_WEB_DOWNLOAD_MODULE_FEATURE Related Features * This API is related with the following features:\n + * - http://tizen.org/feature/download\n * - http://tizen.org/feature/network.telephony\n * - http://tizen.org/feature/network.wifi\n * - http://tizen.org/feature/network.wifi.direct\n diff --git a/include/download_private.h b/include/download_private.h new file mode 100644 index 0000000..029daa2 --- /dev/null +++ b/include/download_private.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TIZEN_WEB_DOWNLOAD_PRIVATE_H__ +#define __TIZEN_WEB_DOWNLOAD_PRIVATE_H__ + +#include "download.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define DEBUG_MSG +#ifdef DEBUG_MSG +#include +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "TIZEN_N_URL_DOWNLOAD" +#define TRACE_ERROR(format, ARG...) \ + { \ + LOGE(format, ##ARG); \ + } +#define TRACE_STRERROR(format, ARG...) \ + { \ + LOGE(format" [%s]", ##ARG, strerror(errno)); \ + } +#define TRACE_INFO(format, ARG...) \ + { \ + LOGI(format, ##ARG); \ + } +#else +#define TRACE_DEBUG_MSG(format, ARG...) ; +#endif + +#define DOWNLOAD_FEATURE "tizen.org/feature/download" +#define TELEPHONY_FEATURE "tizen.org/feature/network.telephony" +#define WIFI_FEATURE "tizen.org/feature/network.wifi" +#define WIFI_DIRECT_FEATURE "tizen.org/feature/network.wifi.direct" + +typedef enum { + DOWNLOAD_SUPPORTED_FEATURE_DOWNLOAD = 0, + DOWNLOAD_SUPPORTED_FEATURE_TELEPHONY, + DOWNLOAD_SUPPORTED_FEATURE_WIFI, + DOWNLOAD_SUPPORTED_FEATURE_WIFI_DIRECT, + DOWNLOAD_SUPPORTED_FEATURE_MAX +} download_supported_feature_e; + +#define CHECK_FEATURE_SUPPORTED(...) \ + do { \ + int rv = _download_check_feature_supported(__VA_ARGS__, NULL); \ + if (rv != DOWNLOAD_ERROR_NONE) \ + return rv; \ + } while (0) + +int _download_check_feature_supported(const char *feature, ...); + + +#ifdef __cplusplus +} +#endif + +#endif /* __TIZEN_WEB_DOWNLOAD_PRIVATE_H__ */ diff --git a/packaging/capi-web-url-download.spec b/packaging/capi-web-url-download.spec index 44461b0..b4dbfe6 100755 --- a/packaging/capi-web-url-download.spec +++ b/packaging/capi-web-url-download.spec @@ -1,7 +1,7 @@ Name: capi-web-url-download Summary: CAPI for content download with web url -Version: 1.2.9 +Version: 1.2.10 Release: 0 Group: Development/Libraries License: Apache-2.0 @@ -57,5 +57,5 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/capi-web-url-download.pc %{_includedir}/web/download.h %{_includedir}/web/download_product.h +%{_includedir}/web/download_private.h %{_includedir}/web/download_doc.h - diff --git a/src/download-private.c b/src/download-private.c new file mode 100755 index 0000000..bf2f58c --- /dev/null +++ b/src/download-private.c @@ -0,0 +1,55 @@ +#include +#include +#include + +static __thread int feature_supported[DOWNLOAD_SUPPORTED_FEATURE_MAX] = { -1, -1, -1, -1, -1}; + +static bool __check_feature_supported(const char *key, download_supported_feature_e feature) +{ + if (feature_supported[feature] == -1) { + bool value = false; + if (system_info_get_platform_bool(key, &value) < 0) { + TRACE_ERROR("Failed to get system info"); + return false; + } + feature_supported[feature] = (int)value; + } + return (feature_supported[feature] > 0 ? true : false); +} + +int _download_check_feature_supported(const char *feature, ...) +{ + va_list list; + const char *key; + bool value = false; + bool supported = false; + + va_start(list, feature); + key = feature; + + while (1) { + if (strcmp(key, DOWNLOAD_FEATURE) == 0) + value = __check_feature_supported(key, DOWNLOAD_SUPPORTED_FEATURE_DOWNLOAD); + else if (strcmp(key, TELEPHONY_FEATURE) == 0) + value = __check_feature_supported(key, DOWNLOAD_SUPPORTED_FEATURE_TELEPHONY); + else if (strcmp(key, WIFI_FEATURE) == 0) + value = __check_feature_supported(key, DOWNLOAD_SUPPORTED_FEATURE_WIFI); + else if (strcmp(key, WIFI_DIRECT_FEATURE) == 0) + value = __check_feature_supported(key, DOWNLOAD_SUPPORTED_FEATURE_WIFI_DIRECT); + + supported |= value; + key = va_arg(list, const char *); + if (!key) break; + } + + if (!supported) { + TRACE_ERROR("Not supported features"); + set_last_result(DOWNLOAD_ERROR_NOT_SUPPORTED); + va_end(list); + return DOWNLOAD_ERROR_NOT_SUPPORTED; + } + va_end(list); + set_last_result(DOWNLOAD_ERROR_NONE); + + return DOWNLOAD_ERROR_NONE; +} diff --git a/src/download-wrapping.c b/src/download-wrapping.c index 3f7225e..30e618b 100755 --- a/src/download-wrapping.c +++ b/src/download-wrapping.c @@ -7,44 +7,17 @@ #include #include #include -#include -#include #include +#include #include -#define DEBUG_MSG -#ifdef DEBUG_MSG -#include -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "TIZEN_N_URL_DOWNLOAD" -#define TRACE_ERROR(format, ARG...) \ -{ \ -LOGE(format, ##ARG); \ -} -#define TRACE_STRERROR(format, ARG...) \ -{ \ -LOGE(format" [%s]", ##ARG, strerror(errno)); \ -} -#define TRACE_INFO(format, ARG...) \ -{ \ -LOGI(format, ##ARG); \ -} -#else -#define TRACE_DEBUG_MSG(format, ARG...) ; -#endif - -#define TELEPHONY_FEATURE "tizen.org/feature/network.telephony" -#define WIFI_FEATURE "tizen.org/feature/network.wifi" -#define WIFI_DIRECT_FEATURE "tizen.org/feature/network.wifi.direct" - /////////////////////// APIs ///////////////////////////////// int download_create(int *download_id) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (download_id == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_create(download_id); @@ -53,24 +26,28 @@ int download_create(int *download_id) int download_destroy(int download_id) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_destroy(download_id); } int download_start(int download_id) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_start(download_id); } int download_pause(int download_id) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_pause(download_id); } int download_cancel(int download_id) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_cancel(download_id); } @@ -78,6 +55,7 @@ int download_cancel(int download_id) int download_set_url(int download_id, const char *url) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (url == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_set_url(download_id, url); @@ -87,6 +65,7 @@ int download_set_url(int download_id, const char *url) int download_get_url(int download_id, char **url) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (url == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_url(download_id, url); @@ -96,37 +75,15 @@ int download_set_network_type(int download_id, download_network_type_e net_type) { TRACE_INFO(""); - - bool bIsTelephonyFeatureSupported = 0; - bool bIsWifiFeatureSupported = 0; - bool bIsWifiDirectFeatureSupported = 0; - - system_info_get_platform_bool (TELEPHONY_FEATURE, &bIsTelephonyFeatureSupported); - system_info_get_platform_bool (WIFI_FEATURE, &bIsWifiFeatureSupported); - system_info_get_platform_bool (WIFI_DIRECT_FEATURE, &bIsWifiDirectFeatureSupported); - - switch (net_type) { - case DOWNLOAD_NETWORK_DATA_NETWORK: - if (!bIsTelephonyFeatureSupported) { - return DOWNLOAD_ERROR_NOT_SUPPORTED; - } - break; - case DOWNLOAD_NETWORK_WIFI: - if (!bIsWifiFeatureSupported) { - return DOWNLOAD_ERROR_NOT_SUPPORTED; - } - break; - case DOWNLOAD_NETWORK_WIFI_DIRECT: - if (!bIsWifiDirectFeatureSupported) { - return DOWNLOAD_ERROR_NOT_SUPPORTED; - } - break; - case DOWNLOAD_NETWORK_ALL: - if (!bIsTelephonyFeatureSupported && !bIsWifiFeatureSupported && !bIsWifiDirectFeatureSupported) { - return DOWNLOAD_ERROR_NOT_SUPPORTED; - } - break; - } + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); + if (net_type == DOWNLOAD_NETWORK_DATA_NETWORK) + CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE); + else if (net_type == DOWNLOAD_NETWORK_WIFI) + CHECK_FEATURE_SUPPORTED(WIFI_FEATURE); + else if (net_type == DOWNLOAD_NETWORK_WIFI_DIRECT) + CHECK_FEATURE_SUPPORTED(WIFI_DIRECT_FEATURE); + else if (net_type == DOWNLOAD_NETWORK_ALL) + CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, WIFI_DIRECT_FEATURE); return dp_interface_set_network_type(download_id, (int)net_type); } @@ -135,6 +92,7 @@ int download_get_network_type(int download_id, download_network_type_e *net_type) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (net_type == NULL) { TRACE_ERROR("Parameter NULL Check"); @@ -150,6 +108,7 @@ int download_get_network_type(int download_id, int download_set_network_bonding(int download_id, bool enable) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_set_network_bonding(download_id, (int)enable); } @@ -157,6 +116,7 @@ int download_get_network_bonding(int download_id, bool *enable) { int is_set = 0; TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (enable == NULL) { TRACE_ERROR("Parameter NULL Check"); return DOWNLOAD_ERROR_INVALID_PARAMETER; @@ -170,6 +130,7 @@ int download_get_network_bonding(int download_id, bool *enable) int download_set_destination(int download_id, const char *path) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (path == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_set_destination(download_id, path); @@ -179,6 +140,7 @@ int download_set_destination(int download_id, const char *path) int download_get_destination(int download_id, char **path) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (path == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_destination(download_id, path); @@ -187,6 +149,7 @@ int download_get_destination(int download_id, char **path) int download_set_file_name(int download_id, const char *file_name) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (file_name == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_set_file_name(download_id, file_name); @@ -195,6 +158,7 @@ int download_set_file_name(int download_id, const char *file_name) int download_get_file_name(int download_id, char **file_name) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (file_name == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_file_name(download_id, file_name); @@ -203,6 +167,7 @@ int download_get_file_name(int download_id, char **file_name) int download_get_downloaded_file_path(int download_id, char **path) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (path == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_downloaded_file_path(download_id, path); @@ -212,6 +177,7 @@ int download_add_http_header_field(int download_id, const char *field, const char *value) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (field == NULL || value == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return @@ -222,6 +188,7 @@ int download_get_http_header_field(int download_id, const char *field, char **value) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (field == NULL || value == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return @@ -232,6 +199,7 @@ int download_get_http_header_field_list(int download_id, char ***fields, int *length) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (fields == NULL || length == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_http_header_field_list(download_id, fields, @@ -242,6 +210,7 @@ int download_remove_http_header_field(int download_id, const char *field) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (field == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_remove_http_header_field(download_id, field); @@ -252,6 +221,7 @@ int download_set_state_changed_cb(int download_id, download_state_changed_cb callback, void* user_data) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_set_state_changed_cb(download_id, (dp_interface_state_changed_cb)callback, user_data); } @@ -259,6 +229,7 @@ int download_set_state_changed_cb(int download_id, int download_unset_state_changed_cb(int download_id) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_unset_state_changed_cb(download_id); } @@ -267,6 +238,7 @@ int download_set_progress_cb(int download_id, download_progress_cb callback, void *user_data) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_set_progress_cb(download_id, (dp_interface_progress_cb)callback, user_data); } @@ -274,6 +246,7 @@ int download_set_progress_cb(int download_id, int download_unset_progress_cb(int download_id) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_unset_progress_cb(download_id); } @@ -281,6 +254,7 @@ int download_get_state(int download_id, download_state_e *state) { int statecode = 0; TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (state == NULL) { TRACE_ERROR("Parameter NULL Check"); return DOWNLOAD_ERROR_INVALID_PARAMETER; @@ -294,6 +268,7 @@ int download_get_state(int download_id, download_state_e *state) int download_get_temp_path(int download_id, char **temp_path) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (temp_path == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_temp_path(download_id, temp_path); @@ -302,6 +277,7 @@ int download_get_temp_path(int download_id, char **temp_path) int download_get_content_name(int download_id, char **content_name) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (content_name == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_content_name(download_id, content_name); @@ -311,6 +287,7 @@ int download_get_content_size(int download_id, unsigned long long *content_size) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (content_size == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_content_size(download_id, content_size); @@ -319,6 +296,7 @@ int download_get_content_size(int download_id, int download_get_mime_type(int download_id, char **mime_type) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (mime_type == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_mime_type(download_id, mime_type); @@ -327,6 +305,7 @@ int download_get_mime_type(int download_id, char **mime_type) int download_set_auto_download(int download_id, bool enable) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_set_auto_download(download_id, (int)enable); } @@ -334,6 +313,7 @@ int download_get_auto_download(int download_id, bool *enable) { int is_set = 0; TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (enable == NULL) { TRACE_ERROR("Parameter NULL Check"); return DOWNLOAD_ERROR_INVALID_PARAMETER; @@ -348,6 +328,7 @@ int download_get_error(int download_id, download_error_e *error) { int errorcode = 0; TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (error == NULL) { TRACE_ERROR("Parameter NULL Check"); return DOWNLOAD_ERROR_INVALID_PARAMETER; @@ -361,6 +342,7 @@ int download_get_error(int download_id, download_error_e *error) int download_get_http_status(int download_id, int *http_status) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (http_status == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_http_status(download_id, http_status); @@ -369,6 +351,7 @@ int download_get_http_status(int download_id, int *http_status) int download_set_notification_app_control(int download_id, download_notification_app_control_type_e type, app_control_h handle) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (handle == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_set_notification_service_handle(download_id, (int)type, handle); @@ -377,6 +360,7 @@ int download_set_notification_app_control(int download_id, download_notification int download_get_notification_app_control(int download_id, download_notification_app_control_type_e type, app_control_h *handle) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (handle == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_notification_service_handle(download_id, (int)type, (void **)handle); @@ -385,6 +369,7 @@ int download_get_notification_app_control(int download_id, download_notification int download_set_notification_title(int download_id, const char *title) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (title == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_set_notification_title(download_id, title); @@ -393,6 +378,7 @@ int download_set_notification_title(int download_id, const char *title) int download_get_notification_title(int download_id, char **title) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (title == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_notification_title(download_id, title); @@ -401,6 +387,7 @@ int download_get_notification_title(int download_id, char **title) int download_set_notification_description(int download_id, const char *description) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (description == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_set_notification_description(download_id, description); @@ -409,6 +396,7 @@ int download_set_notification_description(int download_id, const char *descripti int download_get_notification_description(int download_id, char **description) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (description == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_notification_description(download_id, description); @@ -417,6 +405,7 @@ int download_get_notification_description(int download_id, char **description) int download_set_notification_type(int download_id, download_notification_type_e type) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); return dp_interface_set_notification_type(download_id, (int)type); } @@ -424,6 +413,7 @@ int download_get_notification_type(int download_id, download_notification_type_e { int noti_type = 0; TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (type == NULL) { TRACE_ERROR("Parameter NULL Check"); return DOWNLOAD_ERROR_INVALID_PARAMETER; @@ -437,6 +427,7 @@ int download_get_notification_type(int download_id, download_notification_type_e int download_get_etag(int download_id, char **etag) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (etag == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_get_etag(download_id, etag); @@ -445,6 +436,7 @@ int download_get_etag(int download_id, char **etag) int download_set_temp_file_path(int download_id, char *path) { TRACE_INFO(""); + CHECK_FEATURE_SUPPORTED(DOWNLOAD_FEATURE); if (path == NULL) return DOWNLOAD_ERROR_INVALID_PARAMETER; return dp_interface_set_temp_file_path(download_id, path); -- 2.7.4