Change pkginfo getter function 46/159446/2
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 9 Nov 2017 02:50:01 +0000 (11:50 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 10 Nov 2017 05:08:10 +0000 (05:08 +0000)
- pkgmgrinfo_pkginfo_get_usr_list retrieves whole information
  even it doesn't used by getsize.
- get_usr_list_full will retrieve minimum information
  but it's enough for pkg_getsize's purpose.

Change-Id: I92e04f83e872824f717202f4bc035d038716f311
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/pkg_getsize.c

index fb47829..5649ebc 100644 (file)
@@ -909,8 +909,9 @@ int main(int argc, char *argv[])
                break;
        case PM_GET_ALL_PKGS:
                /* send result to file */
-               ret = pkgmgrinfo_pkginfo_get_usr_list(
-                       __get_total_pkg_size_info_cb, &info, target_uid);
+               ret = pkgmgrinfo_pkginfo_get_usr_list_full(
+                       __get_total_pkg_size_info_cb,
+                       PMINFO_PKGINFO_GET_BASICINFO, &info, target_uid);
                if (ret < 0)
                        LOGE("failed to get all packages");
                else
@@ -918,8 +919,8 @@ int main(int argc, char *argv[])
                break;
        case PM_GET_SIZE_INFO:
                /* send each result to signal */
-               ret = pkgmgrinfo_pkginfo_get_usr_list(__send_sizeinfo_cb,
-                       pi, target_uid);
+               ret = pkgmgrinfo_pkginfo_get_usr_list_full(__send_sizeinfo_cb,
+                       PMINFO_PKGINFO_GET_BASICINFO, pi, target_uid);
                if (ret < 0)
                        LOGE("failed to get all packages");
                break;
@@ -936,8 +937,9 @@ int main(int argc, char *argv[])
                break;
        case PM_GET_TOTAL_PKG_SIZE_INFO:
                /* send result to signal */
-               ret = pkgmgrinfo_pkginfo_get_usr_list(
-                       __get_total_pkg_size_info_cb, &info, target_uid);
+               ret = pkgmgrinfo_pkginfo_get_usr_list_full(
+                       __get_total_pkg_size_info_cb,
+                       PMINFO_PKGINFO_GET_BASICINFO, &info, target_uid);
                if (ret < 0)
                        LOGE("failed to get all packages");
                else