Add ui_service.sticker feature checker 52/213452/4
authorInHong Han <inhong1.han@samsung.com>
Thu, 5 Sep 2019 10:37:54 +0000 (19:37 +0900)
committerInHong Han <inhong1.han@samsung.com>
Fri, 6 Sep 2019 05:50:05 +0000 (14:50 +0900)
Change-Id: I8330e97dcbc204c78b842783e63bd175590cccb6

CMakeLists.txt
client/sticker_data.c
client/sticker_defs.h
consumer/sticker_consumer.c
doc/sticker_doc.h
include/sticker_consumer.h
include/sticker_data.h
include/sticker_error.h
include/sticker_provider.h
packaging/capi-ui-sticker.spec
provider/sticker_provider.c

index 07365cf59789ce7b279ea5eecd00e20b22056e5f..e27150ee36a906c1fbb0d043c1958b445121826f 100755 (executable)
@@ -28,6 +28,7 @@ pkg_check_modules(pkgs REQUIRED
     gio-2.0
     gio-unix-2.0
     dbus-1
+    capi-system-info
 )
 
 ## API ##
index 2603285242660411351716cd1a57f27a772bb8fd..d7c1fb2859c75ecf3717c1d655b53cf2fc5aeea1 100644 (file)
@@ -95,6 +95,8 @@ cleanup:
 
 EXPORT_API int sticker_data_create(sticker_data_h *data_handle)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -124,6 +126,8 @@ cleanup:
 
 EXPORT_API int sticker_data_destroy(sticker_data_h data_handle)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -170,8 +174,9 @@ EXPORT_API int sticker_data_destroy(sticker_data_h data_handle)
 
 EXPORT_API int sticker_data_clone(sticker_data_h origin_handle, sticker_data_h *target_handle)
 {
-    sticker_data_h handle;
+    CHECK_STICKER_FEATURE();
 
+    sticker_data_h handle;
     if (!origin_handle || !target_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -211,6 +216,8 @@ EXPORT_API int sticker_data_clone(sticker_data_h origin_handle, sticker_data_h *
 
 EXPORT_API int sticker_data_get_app_id(sticker_data_h data_handle, char **app_id)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !app_id)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -224,8 +231,9 @@ EXPORT_API int sticker_data_get_app_id(sticker_data_h data_handle, char **app_id
 
 EXPORT_API int sticker_data_set_uri(sticker_data_h data_handle, sticker_data_uri_type_e type, const char *uri)
 {
-    char *file_path = NULL;
+    CHECK_STICKER_FEATURE();
 
+    char *file_path = NULL;
     if (!data_handle || !type || !uri)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -253,6 +261,8 @@ EXPORT_API int sticker_data_set_uri(sticker_data_h data_handle, sticker_data_uri
 
 EXPORT_API int sticker_data_get_uri(sticker_data_h data_handle, sticker_data_uri_type_e *type, char **uri)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !type || !uri)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -267,6 +277,8 @@ EXPORT_API int sticker_data_get_uri(sticker_data_h data_handle, sticker_data_uri
 
 EXPORT_API int sticker_data_foreach_keyword(sticker_data_h data_handle, sticker_data_keyword_foreach_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !callback)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -283,8 +295,9 @@ EXPORT_API int sticker_data_foreach_keyword(sticker_data_h data_handle, sticker_
 
 EXPORT_API int sticker_data_add_keyword(sticker_data_h data_handle, const char *keyword)
 {
-    GList *node;
+    CHECK_STICKER_FEATURE();
 
+    GList *node;
     if (!data_handle || !keyword)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -302,8 +315,9 @@ EXPORT_API int sticker_data_add_keyword(sticker_data_h data_handle, const char *
 
 EXPORT_API int sticker_data_remove_keyword(sticker_data_h data_handle, const char *keyword)
 {
-    GList *node;
+    CHECK_STICKER_FEATURE();
 
+    GList *node;
     if (!data_handle || !keyword)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -321,6 +335,8 @@ EXPORT_API int sticker_data_remove_keyword(sticker_data_h data_handle, const cha
 
 EXPORT_API int sticker_data_set_group_name(sticker_data_h data_handle, const char *group)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !group)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -334,6 +350,8 @@ EXPORT_API int sticker_data_set_group_name(sticker_data_h data_handle, const cha
 
 EXPORT_API int sticker_data_get_group_name(sticker_data_h data_handle, char **group)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !group)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -347,8 +365,9 @@ EXPORT_API int sticker_data_get_group_name(sticker_data_h data_handle, char **gr
 
 EXPORT_API int sticker_data_set_thumbnail(sticker_data_h data_handle, const char *thumbnail)
 {
-    char *file_path = NULL;
+    CHECK_STICKER_FEATURE();
 
+    char *file_path = NULL;
     if (!data_handle || !thumbnail)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -369,6 +388,8 @@ EXPORT_API int sticker_data_set_thumbnail(sticker_data_h data_handle, const char
 
 EXPORT_API int sticker_data_get_thumbnail(sticker_data_h data_handle, char **thumbnail)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !thumbnail)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -382,6 +403,8 @@ EXPORT_API int sticker_data_get_thumbnail(sticker_data_h data_handle, char **thu
 
 EXPORT_API int sticker_data_set_description(sticker_data_h data_handle, const char *description)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !description)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -395,6 +418,8 @@ EXPORT_API int sticker_data_set_description(sticker_data_h data_handle, const ch
 
 EXPORT_API int sticker_data_get_description(sticker_data_h data_handle, char **description)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !description)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -408,6 +433,8 @@ EXPORT_API int sticker_data_get_description(sticker_data_h data_handle, char **d
 
 EXPORT_API int sticker_data_get_date(sticker_data_h data_handle, char **date)
 {
+    CHECK_STICKER_FEATURE();
+
     if (!data_handle || !date)
         return STICKER_ERROR_INVALID_PARAMETER;
 
index 3575ecfb2c9f28fbff8585ea3824592b84ffb272..ce562608f69badd1b986315837f3549cab0715be 100644 (file)
@@ -18,6 +18,8 @@
 #define __TIZEN_UIX_STICKER_DEFS_H__
 
 #include <tzplatform_config.h>
+#include <stdbool.h>
+#include <system_info.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -36,6 +38,17 @@ extern "C" {
 #define STICKER_CONSUMER_INTERFACE_NAME "org.tizen.sticker_consumer"
 
 #define STICKER_PRIVILEGE_MEDIASTORAGE "http://tizen.org/privilege/mediastorage"
+#define STICKER_FEATURE_STICKER         "tizen.org/feature/ui_service.sticker"
+#define CHECK_STICKER_FEATURE()  \
+  do { \
+    bool is_supported = false;  \
+    if (!system_info_get_platform_bool(STICKER_FEATURE_STICKER, &is_supported)) {  \
+      if (is_supported == false) {  \
+        LOGE("ui_service.sticker feature not supported");  \
+        return STICKER_ERROR_NOT_SUPPORTED;  \
+      }  \
+    }  \
+  } while (0)
 
 typedef enum {
     STICKER_CLIENT_LIB_NONE,
index 5024e8b4a4a1d9de11dfd49624d38804b8631d50..7b5d544ea5e3cb013c8ad26f13dbe55fbe260db7 100644 (file)
@@ -144,8 +144,9 @@ static int _sticker_check_privilege() {
 
 EXPORT_API int sticker_consumer_create(sticker_consumer_h *consumer_handle)
 {
-    int ret;
+    CHECK_STICKER_FEATURE();
 
+    int ret;
     if (!consumer_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -172,12 +173,13 @@ EXPORT_API int sticker_consumer_create(sticker_consumer_h *consumer_handle)
 
 EXPORT_API int sticker_consumer_destroy(sticker_consumer_h consumer_handle)
 {
-    LOGD("consumer_handle : %p", consumer_handle);
-    int ret;
+    CHECK_STICKER_FEATURE();
 
+    int ret;
     if (!consumer_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
+    LOGD("consumer_handle : %p", consumer_handle);
     ret = sticker_dbus_shutdown(consumer_handle->gdbus_connection, &consumer_handle->server_monitor_id, &consumer_handle->monitor_id);
     if (ret != STICKER_ERROR_NONE) {
         LOGE("Failed to finalize dbus : %d", ret);
@@ -195,6 +197,8 @@ EXPORT_API int sticker_consumer_destroy(sticker_consumer_h consumer_handle)
 
 EXPORT_API int sticker_consumer_data_foreach_all(sticker_consumer_h consumer_handle, int offset, int count, int *result, sticker_consumer_data_foreach_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
     int ret;
     int info_id;
     int sticker_count = 0;
@@ -241,6 +245,8 @@ cleanup:
 
 EXPORT_API int sticker_consumer_data_foreach_by_keyword(sticker_consumer_h consumer_handle, int offset, int count, int *result, const char *keyword, sticker_consumer_data_foreach_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
     int ret;
     int info_id;
     int sticker_count = 0;
@@ -287,6 +293,8 @@ cleanup:
 
 EXPORT_API int sticker_consumer_data_foreach_by_group(sticker_consumer_h consumer_handle, int offset, int count, int *result, const char *group, sticker_consumer_data_foreach_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
        int ret;
     int info_id;
     int sticker_count = 0;
@@ -333,6 +341,8 @@ cleanup:
 
 EXPORT_API int sticker_consumer_data_foreach_by_type(sticker_consumer_h consumer_handle, int offset, int count, int *result, sticker_data_uri_type_e type, sticker_consumer_data_foreach_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
     int ret;
     int info_id;
     int sticker_count = 0;
@@ -379,6 +389,8 @@ cleanup:
 
 EXPORT_API int sticker_consumer_group_list_foreach_all(sticker_consumer_h consumer_handle, sticker_consumer_group_list_foreach_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
     int ret;
     GList *list = NULL;
 
@@ -405,6 +417,8 @@ cleanup:
 
 EXPORT_API int sticker_consumer_keyword_list_foreach_all(sticker_consumer_h consumer_handle, sticker_consumer_keyword_list_foreach_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
     int ret;
     GList *list = NULL;
 
index 1930f258da3ed393b9ff324b5e4da9667f605af0..f791a09bb19c0b64cb94d62dcd04c215ae5cd2c2 100644 (file)
  *
  * @section CAPI_UIX_STICKER_MODULE_OVERVIEW Overview
  * Using sticker library, a sticker application can provide sticker information to applications that want to read the sticker information as the standard specification.
+ *
+ * @section CAPI_UIX_STICKER_MODULE_FEATURE Related Feature
+ * This API is related with the following feature:\n
+ *  - http://tizen.org/feature/ui_service.sticker
+ *
+ * It is recommended to design feature related codes in your application for reliability.\n
+ * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
+ * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
+ * More details on featuring your application can be found from <a href="https://developer.tizen.org/development/tizen-studio/native-tools/configuring-your-app/manifest-text-editor#feature"><b>Feature Element</b>.</a>
+ *
  */
 
 
index 2dfe76c3ecbe8c318817a1800e0119ea4e960128..08050a86de580263f34f61ccd06ebd1404954522 100644 (file)
@@ -97,6 +97,7 @@ typedef void (*sticker_consumer_keyword_list_foreach_cb)(const char *keyword, vo
  * @retval #STICKER_ERROR_PERMISSION_DENIED Permission denied
  * @retval #STICKER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_consumer_destroy()
  */
 int sticker_consumer_create(sticker_consumer_h *consumer_handle);
@@ -109,6 +110,7 @@ int sticker_consumer_create(sticker_consumer_h *consumer_handle);
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_consumer_create()
  */
 int sticker_consumer_destroy(sticker_consumer_h consumer_handle);
@@ -129,6 +131,7 @@ int sticker_consumer_destroy(sticker_consumer_h consumer_handle);
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @post This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
  * @see sticker_consumer_data_foreach_cb()
  */
@@ -151,6 +154,7 @@ int sticker_consumer_data_foreach_all(sticker_consumer_h consumer_handle, int of
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @post This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
  * @see sticker_consumer_data_foreach_cb()
  */
@@ -173,6 +177,7 @@ int sticker_consumer_data_foreach_by_keyword(sticker_consumer_h consumer_handle,
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @post This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
  * @see sticker_consumer_data_foreach_cb()
  */
@@ -195,6 +200,7 @@ int sticker_consumer_data_foreach_by_group(sticker_consumer_h consumer_handle, i
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @post This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
  * @see sticker_consumer_data_foreach_cb()
  */
@@ -210,6 +216,7 @@ int sticker_consumer_data_foreach_by_type(sticker_consumer_h consumer_handle, in
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @post This function invokes sticker_consumer_group_list_foreach_cb() repeatedly for getting data.
  * @see sticker_consumer_group_list_foreach_cb()
  */
@@ -225,6 +232,7 @@ int sticker_consumer_group_list_foreach_all(sticker_consumer_h consumer_handle,
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @post This function invokes sticker_consumer_keyword_list_foreach_cb() repeatedly for getting data.
  * @see sticker_consumer_keyword_list_foreach_cb()
  */
index b0d4db71f1227a75e554269963e103cae9e1be56..ff72553217f328ad22129aa41135b3c07ee0088a 100644 (file)
@@ -71,6 +71,7 @@ typedef void (*sticker_data_keyword_foreach_cb)(const char *keyword, void *user_
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_destroy()
  */
 int sticker_data_create(sticker_data_h *data_handle);
@@ -82,6 +83,7 @@ int sticker_data_create(sticker_data_h *data_handle);
  * @return 0 on success, otherwise a negative error value
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_create()
  */
 int sticker_data_destroy(sticker_data_h data_handle);
@@ -96,6 +98,7 @@ int sticker_data_destroy(sticker_data_h data_handle);
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_destroy()
  */
 int sticker_data_clone(sticker_data_h origin_handle, sticker_data_h *target_handle);
@@ -110,6 +113,7 @@ int sticker_data_clone(sticker_data_h origin_handle, sticker_data_h *target_hand
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  */
 int sticker_data_get_app_id(sticker_data_h data_handle, char **app_id);
 
@@ -125,6 +129,7 @@ int sticker_data_get_app_id(sticker_data_h data_handle, char **app_id);
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_get_uri()
  */
 int sticker_data_set_uri(sticker_data_h data_handle, sticker_data_uri_type_e type, const char *uri);
@@ -140,6 +145,7 @@ int sticker_data_set_uri(sticker_data_h data_handle, sticker_data_uri_type_e typ
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_set_uri()
  */
 int sticker_data_get_uri(sticker_data_h data_handle, sticker_data_uri_type_e *type, char **uri);
@@ -154,6 +160,7 @@ int sticker_data_get_uri(sticker_data_h data_handle, sticker_data_uri_type_e *ty
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @post This function invokes sticker_data_keyword_foreach_cb() repeatedly for getting keywords.
  * @see sticker_data_keyword_foreach_cb()
  * @see sticker_data_add_keyword()
@@ -170,6 +177,7 @@ int sticker_data_foreach_keyword(sticker_data_h data_handle, sticker_data_keywor
  * @return 0 on success, otherwise a negative error value
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_keyword_foreach_cb()
  * @see sticker_data_foreach_keyword()
  * @see sticker_data_remove_keyword()
@@ -185,6 +193,7 @@ int sticker_data_add_keyword(sticker_data_h data_handle, const char *keyword);
  * @return 0 on success, otherwise a negative error value
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_keyword_foreach_cb()
  * @see sticker_data_foreach_keyword()
  * @see sticker_data_add_keyword()
@@ -200,6 +209,7 @@ int sticker_data_remove_keyword(sticker_data_h data_handle, const char *keyword)
  * @return 0 on success, otherwise a negative error value
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_get_group()
  */
 int sticker_data_set_group_name(sticker_data_h data_handle, const char *group);
@@ -214,6 +224,7 @@ int sticker_data_set_group_name(sticker_data_h data_handle, const char *group);
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_set_group()
  */
 int sticker_data_get_group_name(sticker_data_h data_handle, char **group);
@@ -228,6 +239,7 @@ int sticker_data_get_group_name(sticker_data_h data_handle, char **group);
  * @return 0 on success, otherwise a negative error value
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_get_thumbnail()
  */
 int sticker_data_set_thumbnail(sticker_data_h data_handle, const char *thumbnail);
@@ -242,6 +254,7 @@ int sticker_data_set_thumbnail(sticker_data_h data_handle, const char *thumbnail
  * @return 0 on success, otherwise a negative error value
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_set_thumbnail()
  */
 int sticker_data_get_thumbnail(sticker_data_h data_handle, char **thumbnail);
@@ -255,6 +268,7 @@ int sticker_data_get_thumbnail(sticker_data_h data_handle, char **thumbnail);
  * @return 0 on success, otherwise a negative error value
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_get_description()
  */
 int sticker_data_set_description(sticker_data_h data_handle, const char *description);
@@ -269,6 +283,7 @@ int sticker_data_set_description(sticker_data_h data_handle, const char *descrip
  * @return 0 on success, otherwise a negative error value
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_data_set_description()
  */
 int sticker_data_get_description(sticker_data_h data_handle, char **description);
@@ -284,6 +299,7 @@ int sticker_data_get_description(sticker_data_h data_handle, char **description)
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  */
 int sticker_data_get_date(sticker_data_h data_handle, char **date);
 
index 049ab05cf814e3f7d495b39da031164d0cd7592b..a3abd3b6a7d9c9f8969c16e64d191e23a881ba45 100644 (file)
@@ -43,6 +43,7 @@ typedef enum {
     STICKER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
     STICKER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
     STICKER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+    STICKER_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
     STICKER_ERROR_OPERATION_FAILED = TIZEN_ERROR_STICKER | 0x0001, /**< Operation failed */
 } sticker_error_e;
 
index 01ed6e047d30d6026c04b7e795806a3adf3d8893..f85c8d039daad0e2a231ce8d2274f069b415d971 100644 (file)
@@ -76,6 +76,7 @@ typedef void (*sticker_provider_insert_finished_cb)(sticker_error_e error, void
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_provider_destroy()
  */
 int sticker_provider_create(sticker_provider_h *provider_handle);
@@ -88,6 +89,7 @@ int sticker_provider_create(sticker_provider_h *provider_handle);
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_provider_create()
  */
 int sticker_provider_destroy(sticker_provider_h provider_handle);
@@ -104,6 +106,7 @@ int sticker_provider_destroy(sticker_provider_h provider_handle);
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_provider_update_data()
  * @see sticker_provider_delete_data()
  */
@@ -125,6 +128,7 @@ int sticker_provider_insert_data(sticker_provider_h provider_handle, sticker_dat
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @post This function invokes sticker_provider_insert_finished_cb().
  * @see sticker_provider_insert_finished_cb()
  *
@@ -168,6 +172,7 @@ int sticker_privider_insert_data_by_json_file(sticker_provider_h provider_handle
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_provider_insert_data()
  * @see sticker_provider_delete_data()
  */
@@ -183,6 +188,7 @@ int sticker_provider_update_data(sticker_provider_h provider_handle, sticker_dat
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @see sticker_provider_insert_data()
  * @see sticker_provider_update_data()
  */
@@ -197,6 +203,7 @@ int sticker_provider_delete_data(sticker_provider_h provider_handle, sticker_dat
  * @retval #STICKER_ERROR_NONE Successful
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  */
 int sticker_provider_get_sticker_count(sticker_provider_h provider_handle, int *count);
 
@@ -216,6 +223,7 @@ int sticker_provider_get_sticker_count(sticker_provider_h provider_handle, int *
  * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #STICKER_ERROR_OUT_OF_MEMORY Out of memory
  * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
+ * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
  * @post This function invokes sticker_provider_data_foreach_cb() repeatedly for getting data.
  * @see sticker_provider_data_foreach_cb()
  */
index 45d4ec58ff42062edf11e9ed1ddf032a7f91bf55..1a94b616b40a02b8c6a7981119681ef4c89a7fa5 100644 (file)
@@ -9,19 +9,20 @@ Source1:    capi-ui-sticker.service
 Source2:    org.tizen.sticker.server.service
 Source3:    capi-ui-sticker.conf
 BuildRequires:  cmake, coreutils
-BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(libtzplatform-config)
-BuildRequires:  pkgconfig(cynara-client)
-BuildRequires:  pkgconfig(cynara-session)
 BuildRequires:  pkgconfig(capi-appfw-app-common)
 BuildRequires:  pkgconfig(capi-appfw-package-manager)
+BuildRequires:  pkgconfig(capi-system-info)
+BuildRequires:  pkgconfig(cynara-client)
+BuildRequires:  pkgconfig(cynara-session)
 BuildRequires:  pkgconfig(dbus-1)
-BuildRequires:  pkgconfig(sqlite3)
-BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(json-glib-1.0)
+BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  pkgconfig(gio-unix-2.0)
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(json-glib-1.0)
+BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(pkgmgr-info)
+BuildRequires:  pkgconfig(sqlite3)
 Requires:       security-config
 Requires(post): /sbin/ldconfig
 Requires(post): dbus
index f600adbd48b3fca1b7fecf65525dce55f819c906..7eb7ec3becbe0debc19bb49500ab9af06e3de323 100644 (file)
@@ -73,8 +73,9 @@ static void _free_sticker_data(sticker_data_h sticker_data)
 
 EXPORT_API int sticker_provider_create(sticker_provider_h *provider_handle)
 {
-    int ret;
+    CHECK_STICKER_FEATURE();
 
+    int ret;
     if (!provider_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -98,12 +99,13 @@ EXPORT_API int sticker_provider_create(sticker_provider_h *provider_handle)
 
 EXPORT_API int sticker_provider_destroy(sticker_provider_h provider_handle)
 {
-    LOGD("provider_handle : %p", provider_handle);
-    int ret;
+    CHECK_STICKER_FEATURE();
 
+    int ret;
     if (!provider_handle)
         return STICKER_ERROR_INVALID_PARAMETER;
 
+    LOGD("provider_handle : %p", provider_handle);
     ret = sticker_dbus_shutdown(provider_handle->gdbus_connection, &provider_handle->server_monitor_id, &provider_handle->monitor_id);
     if (ret != STICKER_ERROR_NONE) {
         LOGE("Failed to finalize dbus : %d", ret);
@@ -121,8 +123,9 @@ EXPORT_API int sticker_provider_destroy(sticker_provider_h provider_handle)
 
 EXPORT_API int sticker_provider_insert_data(sticker_provider_h provider_handle, sticker_data_h data_handle)
 {
-    int ret;
+    CHECK_STICKER_FEATURE();
 
+    int ret;
     if (!provider_handle || !data_handle || (data_handle->sticker_info_id > 0))
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -137,6 +140,8 @@ EXPORT_API int sticker_provider_insert_data(sticker_provider_h provider_handle,
 
 EXPORT_API int sticker_privider_insert_data_by_json_file(sticker_provider_h provider_handle, const char *json_path, sticker_provider_insert_finished_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
     int ret;
     char *app_id = NULL;
     package_info_h package_info = NULL;
@@ -217,8 +222,9 @@ cleanup:
 
 EXPORT_API int sticker_provider_update_data(sticker_provider_h provider_handle, sticker_data_h data_handle)
 {
-    int ret;
+    CHECK_STICKER_FEATURE();
 
+    int ret;
     if (!provider_handle || !data_handle || (data_handle->sticker_info_id <= 0))
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -233,8 +239,9 @@ EXPORT_API int sticker_provider_update_data(sticker_provider_h provider_handle,
 
 EXPORT_API int sticker_provider_delete_data(sticker_provider_h provider_handle, sticker_data_h data_handle)
 {
-    int ret;
+    CHECK_STICKER_FEATURE();
 
+    int ret;
     if (!provider_handle || (data_handle->sticker_info_id <= 0))
         return STICKER_ERROR_INVALID_PARAMETER;
 
@@ -249,6 +256,8 @@ EXPORT_API int sticker_provider_delete_data(sticker_provider_h provider_handle,
 
 EXPORT_API int sticker_provider_get_sticker_count(sticker_provider_h provider_handle, int *count)
 {
+    CHECK_STICKER_FEATURE();
+
     int ret;
     char *app_id = NULL;
 
@@ -277,6 +286,8 @@ cleanup:
 
 EXPORT_API int sticker_provider_data_foreach_all(sticker_provider_h provider_handle, int offset, int count, int *result, sticker_provider_data_foreach_cb callback, void *user_data)
 {
+    CHECK_STICKER_FEATURE();
+
     int ret;
     int info_id;
     int sticker_count = 0;