return ret;
}
-static void storageUG_get_cache_files_size(pkgmgr_client *pc,
- const pkg_size_info_t *size_info, void *user_data)
-{
- SETTING_TRACE_BEGIN;
- setting_retm_if(NULL == user_data, "user_data is NULL");
- setting_retm_if(NULL == size_info, "size_info is NULL");
- /*char * path = app_get_cache_path(); */
- /*SETTING_TRACE_DEBUG("cache path:%s",path); */
- SettingStorageUG *ad = user_data;
- ad->sz_caches = (double) (size_info->cache_size
- + size_info->ext_cache_size);
- SETTING_TRACE_DEBUG("ad->sz_caches:%lf", ad->sz_caches);
- storageug_genlist_text_update(ad->caches, ad->sz_caches);
-
- setting_retm_if(!ad->pie_it, "!ad->pie_it");
- elm_genlist_item_update(ad->pie_it);
-
- pkgmgr_client_free(ad->pc_total_size);
- ad->pc_total_size = NULL;
- SETTING_TRACE_END;
-}
int storageUg_get_internal_detail(SettingStorageUG *ad)
{
return SETTING_RETURN_SUCCESS;
}
-void storageUG_update_cache_info(SettingStorageUG *ad)
+static void storageUG_get_app_cache_size_cb(pkgmgr_client *pc,
+ const pkg_size_info_t *size_info, void *user_data)
{
+ SETTING_TRACE_BEGIN;
+ setting_retm_if(NULL == user_data, "user_data is NULL");
+ setting_retm_if(NULL == size_info, "size_info is NULL");
- /*package_manager_get_total_package_size_info(
- * storageUG_get_cache_files_size, ad); */
- int ret;
-
- ret_if(NULL == ad);
- if (ad->pc_total_size)
- pkgmgr_client_free(ad->pc_total_size);
+ /*char * path = app_get_cache_path(); */
+ /*SETTING_TRACE_DEBUG("cache path:%s",path); */
+
+ SettingStorageUG *ad = user_data;
- ad->pc_total_size = pkgmgr_client_new(PC_REQUEST);
- if (NULL == ad->pc_total_size) {
- SETTING_TRACE_ERROR("pkgmgr_client_new() Fail");
- return;
- }
+ ad->sz_apps = (double) (size_info->app_size + size_info->ext_app_size);
+ ad->sz_caches = (double) (size_info->cache_size + size_info->ext_cache_size);
+
+ SETTING_TRACE_DEBUG("size_info->app_size : %ld", ad->sz_apps);
+ SETTING_TRACE_DEBUG("ad->sz_caches:%lf", ad->sz_caches);
+
+ storageug_genlist_text_update(ad->apps, ad->sz_apps);
+ storageug_genlist_text_update(ad->caches, ad->sz_caches);
- ret = pkgmgr_client_get_total_package_size_info(ad->pc_total_size,
- storageUG_get_cache_files_size, ad);
+ setting_retm_if(!ad->pie_it, "!ad->pie_it");
+ elm_genlist_item_update(ad->pie_it);
- warn_if(ret, "pkgmgr_client_get_total_package_size_info() Fail(%d)",
- ret);
+ pkgmgr_client_free(ad->pc_total_size);
+ ad->pc_total_size = NULL;
+ SETTING_TRACE_END;
}
-static int storageUg_get_apps_info(uid_t target_uid, int req_id,
- const char *pkg_type, const char *pkgid, const char *key,
- const char *val, const void *pmsg, void *data)
+void storageUG_update_apps_cache_info(SettingStorageUG *ad)
{
- SettingStorageUG *ad = data;
-
- retv_if(NULL == data, 0);
- retv_if(NULL == val, 0);
-
- ad->sz_apps = atof(val);
-
- storageug_genlist_text_update(ad->apps, ad->sz_apps);
- setting_retvm_if(!ad->pie_it, 0, "!ad->pie_it");
- elm_genlist_item_update(ad->pie_it);
- return 0;
-}
+ SETTING_TRACE_BEGIN;
+
-void storageUG_update_apps_info(SettingStorageUG *ad)
-{
int ret;
ret_if(NULL == ad);
- if (ad->pc)
- pkgmgr_client_free(ad->pc);
+ if (ad->pc_total_size)
+ pkgmgr_client_free(ad->pc_total_size);
- ad->pc = pkgmgr_client_new(PC_REQUEST);
- if (NULL == ad->pc) {
+ ad->pc_total_size = pkgmgr_client_new(PC_REQUEST);
+ if (NULL == ad->pc_total_size) {
SETTING_TRACE_ERROR("pkgmgr_client_new() Fail");
return;
}
- ret = pkgmgr_client_get_size(ad->pc, "get", PM_GET_ALL_PKGS,
- &storageUg_get_apps_info, ad);
- warn_if(ret, "pkgmgr_client_get_size() Fail(%d)", ret);
+ ret = pkgmgr_client_get_total_package_size_info(ad->pc_total_size,
+ storageUG_get_app_cache_size_cb, ad);
+
+ setting_retm_if(ret, "pkgmgr_client_get_total_package_size_info() Fail(%d)", ret);
+
}