To use component_manager_is_running(), the packagemanager.info privilege
is needed. And, if the component context in the function cannot be created
with COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT, the running flag should be
"false".
Change-Id: Ide782a88809daefcb739b51aaa63b982735a49cd
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
/**
* @brief Checks whether the component is running or not.
* @since_tizen 5.5
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
*
* @param[in] comp_id The component ID
* @param[out] running @c true if the component is running, \n
* @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
}
ret = component_context_create(comp_id, &handle);
- if (ret != COMPONENT_MANAGER_ERROR_NONE)
+ if (ret != COMPONENT_MANAGER_ERROR_NONE) {
+ if (ret == COMPONENT_MANAGER_ERROR_NO_SUCH_COMPONENT) {
+ *running = false;
+ return COMPONENT_MANAGER_ERROR_NONE;
+ }
+
return ret;
+ }
ret = component_context_is_running(handle, running);
component_context_destroy(handle);