Tizen Native API
5.5
|
Package Manager Request API. It is responsible for installing, uninstalling, moving packages, and storing their information.
#include <package_manager.h>
The Package Manager API provides functions to install and uninstall the package, and also provides event listening function. The package_manager_request_install() method is used to asynchronously install a package. Similarly, the package_manager_request_uninstall() and package_manager_request_move() methods are used to asynchronously uninstall a package. The callback function is called when the progress of the request changes. Use package_manager_request_event_cb() to listen to package installation related events.
Functions | |
int | package_manager_request_create (package_manager_request_h *request) |
Creates a request handle to the package manager. | |
int | package_manager_request_destroy (package_manager_request_h request) |
Destroys the request handle to the package manager. | |
int | package_manager_request_set_event_cb (package_manager_request_h request, package_manager_request_event_cb callback, void *user_data) |
Registers a callback function to be invoked when the progress of the request changes. | |
int | package_manager_request_unset_event_cb (package_manager_request_h request) |
Unregisters the callback function. | |
int | package_manager_request_set_type (package_manager_request_h request, const char *type) |
Sets the type of the package to install, uninstall, or update. | |
int | package_manager_request_set_mode (package_manager_request_h request, package_manager_request_mode_e mode) |
Sets the mode of the request. | |
int | package_manager_request_set_tep (package_manager_request_h request, const char *tep_path) |
Sets the path of TEP file to the request. The TEP file that is set will be installed when the package is installed. | |
int | package_manager_request_install (package_manager_request_h request, const char *path, int *id) |
Installs the package located at the given path, asynchronously. | |
int | package_manager_request_install_with_cb (package_manager_request_h request, const char *path, package_manager_request_event_cb callback, void *user_data, int *id) |
Installs the package located at the given path, asynchronously. | |
int | package_manager_request_uninstall (package_manager_request_h request, const char *name, int *id) |
Uninstalls the package with the given name, asynchronously. | |
int | package_manager_request_uninstall_with_cb (package_manager_request_h request, const char *name, package_manager_request_event_cb callback, void *user_data, int *id) |
Uninstalls the package with the given name, asynchronously. | |
int | package_manager_request_move (package_manager_request_h request, const char *name, package_manager_move_type_e move_type) |
Moves the package from SD card to the internal memory and vice versa, asynchronously. | |
int | package_manager_request_move_with_cb (package_manager_request_h request, const char *name, package_manager_move_type_e move_type, package_manager_request_event_cb callback, void *user_data, int *id) |
Moves the package from SD card to the internal memory and vice versa, asynchronously. | |
int | package_manager_updateinfo_request_create (package_updateinfo_request_h *pkg_updateinfo_req) |
Creates a package update info request. | |
int | package_manager_updateinfo_set_pkgid (package_updateinfo_request_h pkg_updateinfo_req, const char *pkgid) |
Sets the package ID to the package update info request. | |
int | package_manager_updateinfo_set_version (package_updateinfo_request_h pkg_updateinfo_req, const char *version) |
Sets the package version to the package update info request. | |
int | package_manager_updateinfo_set_type (package_updateinfo_request_h pkg_updateinfo_req, package_updateinfo_type_e type) |
Sets the package update type to the package update info request. | |
int | package_manager_updateinfo_request_register (package_updateinfo_request_h pkg_updateinfo_req) |
Requests to register package update info in platform. | |
int | package_manager_updateinfo_request_destroy (package_updateinfo_request_h pkg_updateinfo_req) |
Destroys the package update info request. | |
int | package_manager_updateinfo_request_unregister (package_updateinfo_request_h pkg_updateinfo_req, const char *pkgid) |
Requests to unregister update info in platform for given package id. | |
int | package_manager_updateinfo_request_unregister_all (package_updateinfo_request_h pkg_updateinfo_req) |
Request to unregister update info of all packages in platform. | |
Typedefs | |
typedef struct package_manager_request_s * | package_manager_request_h |
The Package manager request handle. | |
typedef void(* | package_manager_request_event_cb )(int id, const char *type, const char *package, package_manager_event_type_e event_type, package_manager_event_state_e event_state, int progress, package_manager_error_e error, void *user_data) |
Called when the progress of the request to the package manager changes. |
typedef void(* package_manager_request_event_cb)(int id, const char *type, const char *package, package_manager_event_type_e event_type, package_manager_event_state_e event_state, int progress, package_manager_error_e error, void *user_data) |
Called when the progress of the request to the package manager changes.
[in] | id | The ID of the request to the package manager |
[in] | type | The type of the package to install, uninstall or update |
[in] | package | The name of the package to install, uninstall or update |
[in] | event_type | The type of the request to the package manager |
[in] | event_state | The current state of the request to the package manager |
[in] | progress | The progress for the request that is being processed by the package manager The range of progress is from 0 to 100 . |
[in] | error | The error code when the package manager failed to process the request |
[in] | user_data | The user data passed from package_manager_request_set_event_cb() |
typedef struct package_manager_request_s* package_manager_request_h |
The Package manager request handle.
Enumeration for request mode.
int package_manager_request_create | ( | package_manager_request_h * | request | ) |
Creates a request handle to the package manager.
[out] | request | The request handle that is newly created on success |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
PACKAGE_MANAGER_ERROR_IO_ERROR | Internal I/O error |
int package_manager_request_destroy | ( | package_manager_request_h | request | ) |
Destroys the request handle to the package manager.
[in] | request | The request handle to the package manager |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_install | ( | package_manager_request_h | request, |
const char * | path, | ||
int * | id | ||
) |
Installs the package located at the given path, asynchronously.
[in] | request | The request handle |
[in] | path | The absolute path to the package to be installed |
[out] | id | The ID of the request to the package manager |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_install_with_cb | ( | package_manager_request_h | request, |
const char * | path, | ||
package_manager_request_event_cb | callback, | ||
void * | user_data, | ||
int * | id | ||
) |
Installs the package located at the given path, asynchronously.
The progress of the request is asynchronously received by the callback function. The callback is the individual callback only called for the current API call. The callback is the only callback called, even if another callback was set for this request with package_manager_request_set_event_cb().
[in] | request | The request handle |
[in] | path | The absolute path to the package to be installed |
[in] | callback | The callback function to be invoked |
[in] | user_data | The user data to be passed to the callback function |
[out] | id | The ID of the request to the package manager |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_move | ( | package_manager_request_h | request, |
const char * | name, | ||
package_manager_move_type_e | move_type | ||
) |
Moves the package from SD card to the internal memory and vice versa, asynchronously.
[in] | request | The request handle |
[in] | name | The name of the package to be moved |
[in] | move_type | The move type [package_manager_move_type_e], [external to internal/internal to external] |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_move_with_cb | ( | package_manager_request_h | request, |
const char * | name, | ||
package_manager_move_type_e | move_type, | ||
package_manager_request_event_cb | callback, | ||
void * | user_data, | ||
int * | id | ||
) |
Moves the package from SD card to the internal memory and vice versa, asynchronously.
The progress of the request is asynchronously received by the callback function. The callback is the individual callback only called for the current API call. The callback is the only callback called, even if another callback was set for this request with package_manager_request_set_event_cb().
[in] | request | The request handle |
[in] | name | The name of the package to be moved |
[in] | move_type | The move type [package_manager_move_type_e], [external to internal/internal to external] |
[in] | callback | The callback function to be invoked |
[in] | user_data | The user data to be passed to the callback function |
[out] | id | The ID of the request to the package manager |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_set_event_cb | ( | package_manager_request_h | request, |
package_manager_request_event_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be invoked when the progress of the request changes.
[in] | request | The request handle |
[in] | callback | The callback function to be registered |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_set_mode | ( | package_manager_request_h | request, |
package_manager_request_mode_e | mode | ||
) |
Sets the mode of the request.
[in] | request | The request handle |
[in] | mode | The mode of the request |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_set_tep | ( | package_manager_request_h | request, |
const char * | tep_path | ||
) |
Sets the path of TEP file to the request. The TEP file that is set will be installed when the package is installed.
[in] | request | The request handle |
[in] | tep_path | The TEP path to set. If this is NULL on update, installed TEP will be removed. |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_SYSTEM_ERROR | Severe system error |
int package_manager_request_set_type | ( | package_manager_request_h | request, |
const char * | type | ||
) |
Sets the type of the package to install, uninstall, or update.
[in] | request | The request handle |
[in] | type | The type of the package |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_uninstall | ( | package_manager_request_h | request, |
const char * | name, | ||
int * | id | ||
) |
Uninstalls the package with the given name, asynchronously.
[in] | request | The request handle |
[in] | name | The name of the package to be uninstalled |
[out] | id | The ID of the request to the package manager |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_uninstall_with_cb | ( | package_manager_request_h | request, |
const char * | name, | ||
package_manager_request_event_cb | callback, | ||
void * | user_data, | ||
int * | id | ||
) |
Uninstalls the package with the given name, asynchronously.
The progress of the request is asynchronously received by the callback function. The callback is the individual callback only called for the current API call. The callback is the only callback called, even if another callback was set for this request with package_manager_request_set_event_cb().
[in] | request | The request handle |
[in] | name | The name of the package to be uninstalled |
[in] | callback | The callback function to be invoked |
[in] | user_data | The user data to be passed to the callback function |
[out] | id | The ID of the request to the package manager |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_request_unset_event_cb | ( | package_manager_request_h | request | ) |
Unregisters the callback function.
[in] | request | The request handle |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_updateinfo_request_create | ( | package_updateinfo_request_h * | pkg_updateinfo_req | ) |
Creates a package update info request.
[out] | pkg_updateinfo_req | The package update info request handle that is newly created on success |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int package_manager_updateinfo_request_destroy | ( | package_updateinfo_request_h | pkg_updateinfo_req | ) |
Destroys the package update info request.
[in] | pkg_updateinfo_req | The update info request handle |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_updateinfo_request_register | ( | package_updateinfo_request_h | pkg_updateinfo_req | ) |
Requests to register package update info in platform.
[in] | pkg_updateinfo_req | The update info request handle |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
PACKAGE_MANAGER_ERROR_SYSTEM_ERROR | Severe system error |
int package_manager_updateinfo_request_unregister | ( | package_updateinfo_request_h | pkg_updateinfo_req, |
const char * | pkgid | ||
) |
Requests to unregister update info in platform for given package id.
[in] | pkg_updateinfo_req | The update info request handle |
[in] | pkgid | The package id to request unregister update info |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
PACKAGE_MANAGER_ERROR_SYSTEM_ERROR | Severe system error |
int package_manager_updateinfo_request_unregister_all | ( | package_updateinfo_request_h | pkg_updateinfo_req | ) |
Request to unregister update info of all packages in platform.
[in] | pkg_updateinfo_req | The update info request handle |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
PACKAGE_MANAGER_ERROR_SYSTEM_ERROR | Severe system error |
int package_manager_updateinfo_set_pkgid | ( | package_updateinfo_request_h | pkg_updateinfo_req, |
const char * | pkgid | ||
) |
Sets the package ID to the package update info request.
[in] | pkg_updateinfo_req | The update info request handle |
[in] | pkgid | The package ID |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int package_manager_updateinfo_set_type | ( | package_updateinfo_request_h | pkg_updateinfo_req, |
package_updateinfo_type_e | type | ||
) |
Sets the package update type to the package update info request.
[in] | pkg_updateinfo_req | The update info request handle |
[in] | type | The package update type |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_updateinfo_set_version | ( | package_updateinfo_request_h | pkg_updateinfo_req, |
const char * | version | ||
) |
Sets the package version to the package update info request.
[in] | pkg_updateinfo_req | The update info request handle |
[in] | version | The package version |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |