+ char *pkgid = NULL;
+ pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
+ printf("pkgid : %s\n", pkgid);
+ return 0;
+}
+
+static int get_pkg_list(const char *mkey, const char *mvalue)
+{
+ int ret = 0;
+ pkgmgrinfo_pkginfo_metadata_filter_h handle;
+ ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
+ return -1;
+ }
+ ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
+ return -1;
+ }
+ pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_pkginfo_metadata_filter_add(pkgmgrinfo_pkginfo_metadata_filter_h handle,
+ const char *key, const char *value);
+
+/**
+ * @fn int pkgmgrinfo_pkginfo_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
+ * @fn int pkgmgrinfo_pkginfo_usr_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid)
+ * @brief This API executes the filter query. The query will search the entire package metadata information collected from
+ * the manifest file of all the installed packages. For each package returned by the query, the callback will be called. If callback returns
+ * negative value, no more callbacks will be called and API will return.
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to the package metadata info filter handle.
+ * @param[in] app_cb function pointer to callback
+ * @param[in] user_data pointer to user data
+ * @param[in] uid the addressee user id of the instruction
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
+ * @post pkgmgrinfo_pkginfo_metadata_filter_destroy()
+ * @code
+int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
+{
+ char *pkgid = NULL;
+ pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
+ printf("pkgid : %s\n", pkgid);
+ return 0;
+}
+
+static int get_pkg_list(const char *mkey, const char *mvalue)
+{
+ int ret = 0;
+ pkgmgrinfo_pkginfo_metadata_filter_h handle;
+ ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
+ return -1;
+ }
+ ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
+ return -1;
+ }
+ pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_pkginfo_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle,
+ pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
+int pkgmgrinfo_pkginfo_usr_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle,
+ pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
+
+/* TODO: add doxygen comment here */
+int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
+
+/**
+ * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
+ * @brief This API copy the application information handle
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to the package info handle.
+ * @param[out] handle pointer to the package info handle.
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ * @pre None
+ * @post pkgmgrinfo_appinfo_destroy_appinfo()
+ * @code
+static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
+{
+ int ret = 0;
+
+ pkgmgrinfo_pkginfo_h clone;
+
+ ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
+ if (ret != PMINFO_R_OK)
+ return -1;
+
+
+ printf("package: %s\n", clone->package);
+ pkgmgrinfo_appinfo_destroy_appinfo(clone);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
+
+
+/**
+ * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
+ pkgmgrinfo_app_list_cb app_func, void *user_data)
+ * @brief This API gets list of installed applications for a particular package
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ * @param[in] handle package info handle
+ * @param[in] component application component
+ * @param[in] app_func iteration function for list
+ * @param[in] user_data user data to be passed to callback function
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ * @pre pkgmgrinfo_pkginfo_get_pkginfo()
+ * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
+ * @code
+int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
+{
+ char *appid = NULL;
+ pkgmgrinfo_appinfo_get_appid(handle, &appid);
+ printf("appid : %s\n", appid);
+ return 0;
+}
+
+static int list_apps(const char *pkgid)
+{
+ int ret = 0;
+ pkgmgrinfo_pkginfo_h handle;
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return -1;
+ }
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
+ pkgmgrinfo_app_list_cb app_func, void *user_data);
+int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
+ pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
+
+/**
+ * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
+ * @brief This API gets list of installed applications from all packages.
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ * @param[in] app_func iteration function for list
+ * @param[in] user_data user data to be passed to callback function
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ * @pre None
+ * @post None
+ * @code
+int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
+{
+ char *pkgid1 = NULL;
+ char *pkgid2 = NULL;
+ pkgid1 = (char *)user_data;
+ pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
+ if (strcmp(pkgid1, pkgid2) == 0) {
+ return -1;
+ } else {
+ return 0;
+ }
+}
+
+static int list_apps()
+{
+ int ret = 0;
+ char *name = "helloworld";
+ ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
+ if (ret != PMINFO_R_OK) {
+ return -1;
+ }
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
+int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
+
+/**
+ * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
+ * @brief This API creates the disabled application information handle from db
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] appid pointer to appid
+ * @param[out] handle pointer to the application info handle.
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @retval PMINFO_R_ERROR internal error
+ * @pre None
+ * @post pkgmgrinfo_appinfo_destroy_appinfo()
+ * @see pkgmgrinfo_appinfo_get_pkgid()
+ * @see pkgmgrinfo_appinfo_is_multiple()
+ * @code
+static int get_disabled_app_type(const char *appid)
+{
+ int ret = 0;
+ char *type = NULL;
+ pkgmgrinfo_appinfo_h handle;
+ ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);