*/
int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
+/**
+ * @fn int pkgmgrinfo_pkginfo_is_lib(pkgmgrinfo_pkginfo_h handle, bool *lib)
+ * @brief This API gets whether the given package is lib resource package or not
+ *
+ * @par This API is for package-manager client application
+ * @par Sync (or) Async : Synchronous API
+ *
+ * @param[in] handle pointer to package info handle
+ * @param[in] global pointer to hold package global value
+ * @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()
+ * @see pkgmgrinfo_pkginfo_get_pkgid()
+static int get_pkg_is_lib(const char *pkgid)
+{
+ int ret = 0;
+ bool lib;
+ pkgmgrinfo_pkginfo_h handle = NULL;
+ ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+ ret = pkgmgrinfo_pkginfo_is_lib(handle, &lib);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return -1;
+ }
+ printf("pkg lib: %d\n", lib);
+ pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
+ return 0;
+}
+ * @endcode
+ */
+int pkgmgrinfo_pkginfo_is_lib(pkgmgrinfo_pkginfo_h handle, bool *lib);
+
/**
* @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
* @brief This API gets the package 'accessible' value from the package ID
char *locale; /*no xml part*/
char *res_type; /**< res type, attr*/
char *res_version; /**< res version, attr*/
+ char *lib; /**< whether lib rpk or not, attr*/
char *is_disabled; /**< Flag that indicates if the package is disabled or not, no xml part*/
char *light_user_switch_mode; /**< light_user_switch_mode flag, attr, default: "dafault"*/
GList *icon; /**< package icon, element*/
" package TEXT NOT NULL,\n" \
" res_type TEXT NOT NULL,\n" \
" res_version TEXT NOT NULL,\n" \
+ " lib TEXT NOT NULL DEFAULT 'false',\n" \
" PRIMARY KEY(res_type, res_version)\n" \
" FOREIGN KEY(package)\n" \
" REFERENCES package_info(package) ON DELETE CASCADE)"
WriteString(parcel, package->locale);
WriteString(parcel, package->res_type);
WriteString(parcel, package->res_version);
+ WriteString(parcel, package->lib);
WriteString(parcel, package->is_disabled);
WriteString(parcel, package->light_user_switch_mode);
WriteIcon(parcel, package->icon);
ReadString(parcel, &package->locale);
ReadString(parcel, &package->res_type);
ReadString(parcel, &package->res_version);
+ ReadString(parcel, &package->lib);
ReadString(parcel, &package->is_disabled);
ReadString(parcel, &package->light_user_switch_mode);
ReadIcon(parcel, &package->icon);
free((void *)package->res_type);
if (package->res_version)
free((void *)package->res_version);
+ if (package->lib)
+ free((void *)package->lib);
if (package->is_disabled)
free((void *)package->is_disabled);
if (package->light_user_switch_mode)
g_list_free_full(package->metadata, __ps_free_metadata);
free((void *)package);
}
-
return pkgmgrinfo_pkginfo_is_global(handle, for_all_users);
}
+API int pkgmgrinfo_pkginfo_is_lib(pkgmgrinfo_pkginfo_h handle, bool *lib)
+{
+ pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
+ retvm_if(lib == NULL, PMINFO_R_EINVAL,
+ "Argument supplied to hold return value is NULL\n");
+
+ if (info->pkg_info == NULL || info->pkg_info->lib == NULL)
+ return PMINFO_R_ERROR;
+
+ *lib = _get_bool_value(info->pkg_info->lib);
+
+ return PMINFO_R_OK;
+}
+
API int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
{
pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
if (mfx->res_type == nullptr || mfx->res_version == nullptr)
return 0;
+ if (mfx->lib == nullptr)
+ mfx->lib = strdup("false");
+
auto q = tizen_base::Database::Sql(
"INSERT INTO package_res_info (package, res_type,"
- " res_version) VALUES (?, ?, ?)")
+ " res_version, lib) VALUES (?, ?, ?, ?)")
.Bind(mfx->package)
.Bind(mfx->res_type)
- .Bind(mfx->res_version);
+ .Bind(mfx->res_version)
+ .Bind(mfx->lib);
auto r = db.Exec(q);
if (!r) {
package->use_system_certs = strdup("test_use_system_certs");
package->res_type = strdup("test_res_type");
package->res_version = strdup("test_res_version");
+ package->lib = strdup("false");
package->light_user_switch_mode = strdup("default");
icon_x* icon = reinterpret_cast<icon_x*>(calloc(1, sizeof(icon_x)));