Update documents and rename get default service API 93/252993/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 3 Feb 2021 23:40:41 +0000 (08:40 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 3 Feb 2021 23:40:41 +0000 (08:40 +0900)
Add the missing privilege for setter APIs and rename as
ua_service_get_default_service -> ua_get_default_service

Change-Id: Idfb55c767e11c5a26840fdca3b143d9806ecb889
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
include/user-awareness.h
src/user-awareness-service.c
test/uat-service.c

index 996fb0b50a172c4a19562ddd9313eccb276480ad..c068269dcabb6963eceff908b9e0d4abc11aff0e 100755 (executable)
@@ -97,6 +97,58 @@ int ua_foreach_services(
                ua_service_added_cb foreach_cb,
                void *user_data);
 
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Gets default service handle.
+ * @since_tizen 6.5
+ *
+ * @remarks The @a service_handle is managed by the platform and will be released
+ *             when #ua_deinitialize() is called.
+ *
+ * @param[out] service_handle The service handle
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UA_ERROR_NONE Successful
+ * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #UA_ERROR_OPERATION_FAILED Operation failed
+ * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_service_get_name()
+ * @see ua_service_set_name()
+ */
+int ua_get_default_service(
+               ua_service_h * service_handle);
+
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Gets service handle by service name.
+ * @since_tizen 6.5
+ *
+ * @remarks The @a service_handle should be destroyed by using #ua_service_destroy().
+ *
+ * @param[in] name The service name information
+ * @param[out] service_handle The service handle
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UA_ERROR_NONE Successful
+ * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #UA_ERROR_OPERATION_FAILED Operation failed
+ * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_service_create()
+ */
+int ua_get_service_by_name(
+                       const char *name,
+                       ua_service_h *service_handle);
+
 /**
  * @ingroup CAPI_NETWORK_UA_MODULE
  * @brief Creates the ua monitor's handle.
@@ -851,58 +903,6 @@ int ua_service_update(
 int ua_service_remove(
                ua_service_h service_handle);
 
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets default service handle.
- * @since_tizen 6.5
- *
- * @remarks The @a service_handle is managed by the platform and will be released
- *             when #ua_deinitialize() is called.
- *
- * @param[out] service_handle The service handle
- *
- * @return 0 on success, otherwise a negative error value
- * @retval #UA_ERROR_NONE Successful
- * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #UA_ERROR_OPERATION_FAILED Operation failed
- * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_service_get_name()
- * @see ua_service_set_name()
- */
-int ua_service_get_default_service(
-               ua_service_h * service_handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets service handle by service name.
- * @since_tizen 6.5
- *
- * @remarks The @a service_handle should be destroyed by using #ua_service_destroy().
- *
- * @param[in] name The service name information
- * @param[out] service_handle The service handle
- *
- * @return 0 on success, otherwise a negative error value
- * @retval #UA_ERROR_NONE Successful
- * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #UA_ERROR_OPERATION_FAILED Operation failed
- * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_service_create()
- */
-int ua_get_service_by_name(
-                       const char *name,
-                       ua_service_h *service_handle);
-
 /**
  * @ingroup CAPI_NETWORK_UA_MODULE
  * @brief Gets name info for service handle.
@@ -956,6 +956,8 @@ int ua_service_set_detection_threshold(
  * @ingroup CAPI_NETWORK_UA_MODULE
  * @brief Gets detection threshold for service handle.
  * @since_tizen 6.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/userawareness
  *
  * @param[in] service_handle The service handle
  * @param[out] presence_threshold The service presence threshold information
@@ -963,6 +965,7 @@ int ua_service_set_detection_threshold(
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #UA_ERROR_NONE Successful
+ * @retval #UA_ERROR_PERMISSION_DENIED Permission Denied
  * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
  *
@@ -1061,6 +1064,8 @@ int ua_service_remove_user(
  * @ingroup CAPI_NETWORK_UA_MODULE
  * @brief Sets device discriminant for a specific service.
  * @since_tizen 6.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/userawareness
  *
  * @param[in] service_handle The service handle.
  * @param[in] device_handle The device handle.
@@ -1068,6 +1073,7 @@ int ua_service_remove_user(
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #UA_ERROR_NONE Successful
+ * @retval #UA_ERROR_PERMISSION_DENIED Permission Denied
  * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
  *
@@ -1219,12 +1225,15 @@ int ua_device_get_mac_type(
  * @ingroup CAPI_NETWORK_UA_MODULE
  * @brief Sets device's operating system info.
  * @since_tizen 6.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/userawareness
  *
  * @param[in] device_handle The device handle
  * @param[in] os The device's operating system.
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #UA_ERROR_NONE Successful
+ * @retval #UA_ERROR_PERMISSION_DENIED Permission Denied
  * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
  *
@@ -1307,12 +1316,15 @@ int ua_device_get_device_id(
  * @ingroup CAPI_NETWORK_UA_MODULE
  * @brief Sets device's Wi-Fi BSSID.
  * @since_tizen 6.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/userawareness
  *
  * @param[in] device_handle The device handle
  * @param[in] bssid  The device's Wi-Fi BSSID.
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #UA_ERROR_NONE Successful
+ * @retval #UA_ERROR_PERMISSION_DENIED Permission Denied
  * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
  *
@@ -1352,12 +1364,15 @@ int ua_device_get_wifi_bssid(
  * @ingroup CAPI_NETWORK_UA_MODULE
  * @brief Sets device's Wi-Fi IPv4 address.
  * @since_tizen 6.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/userawareness
  *
  * @param[in] device_handle The device handle
  * @param[in] ipv4_address The device's wifi IPv4 address.
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #UA_ERROR_NONE Successful
+ * @retval #UA_ERROR_PERMISSION_DENIED Permission Denied
  * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
  *
index acca08a7d8404f6b948d84dc1dac0afc258cb569..a21710dba2b73e1ba2543f6880f79f5f51e3fdb4 100755 (executable)
@@ -554,7 +554,7 @@ int ua_service_get_detection_threshold(ua_service_h service_handle,
        return UA_ERROR_NONE;
 }
 
-int ua_service_get_default_service(ua_service_h* service_handle)
+int ua_get_default_service(ua_service_h* service_handle)
 {
        FUNC_ENTRY;
        int ret;
index 492bb5e705fc3a7cbf8bd3ff2a9e143f3e947edb..ca67a1872219d5dbb3c07bf17adb10597a09b7cc 100755 (executable)
@@ -100,7 +100,7 @@ static void __update_service_info(void)
                        g_service_h = NULL;
                }
 
-               ua_service_get_default_service(&g_service_h);
+               ua_get_default_service(&g_service_h);
        }
 
        ret = ua_service_get_name(g_service_h, &name);
@@ -403,23 +403,23 @@ static int run_ua_service_remove(
        return RET_SUCCESS;
 }
 
-static int run_ua_service_get_default_service(MManager *mm, struct menu_data *menu)
+static int run_ua_get_default_service(MManager *mm, struct menu_data *menu)
 {
        int ret = UA_ERROR_NONE;
 
-       msg("ua_service_get_default_service");
+       msg("ua_get_default_service");
 
        if (g_service_h) {
                ua_service_destroy(g_service_h);
                g_service_h = NULL;
        }
 
-       ret = ua_service_get_default_service(&g_service_h);
+       ret = ua_get_default_service(&g_service_h);
 
        if (UA_ERROR_NONE == ret)
                __update_service_info();
 
-       msg(" - ua_service_get_default_service() ret: [0x%X] [%s]",
+       msg(" - ua_get_default_service() ret: [0x%X] [%s]",
                ret, uat_get_error_str(ret));
 
        return RET_SUCCESS;
@@ -726,8 +726,8 @@ struct menu_data menu_ua_services[] = {
                NULL, run_ua_service_remove, NULL},
        { "6", "ua_service_destroy",
                NULL, run_ua_service_destroy, NULL},
-       { "7", "ua_service_get_default_service",
-               NULL, run_ua_service_get_default_service, NULL },
+       { "7", "ua_get_default_service",
+               NULL, run_ua_get_default_service, NULL },
        { "8", "ua_get_service_by_name",
                menu_ua_get_service_by_name, NULL, NULL },
        { "9", ANSI_COLOR_LIGHTMAGENTA "ua_foreach_services" ANSI_COLOR_NORMAL,