ERR("mpc->ctype is not PC_REQUEST");
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc, "getsize",
- g_variant_new("(usi)", uid, pkgid, get_type));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+
+ ret = comm_client_request(mpc->info.request.cc, "getsize",
+ g_variant_new("(usi)", uid, pkgid, get_type), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
static int __check_app_process(pkgmgr_request_service_type service_type,
pkgmgr_client *pc, const char *pkgid, uid_t uid, void *data)
{
- GVariant *result = NULL;
+ GVariant *result;
int ret = PKGMGR_R_ECOMM;
pkgmgrinfo_pkginfo_h handle;
int pid = -1;
retvm_if(ret < 0, PKGMGR_R_ERROR, "pkgmgrinfo_pkginfo_get_pkginfo failed");
if (service_type == PM_REQUEST_KILL_APP)
- result = comm_client_request(mpc->info.request.cc, "kill",
- g_variant_new("(us)", uid, pkgid));
+ ret = comm_client_request(mpc->info.request.cc, "kill",
+ g_variant_new("(us)", uid, pkgid), &result);
else if (service_type == PM_REQUEST_CHECK_APP)
- result = comm_client_request(mpc->info.request.cc, "check",
- g_variant_new("(us)", uid, pkgid));
+ ret = comm_client_request(mpc->info.request.cc, "check",
+ g_variant_new("(us)", uid, pkgid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
- if (result == NULL)
- return PKGMGR_R_ECOMM;
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
if (ret != PKGMGR_R_OK) {
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc, "getsize",
- g_variant_new("(usi)", uid, "size_info", PM_GET_SIZE_INFO));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "getsize",
+ g_variant_new("(usi)", uid, "size_info",
+ PM_GET_SIZE_INFO),
+ &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
args = g_variant_new("as", builder);
g_variant_builder_unref(builder);
- result = comm_client_request(mpc->info.request.cc, "install",
- g_variant_new("(uss@as)", uid, pkgtype, pkg_path, args));
+ ret = comm_client_request(mpc->info.request.cc, "install",
+ g_variant_new("(uss@as)", uid, pkgtype, pkg_path, args),
+ &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
- if (result == NULL)
- return PKGMGR_R_ECOMM;
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
g_variant_unref(result);
return PKGMGR_R_ERROR;
}
- result = comm_client_request(mpc->info.request.cc, "reinstall",
- g_variant_new("(uss)", uid, pkgtype, pkgid));
+ ret = comm_client_request(mpc->info.request.cc, "reinstall",
+ g_variant_new("(uss)", uid, pkgtype, pkgid), &result);
pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
g_variant_unref(result);
return PKGMGR_R_ERROR;
}
- /* TODO: check removable ? */
-
- result = comm_client_request(mpc->info.request.cc, "uninstall",
- g_variant_new("(uss)", uid, pkgtype, pkgid));
- if (result == NULL) {
+ ret = comm_client_request(mpc->info.request.cc, "uninstall",
+ g_variant_new("(uss)", uid, pkgtype, pkgid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
- return PKGMGR_R_ECOMM;
+ return ret;
}
+
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
g_variant_unref(result);
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc, "move",
- g_variant_new("(uss)", uid, pkg_type, pkgid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "move",
+ g_variant_new("(uss)", uid, pkg_type, pkgid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc, "enable_pkg",
- g_variant_new("(uss)", uid, pkg_type, pkgid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "enable_pkg",
+ g_variant_new("(uss)", uid, pkg_type, pkgid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc, "disable_pkg",
- g_variant_new("(uss)", uid, pkg_type, pkgid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "disable_pkg",
+ g_variant_new("(uss)", uid, pkg_type, pkgid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
return PKGMGR_R_ESYSTEM;
}
- result = comm_client_request(mpc->info.request.cc, "enable_app",
- g_variant_new("(us)", uid, appid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "enable_app",
+ g_variant_new("(us)", uid, appid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
g_variant_unref(result);
return PKGMGR_R_ESYSTEM;
}
- result = comm_client_request(mpc->info.request.cc, "enable_global_app_for_uid",
- g_variant_new("(us)", uid, appid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "enable_global_app_for_uid",
+ g_variant_new("(us)", uid, appid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
g_variant_unref(result);
return PKGMGR_R_ESYSTEM;
}
- result = comm_client_request(mpc->info.request.cc, "disable_app",
- g_variant_new("(us)", uid, appid));
+ ret = comm_client_request(mpc->info.request.cc, "disable_app",
+ g_variant_new("(us)", uid, appid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
- if (result == NULL)
- return PKGMGR_R_ECOMM;
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
g_variant_unref(result);
return PKGMGR_R_ESYSTEM;
}
- result = comm_client_request(mpc->info.request.cc, "disable_global_app_for_uid",
- g_variant_new("(us)", uid, appid));
+ ret = comm_client_request(mpc->info.request.cc, "disable_global_app_for_uid",
+ g_variant_new("(us)", uid, appid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
- if (result == NULL)
- return PKGMGR_R_ECOMM;
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
g_variant_unref(result);
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc, "cleardata",
- g_variant_new("(uss)", uid, pkg_type, appid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "cleardata",
+ g_variant_new("(uss)", uid, pkg_type, appid), &result);
+ if (ret == PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
return PKGMGR_R_ESYSTEM;
}
- result = comm_client_request(pc->info.request.cc, "clearcache",
- g_variant_new("(us)", uid, pkgid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(pc->info.request.cc, "clearcache",
+ g_variant_new("(us)", uid, pkgid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
get_type = PM_GET_TOTAL_PKG_SIZE_INFO;
else
get_type = PM_GET_PKG_SIZE_INFO;
- result = comm_client_request(mpc->info.request.cc, "getsize",
- g_variant_new("(usi)", uid, pkgid, get_type));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+
+ ret = comm_client_request(mpc->info.request.cc, "getsize",
+ g_variant_new("(usi)", uid, pkgid, get_type), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
get_type = PM_GET_TOTAL_PKG_SIZE_INFO;
else
get_type = PM_GET_PKG_SIZE_INFO;
- result = comm_client_request(mpc->info.request.cc, "getsize",
- g_variant_new("(usi)", uid, pkgid, get_type));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+
+ ret = comm_client_request(mpc->info.request.cc, "getsize",
+ g_variant_new("(usi)", uid, pkgid, get_type), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
g_variant_get(result, "(i&s)", &ret, &req_key);
if (req_key == NULL) {
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc,
+ ret = comm_client_request(mpc->info.request.cc,
"generate_license_request",
- g_variant_new("(s)", resp_data));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ g_variant_new("(s)", resp_data), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
g_variant_get(result, "(i&s&s)", &ret, &data, &url);
if (ret != PKGMGR_R_OK) {
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc,
- "register_license", g_variant_new("(s)", resp_data));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc,
+ "register_license", g_variant_new("(s)", resp_data),
+ &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc,
- "decrypt_package", g_variant_new("(ss)",
- drm_file_path, decrypted_file_path));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc,
+ "decrypt_package",
+ g_variant_new("(ss)", drm_file_path,
+ decrypted_file_path),
+ &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc, "add_blacklist",
- g_variant_new("(us)", uid, pkgid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "add_blacklist",
+ g_variant_new("(us)", uid, pkgid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc, "remove_blacklist",
- g_variant_new("(us)", uid, pkgid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "remove_blacklist",
+ g_variant_new("(us)", uid, pkgid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(i)", &ret);
g_variant_unref(result);
return PKGMGR_R_EINVAL;
}
- result = comm_client_request(mpc->info.request.cc, "check_blacklist",
- g_variant_new("(us)", uid, pkgid));
- if (result == NULL)
- return PKGMGR_R_ECOMM;
+ ret = comm_client_request(mpc->info.request.cc, "check_blacklist",
+ g_variant_new("(us)", uid, pkgid), &result);
+ if (ret != PKGMGR_R_OK) {
+ ERR("request failed: %d", ret);
+ return ret;
+ }
+
g_variant_get(result, "(ii)", &b, &ret);
g_variant_unref(result);
-
if (ret != PKGMGR_R_OK)
return ret;