+static int get_pkg_installed_time(const char *pkgid)
+{
+ int ret = 0;
+ int installed_time = 0;
+ pkgmgrinfo_pkginfo_h handle;
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return -1;
+ }
+ printf("installed_time: %d\n", installed_time);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
+
+/**
+ * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
+ * @brief This API creates the update info handle
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[out] handle pointer to package update 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
+ * @post pkgmgrinfo_updateinfo_destroy()
+ * @see pkgmgrinfo_updateinfo_set_pkgid()
+ * @see pkgmgrinfo_updateinfo_set_version()
+ * @see pkgmgrinfo_updateinfo_set_type()
+ * @see pkgmgr_client_register_pkg_updateinfo()
+ * @code
+static int updateinfo_handle_create()
+{
+ int ret = 0;
+
+ pkgmgrinfo_updateinfo_h handle;
+ ret = pkgmgrinfo_updateinfo_create(&handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ pkgmgrinfo_update_infodestroy(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
+
+/**
+ * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
+ * @brief This API destroy the update info handle
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to package update info handle
+ * @return 0 if success, error code(<0) if fail
+ * @retval PMINFO_R_OK success
+ * @retval PMINFO_R_EINVAL invalid argument
+ * @pre pkgmgrinfo_updateinfo_create()
+ * @see pkgmgr_client_register_pkg_updateinfo()
+ * @code
+static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
+{
+ int ret = 0;
+
+ ret = pkgmgrinfo_updateinfo_destroy(handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
+
+/**
+ * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
+ * @brief This API creates the package update information handle from db
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] pkgid pointer to package ID
+ * @param[in] uid the addressee user id of the instruction
+ * @param[out] update_handle pointer to the package update 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_updateinfo_destroy()
+ * @see pkgmgrinfo_updateinfo_get_pkgid()
+ * @see pkgmgrinfo_updateinfo_get_version()
+ * @see pkgmgrinfo_updateinfo_get_update_type()
+ * @code
+static int get_pkg_update_info(const char *pkgid)
+{
+ int ret = 0;
+ char *version;
+ pkgmgrinfo_updateinfo_h handle;
+ ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_updateinfo_destroy(handle);
+ return -1;
+ }
+ printf("pkg update version: %s\n", version
+ pkgmgrinfo_updateinfo_destroy(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
+int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
+
+/**
+ * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
+ * @brief This API sets given pkgid into handle
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to package update info handle
+ * @param[in] pkgid package id
+ * @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
+ * @code
+static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
+{
+ int ret = 0;
+
+ ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
+
+/**
+ * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
+ * @brief This API sets given version into handle
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to package update info handle
+ * @param[in] version update version
+ * @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
+ * @code
+static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
+{
+ int ret = 0;
+
+ ret = pkgmgrinfo_updateinfo_set_version(handle, version);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
+
+/**
+ * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
+ * @brief This API sets given update type into handle
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to package update info handle
+ * @param[in] type update type
+ * @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
+ * @code
+static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)