return APP_CONTROL_ERROR_NONE;
}
+int app_control_set_defapp(app_control_h app_control, const char *app_id)
+{
+ int ret;
+
+ if (app_control_validate(app_control) || app_id == NULL)
+ return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+
+ ret = aul_svc_set_appid(app_control->data, app_id);
+ if (ret < 0)
+ return app_control_error(APP_CONTROL_ERROR_IO_ERROR, __FUNCTION__, NULL);
+
+ ret = aul_set_default_app_by_operation(app_control->data);
+ if (ret < 0) {
+ if (ret == AUL_R_EILLACC)
+ return app_control_error(APP_CONTROL_ERROR_PERMISSION_DENIED, __FUNCTION__, NULL);
+ else
+ return app_control_error(APP_CONTROL_ERROR_IO_ERROR, __FUNCTION__, NULL);
+ }
+
+ return APP_CONTROL_ERROR_NONE;
+}
+
+int app_control_unset_defapp(const char *app_id)
+{
+ int ret;
+
+ if (app_id == NULL)
+ return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
+
+ ret = aul_unset_default_app_by_operation(app_id);
+ if (ret <0) {
+ if (ret == AUL_R_EILLACC)
+ return app_control_error(APP_CONTROL_ERROR_PERMISSION_DENIED, __FUNCTION__, NULL);
+ else
+ return app_control_error(APP_CONTROL_ERROR_IO_ERROR, __FUNCTION__, NULL);
+ }
+
+ return APP_CONTROL_ERROR_NONE;
+}
+
static void __update_launch_pid(int launched_pid, void *data)
{
app_control_h app_control;
* @see #APP_CONTROL_RESULT_APP_STARTED
*/
int app_control_enable_app_started_result_event(app_control_h app_control);
+
+/**
+ * @brief Set the ID of default application associated with operation, mime-type and uri.
+ *
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
+ * @param[in] app_control The app_control handle
+ * @param[in] app_id The ID of the application
+ *
+ * @return 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_IO_ERROR IO error
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ */
+int app_control_set_defapp(app_control_h app_control, const char *app_id);
+
+/**
+ * @brief Unset default application setting of an application for app_controls.
+ *
+ * @details When an user call this API, all the default application settings for the app_id are unset.
+ *
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
+ * @param[in] app_id The ID of the application
+ *
+ * @return 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_IO_ERROR IO error
+ * @retval #APP_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ */
+int app_control_unset_defapp(const char *app_id);
/**
* @}
*/