int app_control_set_caller_instance_id(app_control_h app_control, const char *instance_id);
/**
+ * @brief Sets the ID of the component.
+ * @since_tizen 5.5
+ *
+ * @param[in] app_control The app_control handle
+ * @param[in] component_id The ID of the component
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_control_set_component_id(app_control_h app_control,
+ const char *component_id);
+
+/**
+ * @brief Gets the ID of the component.
+ * @since_tizen 5.5
+ * @remarks The @a component_id must be released using free().
+ *
+ * @param[in] app_control The app_control handle
+ * @param[out] component_id The ID of the component
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_control_get_component_id(app_control_h app_control,
+ char **component_id);
+
+/**
* @}
*/
return APP_CONTROL_ERROR_NONE;
}
+
+int app_control_set_component_id(app_control_h app_control,
+ const char *component_id)
+{
+ int r;
+
+ if (app_control_validate(app_control)) {
+ return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
+ __FUNCTION__, "Invalid parameter");
+ }
+
+ r = aul_svc_set_comp_id(app_control->data, component_id);
+ if (r != AUL_SVC_RET_OK && component_id != NULL) {
+ return app_control_error(APP_CONTROL_ERROR_OUT_OF_MEMORY,
+ __FUNCTION__, "Out of memory");
+ }
+
+ return APP_CONTROL_ERROR_NONE;
+}
+
+int app_control_get_component_id(app_control_h app_control,
+ char **component_id)
+{
+ const char *comp_id;
+
+ if (app_control_validate(app_control) || !component_id) {
+ return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
+ __FUNCTION__, "Invalid parameter");
+ }
+
+ comp_id = aul_svc_get_comp_id(app_control->data);
+ if (comp_id) {
+ *component_id = strdup(comp_id);
+ if (*component_id == NULL) {
+ return app_control_error(
+ APP_CONTROL_ERROR_OUT_OF_MEMORY,
+ __FUNCTION__, "Out of memory");
+ }
+ } else {
+ *component_id = NULL;
+ }
+
+ return APP_CONTROL_ERROR_NONE;
+}