*/
int app_manager_event_destroy(app_manager_event_h handle);
+/**
+ * @platform
+ * @brief Sets the application's icon path into given path.
+ * @since_tizen 5.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/packagemanager.admin
+ * @remarks The icon file should be included in package which the applications belongs to.
+ * @param[in] app_id The ID of the application
+ * @param[in] icon_path The path of icon file
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_MANAGER_ERROR_IO_ERROR Internal error
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @see app_manager_event_create()
+ */
+int app_manager_set_app_icon(const char *app_id, const char *icon_path);
/**
* @}
return r;
}
+API int app_manager_set_app_icon(const char *app_id, const char *icon_path)
+{
+ int r;
+ pkgmgr_client *pc;
+
+ if (app_id == NULL)
+ return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER,
+ __FUNCTION__, NULL);
+
+ pc = pkgmgr_client_new(PC_REQUEST);
+ if (pc == NULL)
+ return app_manager_error(APP_MANAGER_ERROR_OUT_OF_MEMORY,
+ __FUNCTION__, NULL);
+
+ r = pkgmgr_client_set_app_icon(pc, (char *)app_id, (char *)icon_path);
+ pkgmgr_client_free(pc);
+
+ switch (r) {
+ case PKGMGR_R_OK:
+ r = APP_MANAGER_ERROR_NONE;
+ break;
+ case PKGMGR_R_EINVAL:
+ r = app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER,
+ __FUNCTION__, NULL);
+ break;
+ case PKGMGR_R_EPRIV:
+ r = app_manager_error(APP_MANAGER_ERROR_PERMISSION_DENIED,
+ __FUNCTION__, NULL);
+ break;
+ default:
+ r = app_manager_error(APP_MANAGER_ERROR_IO_ERROR,
+ __FUNCTION__, NULL);
+ break;
+ }
+
+ return r;
+}
+
+
API int app_manager_event_create(app_manager_event_h *handle)
{
pkgmgr_client *pc = NULL;