return strdup(type);
}
-static const char *__get_library_path(const char *pkg_type)
+static void __get_library_path(const char *pkg_type, const char **path)
{
char buf[64];
- const char *path;
snprintf(buf, sizeof(buf), "package-manager/backendlib/lib%s.so",
pkg_type);
- path = tzplatform_mkpath(TZ_SYS_RO_ETC, buf);
- return path;
+ *path = tzplatform_mkpath(TZ_SYS_RO_ETC, buf);
}
API pkg_plugin_set *__load_library(const char *pkg_type)
bool (*on_load)(pkg_plugin_set *plugin);
const char *library_path;
- library_path = __get_library_path(pkg_type);
+ __get_library_path(pkg_type, &library_path);
if (library_path == NULL) {
_LOGE("cannot get library path for %s", pkg_type);
return NULL;
pkg_map_.clear();
app_map_.clear();
- GHashTable* list = g_hash_table_new(g_str_hash, g_str_equal);
- if (list == nullptr) {
- LOG(ERROR) << "Out of memory";
- return PMINFO_R_ERROR;
- }
-
const char* dbpath = sqlite3_db_filename(db, "main");
bool is_inmemory_db = false;
if (dbpath == nullptr || strlen(dbpath) == 0) {
if (!is_inmemory_db && !GetModifiedTime(dbpath, &start_time))
return PMINFO_R_ERROR;
+ GHashTable* list = g_hash_table_new(g_str_hash, g_str_equal);
+ if (list == nullptr) {
+ LOG(ERROR) << "Out of memory";
+ return PMINFO_R_ERROR;
+ }
+
pkgmgrinfo_filter_x tmp_filter = { 0, };
int ret = pkginfo_internal_filter_get_list(db, &tmp_filter, uid_,
locale.c_str(), list);