int app_control_send_resume_request(app_control_h app_control, app_control_result_cb callback, void *user_data);
/**
+ * @brief Sends the preparation request for the app-defined loader.
+ *
+ * @since_tizen 5.5
+ * @param[in] app_control The app_control handle
+ * @param[in] loader_id The app-defined loader ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_CONTROL_ERROR_NONE Successful
+ * @retval #APP_CONTROL_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_CONTROL_ERROR_IO_ERROR I/O error
+ */
+int app_control_prepare_app_defined_loader(app_control_h app_control, const char *loader_id);
+
+/**
* @}
*/
app_control_type_e type;
bundle *data;
int launch_pid;
+ int loader_id;
};
typedef struct app_control_request_context_s {
return __send_resume_request(app_control, result_cb, user_data);
}
+
+static int __convert_aul_error(int result)
+{
+ switch (result) {
+ case AUL_R_EINVAL:
+ return APP_CONTROL_ERROR_INVALID_PARAMETER;
+ case AUL_R_ENOMEM:
+ return APP_CONTROL_ERROR_OUT_OF_MEMORY;
+ case AUL_R_EILLACC:
+ return APP_CONTROL_ERROR_PERMISSION_DENIED;
+ default:
+ return APP_CONTROL_ERROR_IO_ERROR;
+ }
+}
+
+int app_control_prepare_app_defined_loader(app_control_h app_control,
+ const char *loader_id)
+{
+ int ret;
+
+ if (!app_control || !loader_id) {
+ return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
+ __FUNCTION__, "Inivalid parameter");
+ }
+
+ if (app_control_validate(app_control)) {
+ return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER,
+ __FUNCTION__, "Invalid parameter");
+ }
+
+ ret = aul_prepare_app_defined_loader(loader_id);
+ if (ret < 0) {
+ return app_control_error(__convert_aul_error(ret),
+ __FUNCTION__,
+ "Failed to prepare app defined loader");
+ }
+
+ app_control->loader_id = ret;
+
+ return APP_CONTROL_ERROR_NONE;
+}