Tizen Native API
|
Functions | |
int | package_manager_create (package_manager_h *manager) |
Creates a package manager handle. | |
int | package_manager_destroy (package_manager_h manager) |
Destroys the package manager handle. | |
int | package_manager_set_event_status (package_manager_h manager, int status_type) |
Sets the event status of the package when the package is installed, uninstalled or updated. You can combine multiple status using OR operation which you want to listen. | |
int | package_manager_set_event_cb (package_manager_h manager, package_manager_event_cb callback, void *user_data) |
Registers a callback function to be invoked when the package is installed, uninstalled or updated. | |
int | package_manager_unset_event_cb (package_manager_h manager) |
Unregisters the callback function. | |
int | package_manager_foreach_package_info (package_manager_package_info_cb callback, void *user_data) |
Retrieves all package information of installed packages. | |
int | package_manager_get_package_id_by_app_id (const char *app_id, char **package_id) |
Gets the package ID for the given app ID. | |
int | package_manager_get_package_info (const char *package_id, package_info_h *package_info) |
Gets the package information for the given package. | |
int | package_manager_compare_package_cert_info (const char *lhs_package_id, const char *rhs_package_id, package_manager_compare_result_type_e *compare_result) |
Compares whether two package certifications are matched. | |
int | package_manager_compare_app_cert_info (const char *lhs_app_id, const char *rhs_app_id, package_manager_compare_result_type_e *compare_result) |
Compares whether two app certifications are matched. | |
int | package_manager_is_preload_package_by_app_id (const char *app_id, bool *preload) |
Checks whether the package is preloaded by app_id. | |
int | package_manager_get_permission_type (const char *app_id, package_manager_permission_type_e *permission_type) |
Gets the package permission type by app_id. | |
int | package_manager_filter_create (package_manager_filter_h *handle) |
Creates the package information filter handle from db. | |
int | package_manager_filter_destroy (package_manager_filter_h handle) |
This API destroys the package information filter handle freeing up all the resources. | |
int | package_manager_filter_add_bool (package_manager_filter_h handle, const char *property, const bool value) |
This API adds a boolean filter property to the filter handle. | |
int | package_manager_filter_count (package_manager_filter_h handle, int *count) |
This API counts the package that satisfy the filter conditions. | |
int | package_manager_filter_foreach_package_info (package_manager_filter_h handle, package_manager_package_info_cb callback, void *user_data) |
This API executes the user supplied callback function for each package that satisfy the filter conditions. | |
Typedefs | |
typedef struct package_manager_s * | package_manager_h |
The Package manager handle. | |
typedef struct package_manager_filter_s * | package_manager_filter_h |
Package manager filter handle. | |
typedef void(* | package_manager_event_cb )(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 package is installed, uninstalled or updated, and the progress of the request to the package manager changes. | |
typedef bool(* | package_manager_package_info_cb )(package_info_h package_info, void *user_data) |
Called to retrieve all packages. | |
Defines | |
#define | PACKAGE_MANAGER_PKGINFO_PROP_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package is removable or not based on package info. | |
#define | PACKAGE_MANAGER_PKGINFO_PROP_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package is readonly or not based on package info. | |
#define | PACKAGE_MANAGER_PKGINFO_PROP_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package supports disable or not based on package info. | |
#define | PACKAGE_MANAGER_PKGINFO_PROP_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package is disabled based on package info. | |
#define | PACKAGE_MANAGER_PKGINFO_PROP_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package is preload or not based on package info. |
The package manager is one of the core modules of Tizen application framework, and responsible for getting their information. You can also retrieve information related to the packages that are installed on the device.
#include <package_manager.h>
The Package Manager API provides functions to retrieve information related to the packages and also provides event listening function. You can get the status of package using package_manager_set_event_status() and package_manager_set_event_cb(). If you register package_manager_event_cb(), it is invoked when a package is installed, uninstalled or updated.
#define PACKAGE_MANAGER_PKGINFO_PROP_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package is disabled based on package info.
#define PACKAGE_MANAGER_PKGINFO_PROP_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package is preload or not based on package info.
#define PACKAGE_MANAGER_PKGINFO_PROP_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package is readonly or not based on package info.
#define PACKAGE_MANAGER_PKGINFO_PROP_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package is removable or not based on package info.
#define PACKAGE_MANAGER_PKGINFO_PROP_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE" |
Value to be used when filtering based on install location: Boolean property for filtering whether the package supports disable or not based on package info.
typedef void(* package_manager_event_cb)(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 package is installed, uninstalled or updated, and the progress of the request to the package manager changes.
[in] | type | The type of the package to be installed, uninstalled or updated |
[in] | package | The name of the package to be installed, uninstalled or updated |
[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_set_event_cb() |
typedef struct package_manager_filter_s* package_manager_filter_h |
Package manager filter handle.
typedef struct package_manager_s* package_manager_h |
The Package manager handle.
typedef bool(* package_manager_package_info_cb)(package_info_h package_info, void *user_data) |
Called to retrieve all packages.
[in] | package_info | The package information |
[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 loopEnumeration for certification compare type.
Enumeration for error code.
Enumeration for status type.
int package_manager_compare_app_cert_info | ( | const char * | lhs_app_id, |
const char * | rhs_app_id, | ||
package_manager_compare_result_type_e * | compare_result | ||
) |
Compares whether two app certifications are matched.
[in] | lhs_app_id | The first app ID to compare |
[in] | rhs_app_id | The second app ID to compare |
[out] | compare_result | 0 if the certification information are matched, otherwise the compared result |
0
on success, otherwise a negative error valuePACKAGE_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_manager_compare_package_cert_info | ( | const char * | lhs_package_id, |
const char * | rhs_package_id, | ||
package_manager_compare_result_type_e * | compare_result | ||
) |
Compares whether two package certifications are matched.
[in] | lhs_package_id | The first package ID to compare |
[in] | rhs_package_id | The second package ID to compare |
[out] | compare_result | 0 if the certification information are matched, otherwise the compared result |
0
on success, otherwise a negative error valuePACKAGE_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_manager_create | ( | package_manager_h * | manager | ) |
Creates a package manager handle.
[out] | manager | The package manager handle that is newly created on success |
0
on success, otherwise a negative error valuePACKAGE_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 |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int package_manager_destroy | ( | package_manager_h | manager | ) |
Destroys the package manager handle.
[in] | manager | The package manager handle |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int package_manager_filter_add_bool | ( | package_manager_filter_h | handle, |
const char * | property, | ||
const bool | value | ||
) |
This API adds a boolean filter property to the filter handle.
[in] | handle | Pointer to the package info filter handle. |
[in] | property | boolean property name. |
[in] | value | value corresponding to the property. |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
int package_manager_filter_count | ( | package_manager_filter_h | handle, |
int * | count | ||
) |
This API counts the package that satisfy the filter conditions.
[in] | handle | Pointer to the package info filter handle. |
[out] | count | Pointer to store the count value. |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
int package_manager_filter_create | ( | package_manager_filter_h * | handle | ) |
Creates the package information filter handle from db.
All filter properties will be ANDed.
[out] | handle | Pointer to the package info filter handle. |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
int package_manager_filter_destroy | ( | package_manager_filter_h | handle | ) |
This API destroys the package information filter handle freeing up all the resources.
[in] | handle | Pointer to the package info filter handle. |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
int package_manager_filter_foreach_package_info | ( | package_manager_filter_h | handle, |
package_manager_package_info_cb | callback, | ||
void * | user_data | ||
) |
This API executes the user supplied callback function for each package that satisfy the filter conditions.
[in] | handle | Pointer to the package info filter handle. |
[in] | callback | callback function. |
[in] | user_data | user data to be passed to the callback function |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | I/O error |
int package_manager_foreach_package_info | ( | package_manager_package_info_cb | callback, |
void * | user_data | ||
) |
Retrieves all package information of installed packages.
[in] | callback | The callback function to be invoked |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int package_manager_get_package_id_by_app_id | ( | const char * | app_id, |
char ** | package_id | ||
) |
Gets the package ID for the given app ID.
[in] | app_id | The ID of the application |
[out] | package_id | The ID of the package |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int package_manager_get_package_info | ( | const char * | package_id, |
package_info_h * | package_info | ||
) |
Gets the package information for the given package.
[in] | package_id | The ID of the package |
[out] | package_info | The package information for the given package ID |
0
on success, otherwise a negative error valuePACKAGE_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 |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int package_manager_get_permission_type | ( | const char * | app_id, |
package_manager_permission_type_e * | permission_type | ||
) |
Gets the package permission type by app_id.
[in] | app_id | The ID of the application |
[out] | permission_type | The package permission type |
0
on success, otherwise a negative error valuePACKAGE_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 |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int package_manager_is_preload_package_by_app_id | ( | const char * | app_id, |
bool * | preload | ||
) |
Checks whether the package is preloaded by app_id.
[in] | app_id | The ID of the application |
[out] | preload | The preload info of the package |
0
on success, otherwise a negative error valuePACKAGE_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 |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int package_manager_set_event_cb | ( | package_manager_h | manager, |
package_manager_event_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be invoked when the package is installed, uninstalled or updated.
[in] | manager | The package manager 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 valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int package_manager_set_event_status | ( | package_manager_h | manager, |
int | status_type | ||
) |
Sets the event status of the package when the package is installed, uninstalled or updated. You can combine multiple status using OR operation which you want to listen.
[in] | manager | The package manager handle |
[in] | status_type | The status of the package |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
PACKAGE_MANAGER_ERROR_IO_ERROR | Internal I/O error |
int package_manager_unset_event_cb | ( | package_manager_h | manager | ) |
Unregisters the callback function.
[in] | manager | The package manager handle |
0
on success, otherwise a negative error valuePACKAGE_MANAGER_ERROR_NONE | Successful |
PACKAGE_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |