*
* @section CAPI_COMPONENT_MANAGER_MODULE_OVERVIEW Overview
* The @ref CAPI_COMPONENT_MANAGER_MODULE API provides information about components. There are several different sorts of queries.
- * Two iterator functions step through a list of components. One is used in running components(#component_manager_foreach_component_context()), and
- * the other is used in available ("installed") but not necessarily running components(#component_manager_foreach_component_info()).
+ * Two iterator functions step through a list of components. One is used in running components(component_manager_foreach_component_context()), and
+ * the other is used in available ("installed") but not necessarily running components(component_manager_foreach_component_info()).
* Each will call a callback function, passing the package name of each component found.
* A query function will respond whether the component represented by a particular application name is running.
* Other query functions return static information about a component, such as a name, a type, an icon path.
- * The API provides functions to manage components also. By using them, it is possible to resume(#component_manager_resume_component) components.
+ * The API provides functions to manage components also. By using them, it is possible to resume(component_manager_resume_component()) components.
*/
/**
* limitations under the License.
*/
-#ifndef __TIZEN_APPFW_COMPONENT_CONTEXT_H
-#define __TIZEN_APPFW_COMPONENT_CONTEXT_H
+#ifndef __TIZEN_APPFW_COMPONENT_CONTEXT_H__
+#define __TIZEN_APPFW_COMPONENT_CONTEXT_H__
#include <stdbool.h>
#include <sys/types.h>
* @{
*/
+
+/**
+ * @brief Component context handle.
+ * @since_tizen 5.5
+ */
typedef void *component_context_h;
+/**
+ * @brief Enumeration for the component state.
+ * @since_tizen 5.5
+ */
typedef enum {
- COMPONENT_STATE_UNDEFINED,
- COMPONENT_STATE_FOREGROUND,
- COMPONENT_STATE_BACKGROUND,
- COMPONENT_STATE_SERVICE,
- COMPONENT_STATE_TERMINATED,
+ COMPONENT_STATE_UNDEFINED, /**< The undefined state. */
+ COMPONENT_STATE_FOREGROUND, /**< The frame component is running in the foreground. */
+ COMPONENT_STATE_BACKGROUND, /**< The frame component is running in the background. */
+ COMPONENT_STATE_SERVICE, /**< The service component is running. */
+ COMPONENT_STATE_TERMINATED, /**< The component is terminated. */
} component_state_e;
+/**
+ * @brief Destroys the component context handle and releases all its resources.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The component context handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
int component_context_destroy(component_context_h handle);
+/**
+ * @brief Gets the application ID of the component.
+ * @since_tizen 5.5
+ * @remarks You MUST release @c app_id using free().
+ *
+ * @param[in] handle The component context handle
+ * @param[out] app_id The application ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
int component_context_get_app_id(component_context_h handle, char **app_id);
-int component_context_get_comp_id(component_context_h handle, char **comp_id);
+/**
+ * @brief Gets the ID of the component.
+ * @since_tizen 5.5
+ * @remarks You MUST release @c comp_id using free().
+ *
+ * @param[in] handle The component context handle
+ * @param[out] component_id The component ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int component_context_get_component_id(component_context_h handle, char **component_id);
+/**
+ * @brief Gets the instance ID of the component.
+ * @since_tizen 5.5
+ * @remarks You MUST release @c instance_id using free().
+ *
+ * @param[in] handle The component context handle
+ * @param[out] instance_id The instance ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
int component_context_get_instance_id(component_context_h handle, char **instance_id);
+/**
+ * @brief Gets the state of the component.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The component context handle
+ * @param[out] state The component state
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
int component_context_get_component_state(component_context_h handle, component_state_e *state);
+/**
+ * @brief Checks whether the component is terminated or not.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The component context handle
+ * @param[out] terminated @c true if the component is terminated, \n
+ * otherwise @c false if the component is running
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ */
int component_context_is_terminated(component_context_h handle, bool *terminated);
-int component_context_is_sub_comp(component_context_h handle, bool *is_sub_comp);
+/**
+ * @brief Checks whether the component is running as sub component of the group.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The component context handle
+ * @param[out] is_subcomponent @c true if the sub component of the group, \n
+ * otherwise @c false if the main component of the group
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int component_context_is_subcomponent(component_context_h handle, bool *is_subcomponent);
+/**
+ * @brief Clones the component context handle.
+ * @since_tizen 5.5
+ * @remarks The @a clone should be released using component_context_destroy().
+ *
+ * @param[out] clone A newly created component context handle, if cloning is successful
+ * @param[in] handle The component context handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
int component_context_clone(component_context_h *clone, component_context_h handle);
/**
}
#endif
-#endif /* __TIZEN_APPFW_COMPONENT_CONTEXT_H */
+#endif /* __TIZEN_APPFW_COMPONENT_CONTEXT_H__ */
* limitations under the License.
*/
-#ifndef __TIZEN_APPFW_COMPONENT_INFO_H
-#define __TIZEN_APPFW_COMPONENT_INFO_H
+#ifndef __TIZEN_APPFW_COMPONENT_INFO_H__
+#define __TIZEN_APPFW_COMPONENT_INFO_H__
#include <tizen.h>
* @{
*/
+/**
+ * @brief Component information handle.
+ * @since_tizen 5.5
+ */
typedef void *component_info_h;
+/**
+ * @brief Enumeration for component type.
+ * @since_tizen 5.5
+ * @see component_info_get_component_type()
+ */
typedef enum {
- COMPONENT_INFO_COMPONENT_TYPE_FRAME,
- COMPONENT_INFO_COMPONENT_TYPE_SERVICE,
+ COMPONENT_INFO_COMPONENT_TYPE_FRAME, /**< Frame component */
+ COMPONENT_INFO_COMPONENT_TYPE_SERVICE, /**< Service component */
} component_info_component_type_e;
-int component_info_create(const char *comp_id, component_info_h *handle);
+/**
+ * @brief Creates the component information handle.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @remarks The @a handle should be released using component_info_destroy().
+ *
+ * @param[in] component_id The component ID
+ * @param[out] handle The component information handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int component_info_create(const char *component_id, component_info_h *handle);
+/**
+ * @brief Destroys the component information handle.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The component information handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
int component_info_destroy(component_info_h handle);
+/**
+ * @brief Gets the application ID of the component.
+ * @since_tizen 5.5
+ * @remarks You must release @a app_id using free().
+ *
+ * @param[in] handle The component information handle
+ * @param[out] app_id The application ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
int component_info_get_app_id(component_info_h handle, char **app_id);
-int component_info_get_comp_id(component_info_h handle, char **comp_id);
+/**
+ * @brief Gets the component ID.
+ * @since_tizen 5.5
+ * @remarks You must release @a component_id using free().
+ *
+ * @param[in] handle The component information handle
+ * @param[out] component_id The component ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int component_info_get_component_id(component_info_h handle, char **component_id);
+/**
+ * @brief Gets the type of component.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The component information handle
+ * @param[out] type The component type
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @see #component_info_component_type_e
+ */
int component_info_get_component_type(component_info_h handle, component_info_component_type_e *type);
+/**
+ * @brief Checks whether the icon of the component should be displayed or not.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The component information handle
+ * @param[out] icon_display @c true if the icon should be displayed, \n
+ * otherwise @c false
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ */
int component_info_is_icon_display(component_info_h handle, bool *icon_display);
-int component_info_is_taskmanage(component_info_h handle, bool *taskmanage);
+/**
+ * @brief Checks whether the component should be managed by task-manager or not.
+ * @since_tizen 5.5
+ *
+ * @param[in] handle The component information handle
+ * @param[out] managed @c if the component should be managed by task-manager, \n
+ * otherwise @c false
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ */
+int component_info_is_managed_by_task_manager(component_info_h handle, bool *managed);
+/**
+ * @brief Gets the icon path of the component.
+ * @since_tizen 5.5
+ * @remarks You must release @a path using free().
+ *
+ * @param[in] handle The component information handle
+ * @param[out] path The icon path of the component
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
int component_info_get_icon(component_info_h handle, char **path);
+/**
+ * @brief Gets the label of the component.
+ * @since_tizen 5.5
+ * @remarks You must release @a label using free().
+ *
+ * @param[in] handle The component information handle
+ * @param[out] label The label of the component
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
int component_info_get_label(component_info_h handle, char **label);
-int component_info_get_localed_label(component_info_h handle, const char *locale, char **label);
+/**
+ * @brief Gets the localized label of the component.
+ * @since_tizen 5.5
+ * @remarks You must release @a label using free().
+ *
+ * @param[in] handle The component information handle
+ * @param[in] locale The locale information
+ * @param[out] label The localized label of the component
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_LABEL_NOT_FOUND The localized label does not exist
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int component_info_get_localized_label(component_info_h handle, const char *locale, char **label);
+/**
+ * @brief Clones the component information handle.
+ * @since_tizen 5.5
+ * @remarks You must release @a clone using component_info_destroy().
+ *
+ * @param[out] clone A newly created component information handle, if successfully cloned
+ * @param[in] handle The component information
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
int component_info_clone(component_info_h *clone, component_info_h handle);
/**
}
#endif
-#endif /* __TIZEN_APPFW_COMPONENT_INFO_H */
+#endif /* __TIZEN_APPFW_COMPONENT_INFO_H__ */
* limitations under the License.
*/
-#ifndef __TIZEN_APPFW_COMPONENT_MANAGER_H
-#define __TIZEN_APPFW_COMPONENT_MANAGER_H
+#ifndef __TIZEN_APPFW_COMPONENT_MANAGER_H__
+#define __TIZEN_APPFW_COMPONENT_MANAGER_H__
#include <tizen.h>
* @{
*/
+#ifndef TIZEN_ERROR_COMPONENT_MANAGER
+#define TIZEN_ERROR_COMPONENT_MANAGER -0x03040000
+#endif
+
+/**
+ * @brief Enumerations for Component Manager Error.
+ * @since_tizen 5.5
+ */
typedef enum {
- COMPONENT_MANAGER_ERROR_NONE = TIZEN_ERROR_NONE,
- COMPONENT_MANAGER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,
- COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,
- COMPONENT_MANAGER_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR,
- COMPONENT_MANAGER_ERROR_NO_SUCH_COMP = TIZEN_ERROR_APPLICATION_MANAGER | 0x01,
- COMPONENT_MANAGER_ERROR_DB_FAILED = TIZEN_ERROR_APPLICATION_MANAGER | 0x03,
- COMPONENT_MANAGER_ERROR_INVALID_APPLICATION = TIZEN_ERROR_APPLICATION_MANAGER | 0x04,
- COMPONENT_MANAGER_ERROR_NOT_RUNNING = TIZEN_ERROR_APPLICATION_MANAGER | 0x05,
- COMPONENT_MANAGER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,
- COMPONENT_MANAGER_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED
+ COMPONENT_MANAGER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ COMPONENT_MANAGER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ COMPONENT_MANAGER_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< Internal I/O error */
+ COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT = TIZEN_ERROR_COMPONENT_MANAGER | 0x01, /**< No such component */
+ COMPONENT_MANAGER_ERROR_DB_FAILED = TIZEN_ERROR_COMPONENT_MANAGER | 0x03, /**< Database error */
+ COMPONENT_MANAGER_ERROR_INVALID_APPLICATION = TIZEN_ERROR_COMPONENT_MANAGER | 0x04, /**< Invalid application ID */
+ COMPONENT_MANAGER_ERROR_NOT_RUNNING = TIZEN_ERROR_COMPONENT_MANAGER | 0x05, /**< Component is not running */
+ COMPONENT_MANAGER_ERROR_LABEL_NOT_FOUND = TIZEN_ERROR_COMPONENT_MANAGER | 0x06, /**< Label not found */
+ COMPONENT_MANAGER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
} component_manager_error_e;
+/**
+ * @brief Called to get the component context once for each running component.
+ * @since_tizen 5.5
+ * @remarks The @a handle should not be released.
+ * The @a handle can be used only in the callback. To use outside, make a copy using component_context_clone().
+ *
+ * @param[in] handle The component context of each running component
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n
+ * otherwise @c false to break out of the loop
+ * @pre component_manager_foreach_component_context() will invoke this callback.
+ * @see component_manager_foreach_component_context()
+ */
typedef bool (*component_manager_component_context_cb)(component_context_h handle, void *user_data);
+/**
+ * @brief Called to get the component information once for each installed component.
+ * @since_tizen 5.5
+ * @remarks The @a handle should not be released.
+ * The @a handle can be used only in the callback. To use outside, make a copy using component_info_clone().
+ *
+ * @param[in] handle The component information of each installed component
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n
+ * otherwise @c false to break out of the loop
+ * @pre component_manager_foreach_component_info() will invoke this callback.
+ * @see component_manager_foreach_component_info()
+ */
typedef bool (*component_manager_component_info_cb)(component_info_h handle, void *user_data);
+/**
+ * @brief Retrieves all component contexts of running components.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ *
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ *
+ * @see component_manager_component_context_cb()
+ */
int component_manager_foreach_component_context(component_manager_component_context_cb callback, void *user_data);
+/**
+ * @brief Retrieves all installed components information.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ *
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ *
+ * @see component_manager_component_info_cb()
+ */
int component_manager_foreach_component_info(component_manager_component_info_cb callback, void *user_data);
+/**
+ * @brief Gets the component context for the given component ID.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @remarks This function returns #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT if the component with the given component ID is not running. \n
+ * You MUST release @c handle using component_context_destroy().
+ *
+ * @param[in] comp_id The component ID
+ * @param[out] handle The component context of the given component ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ */
int component_manager_get_component_context(const char *comp_id, component_context_h *handle);
+/**
+ * @brief Gets the component information for the given component ID.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @remarks You MUST release @c handle using component_info_destroy().
+ *
+ * @param[in] comp_id The component ID
+ * @param[out] handle The component information of the given component ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
int component_manager_get_component_info(const char *comp_id, component_info_h *handle);
+/**
+ * @brief Checks whether the component is running or not.
+ * @since_tizen 5.5
+ *
+ * @param[in] comp_id The component ID
+ * @param[out] running @c true if the component is running, \n
+ * otherwise @c false if not running
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
int component_manager_is_running(const char *comp_id, bool *running);
+/**
+ * @brief Resumes the component.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/appmanager.launch
+ *
+ * @param[in] handle The component context handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ */
int component_manager_resume_component(component_context_h handle);
+/**
+ * @brief Terminates the background component.
+ * @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/appmanager.kill.bgapp
+ * @remarks This function returns after it just sends a request for terminating a background component.
+ * Platform will decide if the target component could be terminated or not according to the state of the target component.
+ *
+ * @param[in] handle The component context handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ */
int component_manager_terminate_bg_component(component_context_h handle);
/**
}
#endif
-#endif /* __TIZEN_APPFW_COMPONENT_MANAGER_H */
+#endif /* __TIZEN_APPFW_COMPONENT_MANAGER_H__ */
* limitations under the License.
*/
-#ifndef __TIZEN_APPFW_COMPONENT_MANAGER_EXTENSION_H
-#define __TIZEN_APPFW_COMPONENT_MANAGER_EXTENSION_H
+#ifndef __TIZEN_APPFW_COMPONENT_MANAGER_EXTENSION_H__
+#define __TIZEN_APPFW_COMPONENT_MANAGER_EXTENSION_H__
#include <tizen.h>
* @param[in] handle The component context handle
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
- * #retval COMPONENT_MANAGER_ERROR_NO_SUCH_COMP No such component
- * #retval COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int component_manager_pause_component(component_context_h handle);
* @param[in] handle The component context handle
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
- * #retval COMPONENT_MANAGER_ERROR_NO_SUCH_COMP No such component
- * #retval COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int component_manager_terminate_component(component_context_h handle);
}
#endif
-#endif /* __TIZEN_APPFW_COMPONENT_MANAGER_EXTENSION_H */
+#endif /* __TIZEN_APPFW_COMPONENT_MANAGER_EXTENSION_H__ */
return COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY;
case AUL_R_ENOENT:
case AUL_R_ENOAPP:
- return COMPONENT_MANAGER_ERROR_NO_SUCH_COMP;
+ return COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT;
case AUL_R_EILLACC:
return COMPONENT_MANAGER_ERROR_PERMISSION_DENIED;
case AUL_R_EINVAL:
return COMPONENT_MANAGER_ERROR_INVALID_PARAMETER;
}
- ret = aul_comp_context_foreach((aul_comp_context_cb)callback,
- user_data);
+ ret = aul_comp_context_foreach_comp_context(
+ (aul_comp_context_cb)callback, user_data);
if (ret != AUL_R_OK) {
LOGE("Failed to retrieve component context. error(%d)", ret);
return __convert_aul_error(ret);
return COMPONENT_MANAGER_ERROR_NONE;
}
-EXPORT_API int component_context_get_comp_id(component_context_h handle,
- char **comp_id)
+EXPORT_API int component_context_get_component_id(component_context_h handle,
+ char **component_id)
{
aul_comp_context_h context = HANDLE_TO_AUL_HANDLE(handle);
const char *value = NULL;
int ret;
- if (!handle || !comp_id) {
+ if (!handle || !component_id) {
LOGE("Invalid parameter");
return COMPONENT_MANAGER_ERROR_INVALID_PARAMETER;
}
return COMPONENT_MANAGER_ERROR_INVALID_PARAMETER;
}
- *comp_id = strdup(value);
- if (*comp_id == NULL) {
+ *component_id = strdup(value);
+ if (*component_id == NULL) {
LOGE("Failed to duplicate component ID");
return COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY;
}
return COMPONENT_MANAGER_ERROR_NONE;
}
-EXPORT_API int component_context_is_sub_comp(component_context_h handle,
- bool *is_sub_comp)
+EXPORT_API int component_context_is_subcomponent(component_context_h handle,
+ bool *is_subcomponent)
{
aul_comp_context_h context = HANDLE_TO_AUL_HANDLE(handle);
bool value = false;
int ret;
- if (!handle || !is_sub_comp) {
+ if (!handle || !is_subcomponent) {
LOGE("Invalid parameter");
return COMPONENT_MANAGER_ERROR_INVALID_PARAMETER;
}
return COMPONENT_MANAGER_ERROR_INVALID_PARAMETER;
}
- *is_sub_comp = value;
+ *is_subcomponent = value;
return COMPONENT_MANAGER_ERROR_NONE;
}
* @brief Creates the component context handle.
* @since_tizen 5.5
* @remarks You MUST release @c handle using component_context_destroy().
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
*
* @param[in] comp_id The component ID
* @param[out] handle The component context handle
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
- * #retval COMPONENT_MANAGER_ERROR_NO_SUCH_COMP No such component
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
*/
int component_context_create(const char *comp_id, component_context_h *handle);
* otherwise @c false if not running
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
*/
int component_context_is_running(component_context_h handle, bool *running);
* @param[in] handle The component context handle
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
- * #retval COMPONENT_MANAGER_ERROR_NO_SUCH_COMP No such component
- * #retval COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int component_context_resume(component_context_h handle);
* @param[in] handle The component context handle
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
- * #retval COMPONENT_MANAGER_ERROR_NO_SUCH_COMP No such component
- * #retval COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int component_context_pause(component_context_h handle);
* @param[in] handle The component context handle
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
- * #retval COMPONENT_MANAGER_ERROR_NO_SUCH_COMP No such component
- * #retval COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int component_context_terminate_bg_component(component_context_h handle);
* @param[in] handle The component context handle
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
- * #retval COMPONENT_MANAGER_ERROR_NO_SUCH_COMP No such component
- * #retval COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int component_context_terminate(component_context_h handle);
/**
* @brief Retrieves all running components context.
* @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
*
* @param[in] callback The callback function to invoke
* @param[in] user_data The user data to be passed from the callback function
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
- * #retval COMPONENT_MANAGER_ERROR_NO_SUCH_COMP No such component
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
*/
int component_context_foreach(component_manager_component_context_cb callback, void *user_data);
return COMPONENT_MANAGER_ERROR_INVALID_PARAMETER;
}
- ret = aul_comp_info_foreach((aul_comp_info_cb)callback, user_data);
+ ret = aul_comp_info_foreach_comp_info((aul_comp_info_cb)callback,
+ user_data);
if (ret != AUL_R_OK) {
LOGE("Failed to retrieve component info. error(%d)", ret);
+ if (ret == AUL_R_EILLACC)
+ return COMPONENT_MANAGER_ERROR_PERMISSION_DENIED;
if (ret == AUL_R_ENOENT)
- return COMPONENT_MANAGER_ERROR_NO_SUCH_COMP;
+ return COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT;
if (ret == AUL_R_ENOMEM)
return COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY;
ret = aul_comp_info_create(comp_id, &h);
if (ret != AUL_R_OK) {
LOGE("Failed to get component info. error(%d)", ret);
+ if (ret == AUL_R_EILLACC)
+ return COMPONENT_MANAGER_ERROR_PERMISSION_DENIED;
if (ret == AUL_R_ENOENT)
- return COMPONENT_MANAGER_ERROR_NO_SUCH_COMP;
+ return COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT;
return COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY;
}
return COMPONENT_MANAGER_ERROR_NONE;
}
-EXPORT_API int component_info_get_comp_id(component_info_h handle,
- char **comp_id)
+EXPORT_API int component_info_get_component_id(component_info_h handle,
+ char **component_id)
{
aul_comp_info_h h = HANDLE_TO_AUL_HANDLE(handle);
const char *value = NULL;
int ret;
- if (!handle || !comp_id) {
+ if (!handle || !component_id) {
LOGE("Invalid parameter");
return COMPONENT_MANAGER_ERROR_INVALID_PARAMETER;
}
return COMPONENT_MANAGER_ERROR_IO_ERROR;
}
- *comp_id = strdup(value);
- if (*comp_id == NULL) {
+ *component_id = strdup(value);
+ if (*component_id == NULL) {
LOGE("Failed to duplicate component ID");
return COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY;
}
return COMPONENT_MANAGER_ERROR_NONE;
}
-EXPORT_API int component_info_is_taskmanage(component_info_h handle,
- bool *taskmanage)
+EXPORT_API int component_info_is_managed_by_task_manager(
+ component_info_h handle, bool *managed)
{
aul_comp_info_h h = HANDLE_TO_AUL_HANDLE(handle);
bool value = false;
int ret;
- if (!handle || !taskmanage) {
+ if (!handle || !managed) {
LOGE("Invalid parameter");
return COMPONENT_MANAGER_ERROR_INVALID_PARAMETER;
}
return COMPONENT_MANAGER_ERROR_IO_ERROR;
}
- *taskmanage = value;
+ *managed = value;
return COMPONENT_MANAGER_ERROR_NONE;
}
return COMPONENT_MANAGER_ERROR_NONE;
}
-EXPORT_API int component_info_get_localed_label(component_info_h handle,
+EXPORT_API int component_info_get_localized_label(component_info_h handle,
const char *locale, char **label)
{
aul_comp_info_h h = HANDLE_TO_AUL_HANDLE(handle);
- const char *comp_id = NULL;
- char *value = NULL;
+ const char *value = NULL;
int ret;
if (!handle || !locale || !label) {
return COMPONENT_MANAGER_ERROR_INVALID_PARAMETER;
}
- ret = aul_comp_info_get_comp_id(h, &comp_id);
- if (ret != AUL_R_OK) {
- LOGE("Failed to get component ID");
- return COMPONENT_MANAGER_ERROR_IO_ERROR;
- }
-
- ret = aul_comp_info_get_localed_label(comp_id, locale, &value);
+ ret = aul_comp_info_get_localed_label(h, locale, &value);
if (ret != AUL_R_OK) {
LOGE("Failed to get localed label");
if (ret == AUL_R_ENOENT)
- return COMPONENT_MANAGER_ERROR_NO_SUCH_COMP;
+ return COMPONENT_MANAGER_ERROR_LABEL_NOT_FOUND;
return COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY;
}
- *label = value;
+ *label = strdup(value);
+ if (*label == NULL) {
+ LOGE("Failed to duplicate localized label");
+ return COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY;
+ }
return COMPONENT_MANAGER_ERROR_NONE;
}
/**
* @brief Retrieves all running component context.
* @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
*
* @param[in] callback The callback function to invoke
* @param[in] user_data The user data to be passed from the callback function
* @return @c 0 on success,
* otherwise a negative error value
- * #retval COMPONENT_MANAGER_ERROR_NONE Successful
- * #retval COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * #retval COMPONENT_MANAGER_ERROR_NO_SUCH_COMP No such component
- * #retval COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
- * #retval COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
+ * @retval #COMPONENT_MANAGER_ERROR_NONE Successful
+ * @retval #COMPONENT_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #COMPONENT_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT No such component
+ * @retval #COMPONENT_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #COMPONENT_MANAGER_ERROR_IO_ERROR I/O error
*/
int component_info_foreach(component_manager_component_info_cb callback, void *user_data);
DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_get_label, aul_comp_info_h, const char **);
-DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_get_localed_label,const char *, const char *, char **);
+DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_get_localed_label, aul_comp_info_h, const char *, char **);
DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_clone, aul_comp_info_h, aul_comp_info_h *);
-DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_from_app, const char *, aul_comp_info_cb, void *);
+DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_comp_info_from_app, const char *, aul_comp_info_cb, void *);
-DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_usr_from_app, const char *, uid_t, aul_comp_info_cb, void *);
+DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_usr_foreach_comp_info_from_app, const char *, uid_t, aul_comp_info_cb, void *);
-DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach, aul_comp_info_cb, void *);
+DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_comp_info, aul_comp_info_cb, void *);
-DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_usr, uid_t, aul_comp_info_cb, void *);
+DEFINE_FAKE_VALUE_FUNC(int, aul_comp_info_usr_foreach_comp_info, uid_t, aul_comp_info_cb, void *);
// aul_comp_context.h
-DEFINE_FAKE_VALUE_FUNC(int, aul_comp_context_foreach, aul_comp_context_cb, void *);
+DEFINE_FAKE_VALUE_FUNC(int, aul_comp_context_foreach_comp_context, aul_comp_context_cb, void *);
DEFINE_FAKE_VALUE_FUNC(int, aul_comp_context_get_app_id, aul_comp_context_h, const char **);
DEFINE_FAKE_VALUE_FUNC(int, aul_comp_context_create, const char *, aul_comp_context_h *);
-DEFINE_FAKE_VALUE_FUNC(int, aul_comp_context_create_usr, const char *, uid_t, aul_comp_context_h *);
+DEFINE_FAKE_VALUE_FUNC(int, aul_comp_context_usr_create, const char *, uid_t, aul_comp_context_h *);
DEFINE_FAKE_VALUE_FUNC(int, aul_comp_context_destroy, aul_comp_context_h);
typedef bool (*aul_comp_context_cb)(aul_comp_context_h handle, void *user_data);
-DECLARE_FAKE_VALUE_FUNC(int, aul_comp_context_foreach, aul_comp_context_cb, void *);
+DECLARE_FAKE_VALUE_FUNC(int, aul_comp_context_foreach_comp_context, aul_comp_context_cb, void *);
DECLARE_FAKE_VALUE_FUNC(int, aul_comp_context_get_app_id, aul_comp_context_h, const char **);
DECLARE_FAKE_VALUE_FUNC(int, aul_comp_context_create, const char *, aul_comp_context_h *);
-DECLARE_FAKE_VALUE_FUNC(int, aul_comp_context_create_usr, const char *, uid_t, aul_comp_context_h *);
+DECLARE_FAKE_VALUE_FUNC(int, aul_comp_context_usr_create, const char *, uid_t, aul_comp_context_h *);
DECLARE_FAKE_VALUE_FUNC(int, aul_comp_context_destroy, aul_comp_context_h);
DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_get_label, aul_comp_info_h, const char **);
-DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_get_localed_label, const char *, const char *, char **);
+DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_get_localed_label, aul_comp_info_h, const char *, char **);
DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_clone, aul_comp_info_h, aul_comp_info_h *);
-DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_from_app, const char *, aul_comp_info_cb, void *);
+DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_comp_info_from_app, const char *, aul_comp_info_cb, void *);
-DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_usr_from_app, const char *, uid_t, aul_comp_info_cb, void *);
+DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_usr_foreach_comp_info_from_app, const char *, uid_t, aul_comp_info_cb, void *);
-DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach, aul_comp_info_cb, void *);
+DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_comp_info, aul_comp_info_cb, void *);
-DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_foreach_usr, uid_t, aul_comp_info_cb, void *);
+DECLARE_FAKE_VALUE_FUNC(int, aul_comp_info_usr_foreach_comp_info, uid_t, aul_comp_info_cb, void *);
#ifdef __cplusplus
}
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
-TEST_F(ComponentContextTest, component_context_get_comp_id_Positive) {
+TEST_F(ComponentContextTest, component_context_get_component_id_Positive) {
component_context_h handle = GetHandle();
- char* comp_id = nullptr;
+ char* component_id = nullptr;
- int ret = component_context_get_comp_id(handle, &comp_id);
- auto p = std::unique_ptr<char, decltype(std::free)*>(comp_id, std::free);
+ int ret = component_context_get_component_id(handle, &component_id);
+ auto p = std::unique_ptr<char, decltype(std::free)*>(component_id, std::free);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_NONE);
EXPECT_EQ(std::string(p.get()), "TestComponent");
}
-TEST_F(ComponentContextTest, component_context_get_comp_id_Negative) {
- int ret = component_context_get_comp_id(nullptr, nullptr);
+TEST_F(ComponentContextTest, component_context_get_component_id_Negative) {
+ int ret = component_context_get_component_id(nullptr, nullptr);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
-TEST_F(ComponentContextTest, component_context_is_sub_comp_Positive) {
+TEST_F(ComponentContextTest, component_context_is_subcomponent_Positive) {
component_context_h handle = GetHandle();
- bool is_sub_comp;
+ bool is_subcomponent;
- int ret = component_context_is_sub_comp(handle, &is_sub_comp);
+ int ret = component_context_is_subcomponent(handle, &is_subcomponent);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_NONE);
- EXPECT_EQ(is_sub_comp, false);
+ EXPECT_EQ(is_subcomponent, false);
}
-TEST_F(ComponentContextTest, component_context_is_sub_comp_Negative) {
- int ret = component_context_is_sub_comp(nullptr, nullptr);
+TEST_F(ComponentContextTest, component_context_is_subcomponent_Negative) {
+ int ret = component_context_is_subcomponent(nullptr, nullptr);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
return AUL_R_OK;
}
-static int __fake_aul_comp_info_get_localed_label(const char* compid,
+static int __fake_aul_comp_info_get_localed_label(aul_comp_info_h handle,
const char* locale, char** label) {
*label = strdup("Kor_TestComponent");
return AUL_R_OK;
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
-TEST_F(ComponentInfoTest, component_info_get_comp_id_Positive) {
+TEST_F(ComponentInfoTest, component_info_get_component_id_Positive) {
component_info_h handle = GetHandle();
char* value = nullptr;
- int ret = component_info_get_comp_id(handle, &value);
+ int ret = component_info_get_component_id(handle, &value);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_NONE);
auto p = std::unique_ptr<char, decltype(std::free)*>(value, std::free);
EXPECT_EQ(std::string(p.get()), "TestComponent");
}
-TEST_F(ComponentInfoTest, component_info_get_comp_id_Negative) {
- int ret = component_info_get_comp_id(nullptr, nullptr);
+TEST_F(ComponentInfoTest, component_info_get_component_id_Negative) {
+ int ret = component_info_get_component_id(nullptr, nullptr);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
-TEST_F(ComponentInfoTest, component_info_is_taskmanage_Positive) {
+TEST_F(ComponentInfoTest, component_info_is_managed_by_task_manager_Positive) {
component_info_h handle = GetHandle();
- bool taskmanage = false;
- int ret = component_info_is_taskmanage(handle, &taskmanage);
+ bool managed = false;
+ int ret = component_info_is_managed_by_task_manager(handle, &managed);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_NONE);
- EXPECT_EQ(taskmanage, true);
+ EXPECT_EQ(managed, true);
}
-TEST_F(ComponentInfoTest, component_info_is_taskmanage_Negative) {
- int ret = component_info_is_taskmanage(nullptr, nullptr);
+TEST_F(ComponentInfoTest, component_info_is_managed_by_task_manager_Negative) {
+ int ret = component_info_is_managed_by_task_manager(nullptr, nullptr);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
-TEST_F(ComponentInfoTest, component_info_get_localed_label_Positive) {
+TEST_F(ComponentInfoTest, component_info_get_localized_label_Positive) {
component_info_h handle = GetHandle();
char* value = nullptr;
- int ret = component_info_get_localed_label(handle, "ko-kr", &value);
+ int ret = component_info_get_localized_label(handle, "ko-kr", &value);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_NONE);
auto p = std::unique_ptr<char, decltype(std::free)*>(value, std::free);
EXPECT_EQ(std::string(p.get()), "Kor_TestComponent");
}
-TEST_F(ComponentInfoTest, component_info_get_localed_label_Negative) {
- int ret = component_info_get_localed_label(nullptr, nullptr, nullptr);
+TEST_F(ComponentInfoTest, component_info_get_localized_label_Negative) {
+ int ret = component_info_get_localized_label(nullptr, nullptr, nullptr);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_INVALID_PARAMETER);
}
#include "mock_aul_comp_context.h"
#include "component_manager.h"
-static int __fake_aul_comp_info_foreach(aul_comp_info_cb callback,
+static int __fake_aul_comp_info_foreach_comp_info(aul_comp_info_cb callback,
void* user_data) {
aul_comp_info_h handle = nullptr;
callback(handle, user_data);
return AUL_R_OK;
}
-static int __fake_aul_comp_context_foreach(aul_comp_context_cb callback,
- void* user_data) {
+static int __fake_aul_comp_context_foreach_comp_context(
+ aul_comp_context_cb callback, void* user_data) {
aul_comp_context_h handle = nullptr;
callback(handle, user_data);
return AUL_R_OK;
class ComponentManagerTest : public testing::Test {
public:
virtual void SetUp() {
- aul_comp_info_foreach_fake.custom_fake =
- __fake_aul_comp_info_foreach;
+ aul_comp_info_foreach_comp_info_fake.custom_fake =
+ __fake_aul_comp_info_foreach_comp_info;
aul_comp_info_create_fake.custom_fake =
__fake_aul_comp_info_create;
aul_comp_info_destroy_fake.custom_fake =
__fake_aul_comp_info_destroy;
- aul_comp_context_foreach_fake.custom_fake =
- __fake_aul_comp_context_foreach;
+ aul_comp_context_foreach_comp_context_fake.custom_fake =
+ __fake_aul_comp_context_foreach_comp_context;
aul_comp_context_create_fake.custom_fake =
__fake_aul_comp_context_create;
aul_comp_context_destroy_fake.custom_fake =