return 0;
}
+int _app_property_insert_metadata(uid_t uid, const pkgmgrinfo_appinfo_h handle)
+{
+ app_property_h app_property;
+
+ app_property = _app_property_find(uid);
+ if (app_property == NULL)
+ return -1;
+
+ if (__foreach_metadata_info(handle, app_property) != 0) {
+ _E("Failed to retrieve metadata info");
+ return -1;
+ }
+
+ return 0;
+}
+
int _app_property_delete(uid_t uid, const char *appid)
{
app_property_h app_property;
return 0;
}
-static int __load_metadata(struct app_property_s *prop)
-{
- pkgmgrinfo_appinfo_metadata_filter_h handle;
- int ret;
- GList *iter;
- struct metadata_filter *filter;
-
- ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
- if (ret != PMINFO_R_OK)
- return -1;
-
- for (iter = metadata_filters; iter; iter = g_list_next(iter)) {
- filter = (struct metadata_filter *)iter->data;
- ret = pkgmgrinfo_appinfo_metadata_filter_add(handle,
- filter->key, filter->value);
- if (ret != PMINFO_R_OK) {
- pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
- return -1;
- }
- }
-
- ret = pkgmgrinfo_appinfo_usr_metadata_filter_foreach(handle,
- __foreach_metadata_info, prop, prop->uid);
- if (ret != PMINFO_R_OK) {
- pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
- return -1;
- }
-
- ret = pkgmgrinfo_appinfo_usr_metadata_filter_foreach(handle,
- __foreach_metadata_info, prop, GLOBAL_USER);
- if (ret != PMINFO_R_OK) {
- pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
- return -1;
- }
-
- pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
-
- return 0;
-}
-
static int __load_app_property(struct app_property_s *prop)
{
struct cb_info_s cb_info;
return -1;
}
- ret = __load_metadata(prop);
- if (ret < 0) {
- _E("Failed to retrieve metadata info uid(%d) - ret(%d)",
- prop->uid, ret);
- return -1;
- }
-
return 0;
}
int _app_property_insert(uid_t uid, const char *appid,
const pkgmgrinfo_appinfo_h handle);
+int _app_property_insert_metadata(uid_t uid, const pkgmgrinfo_appinfo_h handle);
+
int _app_property_delete(uid_t uid, const char *appid);
int _app_property_load(uid_t uid);
struct user_appinfo {
uid_t uid;
GHashTable *tbl; /* key is appid, value is struct appinfo */
+ bool initializing;
};
struct app_event_info {
c->val[AIT_PKGTYPE], c->val[AIT_APPTYPE]);
g_hash_table_insert(info->tbl, c->val[AIT_NAME], c);
- _app_property_insert(info->uid, c->val[AIT_NAME], handle);
+ if (info->initializing)
+ _app_property_insert_metadata(info->uid, handle);
+ else
+ _app_property_insert(info->uid, c->val[AIT_NAME], handle);
_noti_send(AMD_NOTI_MSG_APPINFO_INSERT, info->uid, 0, handle, NULL);
return 0;
g_hash_table_insert(user_tbl, GINT_TO_POINTER(uid), info);
+ info->initializing = true;
option = PMINFO_APPINFO_GET_CATEGORY |
PMINFO_APPINFO_GET_APP_CONTROL |
PMINFO_APPINFO_GET_SPLASH_SCREEN |
- PMINFO_APPINFO_GET_RES_CONTROL;
+ PMINFO_APPINFO_GET_RES_CONTROL |
+ PMINFO_APPINFO_GET_METADATA;
r = pkgmgrinfo_appinfo_get_usr_installed_list_full(
__appinfo_insert_handler, uid, option, info);
+ info->initializing = false;
if (r != PMINFO_R_OK) {
__remove_user_appinfo(uid);
return NULL;
option = PMINFO_APPINFO_GET_CATEGORY |
PMINFO_APPINFO_GET_APP_CONTROL |
PMINFO_APPINFO_GET_SPLASH_SCREEN |
- PMINFO_APPINFO_GET_RES_CONTROL;
+ PMINFO_APPINFO_GET_RES_CONTROL |
+ PMINFO_APPINFO_GET_METADATA;
r = pkgmgrinfo_appinfo_get_usr_installed_list_full(
__appinfo_insert_handler, info->uid, option, info);
if (r != PMINFO_R_OK) {
{
.state = UID_STATE_OPENING | UID_STATE_ONLINE |
UID_STATE_ACTIVE,
- .login = _appinfo_load
+ .login = _app_property_load
},
{
.state = UID_STATE_OPENING | UID_STATE_ONLINE |
UID_STATE_ACTIVE,
- .login = _app_property_load
+ .login = _appinfo_load
},
{
.state = UID_STATE_OPENING | UID_STATE_ONLINE |