Tizen Native API
5.0
|
Packager Manager information API for packaging. It provides functions for getting the package information.
#include <package_manager.h>
The package manager is used to retrieve detailed information of the installed packages on the device. This information includes package name, label, path to the icon image, version, type, and installed storage. To retrieve package information, you should get the package_info_h using package_info_create() or package_manager_get_package_info(). The package_manager_foreach_package_info() is used to retrieve all the package information of installed packages. And then package_manager_package_info_cb() is invoked. When the callback function is called, you can get the information using the following functions.
Functions | |
int | package_info_foreach_app_from_package (package_info_h package_info, package_info_app_component_type_e comp_type, package_info_app_cb callback, void *user_data) |
Retrieves all application IDs of each package. | |
int | package_info_destroy (package_info_h package_info) |
Destroys the package information handle and releases all its resources. | |
int | package_info_get_package (package_info_h package_info, char **package) |
Gets the package name. | |
int | package_info_get_main_app_id (package_info_h package_info, char **main_app_id) |
Gets the main application ID of the package. | |
int | package_info_get_label (package_info_h package_info, char **label) |
Gets the label of the package. | |
int | package_info_get_icon (package_info_h package_info, char **path) |
Gets the absolute path to the icon image. | |
int | package_info_get_version (package_info_h package_info, char **version) |
Gets the version of the package. | |
int | package_info_get_type (package_info_h package_info, char **type) |
Gets the type of the package. | |
int | package_info_get_installed_storage (package_info_h package_info, package_info_installed_storage_type_e *storage) |
Gets the installed storage for the given package. | |
int | package_info_get_root_path (package_info_h package_info, char **path) |
Gets the root path of the package. | |
int | package_info_get_tep_name (package_info_h package_info, char **name) |
Gets the name of the TEP(Tizen Expansion Package). | |
int | package_info_is_system_package (package_info_h package_info, bool *system) |
Checks whether the package is system package. | |
int | package_info_is_removable_package (package_info_h package_info, bool *removable) |
Checks whether the package is removable. | |
int | package_info_is_preload_package (package_info_h package_info, bool *preload) |
Checks whether the package is preloaded. | |
int | package_info_is_equal (package_info_h lhs, package_info_h rhs, bool *equal) |
Checks whether two package information is equal. | |
int | package_info_is_accessible (package_info_h package_info, bool *accessible) |
Checks whether the package info is accessible for the given package. | |
int | package_info_get_installed_time (package_info_h package_info, int *installed_time) |
Gets the installed time for the given package. | |
int | package_info_clone (package_info_h *clone, package_info_h package_info) |
Clones the package information handle. | |
int | package_info_create (const char *package, package_info_h *package_info) |
Gets the package information for the given package. | |
int | package_info_foreach_cert_info (package_info_h package_info, package_info_cert_info_cb callback, void *user_data) |
Retrieves certification information of the package. | |
int | package_info_foreach_privilege_info (package_info_h package_info, package_info_privilege_info_cb callback, void *user_data) |
Retrieves privilege information of the package. | |
int | package_info_updateinfo_create (const char *pkgid, package_updateinfo_h *info) |
Gets the package update information for the given package. | |
int | package_info_updateinfo_get_pkgid (package_updateinfo_h info, char **package) |
Gets the package name. | |
int | package_info_updateinfo_get_version (package_updateinfo_h info, char **version) |
Gets the update version of package. | |
int | package_info_updateinfo_get_type (package_updateinfo_h info, package_updateinfo_type_e *type) |
Gets the update type of package. | |
int | package_info_updateinfo_destroy (package_updateinfo_h info) |
Destroys the package update information handle and releases all its resources. | |
int | package_info_updateinfo_foreach_info (package_info_updateinfo_cb callback, void *user_data) |
Retrieve update information of all packages and invoke callback for each of it. | |
Typedefs | |
typedef struct package_info_s * | package_info_h |
The package information handle. | |
typedef struct package_updateinfo_s * | package_updateinfo_h |
The package update information handle. | |
typedef bool(* | package_info_updateinfo_cb )(package_updateinfo_h info, void *user_data) |
Called for each update information of all packages. | |
typedef bool(* | package_info_app_cb )(package_info_app_component_type_e comp_type, const char *app_id, void *user_data) |
Called to get the application ID once for each installed package. | |
typedef bool(* | package_info_cert_info_cb )(package_info_h handle, package_cert_type_e cert_type, const char *cert_value, void *user_data) |
Called to get the certification information. | |
typedef bool(* | package_info_privilege_info_cb )(const char *privilege_name, void *user_data) |
Called to get the privilege information. |
typedef bool(* package_info_app_cb)(package_info_app_component_type_e comp_type, const char *app_id, void *user_data) |
Called to get the application ID once for each installed package.
[in] | comp_type | The Application Component type |
[in] | callback | The callback function to be invoked |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the loop typedef bool(* package_info_cert_info_cb)(package_info_h handle, package_cert_type_e cert_type, const char *cert_value, void *user_data) |
Called to get the certification information.
[in] | package_info | The package info handle |
[in] | cert_type | The certificate type |
[in] | cert_value | The certificate value of corresponding certificate key This value is base64 encoded data. |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the loop typedef struct package_info_s* package_info_h |
The package information handle.
typedef bool(* package_info_privilege_info_cb)(const char *privilege_name, void *user_data) |
Called to get the privilege information.
[in] | privilege_name | the name of the privilege |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the loop typedef bool(* package_info_updateinfo_cb)(package_updateinfo_h info, void *user_data) |
Called for each update information of all packages.
[in] | info | The package update information handle |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the loop typedef struct package_updateinfo_s* package_updateinfo_h |
The package update information handle.
enum package_cert_type_e |
Enumeration for certification type.
int package_info_clone | ( | package_info_h * | clone, |
package_info_h | package_info | ||
) |
Clones the package information handle.
[out] | clone | The newly created package information handle |
[in] | package_info | The package information |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE | The package is not installed |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int package_info_create | ( | const char * | package, |
package_info_h * | package_info | ||
) |
Gets the package information for the given package.
[in] | package | The ID of the package |
[out] | package_info | The package information for the given 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_NO_SUCH_PACKAGE | The package is not installed |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int package_info_destroy | ( | package_info_h | package_info | ) |
Destroys the package information handle and releases all its resources.
[in] | package_info | The package information handle |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_info_foreach_app_from_package | ( | package_info_h | package_info, |
package_info_app_component_type_e | comp_type, | ||
package_info_app_cb | callback, | ||
void * | user_data | ||
) |
Retrieves all application IDs of each package.
[in] | package_info | The package info handle |
[in] | comp_type | The application component type |
[in] | callback | The callback function to invoke |
[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_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE | No such package |
int package_info_foreach_cert_info | ( | package_info_h | package_info, |
package_info_cert_info_cb | callback, | ||
void * | user_data | ||
) |
Retrieves certification information of the package.
[in] | package_info | The package information |
[in] | callback | The iteration callback function |
[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_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
int package_info_foreach_privilege_info | ( | package_info_h | package_info, |
package_info_privilege_info_cb | callback, | ||
void * | user_data | ||
) |
Retrieves privilege information of the package.
[in] | package_info | The package information |
[in] | callback | The iteration callback function |
[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_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
int package_info_get_icon | ( | package_info_h | package_info, |
char ** | path | ||
) |
Gets the absolute path to the icon image.
[in] | package_info | The package information |
[out] | path | The path of the package |
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 | I/O error |
int package_info_get_installed_storage | ( | package_info_h | package_info, |
package_info_installed_storage_type_e * | storage | ||
) |
Gets the installed storage for the given package.
[in] | package_info | The package information |
[out] | storage | The installed storage |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_info_get_installed_time | ( | package_info_h | package_info, |
int * | installed_time | ||
) |
Gets the installed time for the given package.
If the package was updated, the installed_time represents updated time. So, the meaning of 'installed time' corresponds with 'last modified time'.
[in] | package_info | The package information |
[out] | installed_time | The integer value of time_t type for installed time |
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 | Database error occurred |
int package_info_get_label | ( | package_info_h | package_info, |
char ** | label | ||
) |
Gets the label of the package.
[in] | package_info | The package information |
[out] | label | The label of the package |
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 | I/O error |
int package_info_get_main_app_id | ( | package_info_h | package_info, |
char ** | main_app_id | ||
) |
Gets the main application ID of the package.
[in] | package_info | The package information |
[out] | main_app_id | The main application ID of the package |
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 | I/O error |
int package_info_get_package | ( | package_info_h | package_info, |
char ** | package | ||
) |
Gets the package name.
[in] | package_info | The package information |
[out] | package | The package name |
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_info_get_root_path | ( | package_info_h | package_info, |
char ** | path | ||
) |
Gets the root path of the package.
[in] | package_info | The package information |
[out] | path | The root path of the package |
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 | I/O error |
int package_info_get_tep_name | ( | package_info_h | package_info, |
char ** | name | ||
) |
Gets the name of the TEP(Tizen Expansion Package).
[in] | package_info | The package information |
[out] | name | The name of the tep |
PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
PACKAGE_MANAGER_ERROR_SYSTEM_ERROR | Severe system error |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int package_info_get_type | ( | package_info_h | package_info, |
char ** | type | ||
) |
Gets the type of the package.
[in] | package_info | The package information |
[out] | 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 |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
int package_info_get_version | ( | package_info_h | package_info, |
char ** | version | ||
) |
Gets the version of the package.
[in] | package_info | The package information |
[out] | version | The version of the package |
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 | I/O error |
int package_info_is_accessible | ( | package_info_h | package_info, |
bool * | accessible | ||
) |
Checks whether the package info is accessible for the given package.
[in] | package_info | The package information |
[out] | accessible | true if the package info is accessible, otherwise false if the package info is not accessible |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_info_is_equal | ( | package_info_h | lhs, |
package_info_h | rhs, | ||
bool * | equal | ||
) |
Checks whether two package information is equal.
[in] | lhs | The first package information to be compared |
[in] | rhs | The second package information to be compared |
[out] | equal | true if the package information are equal, otherwise false if package information are not equal |
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 | Database error occurred |
int package_info_is_preload_package | ( | package_info_h | package_info, |
bool * | preload | ||
) |
Checks whether the package is preloaded.
[in] | package_info | The package information |
[out] | preload | The preload info of the package |
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 | I/O error |
int package_info_is_removable_package | ( | package_info_h | package_info, |
bool * | removable | ||
) |
Checks whether the package is removable.
[in] | package_info | The package information |
[out] | removable | The removable info of the package |
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 | IO error |
int package_info_is_system_package | ( | package_info_h | package_info, |
bool * | system | ||
) |
Checks whether the package is system package.
[in] | package_info | The package information |
[out] | system | true if the package is system package, otherwise false if the package is not system package |
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 | I/O error |
int package_info_updateinfo_create | ( | const char * | pkgid, |
package_updateinfo_h * | info | ||
) |
Gets the package update information for the given package.
[in] | pkgid | The ID of the package |
[out] | info | The package update information for the given 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_NO_SUCH_PACKAGE | The package is not installed |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
PACKAGE_MANAGER_ERROR_IO_ERROR | Database error occurred |
int package_info_updateinfo_destroy | ( | package_updateinfo_h | info | ) |
Destroys the package update information handle and releases all its resources.
[in] | info | The package update information handle |
0
on success, otherwise a negative error value PACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_info_updateinfo_foreach_info | ( | package_info_updateinfo_cb | callback, |
void * | user_data | ||
) |
Retrieve update information of all packages and invoke callback for each of it.
[in] | callback | The iteration callback function |
[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_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
int package_info_updateinfo_get_pkgid | ( | package_updateinfo_h | info, |
char ** | package | ||
) |
Gets the package name.
[in] | info | The package update information |
[out] | package | The package name |
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 occured |
int package_info_updateinfo_get_type | ( | package_updateinfo_h | info, |
package_updateinfo_type_e * | type | ||
) |
Gets the update type of package.
[in] | info | The package update information |
[out] | 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 |
PACKAGE_MANAGER_ERROR_IO_ERROR | Internal I/O error occured |
int package_info_updateinfo_get_version | ( | package_updateinfo_h | info, |
char ** | version | ||
) |
Gets the update version of package.
[in] | info | The package update information |
[out] | version | The package update 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 |
PACKAGE_MANAGER_ERROR_IO_ERROR | Internal I/O error occured |