" <arg type='i' name='ret' direction='out'/>"
" <arg type='s' name='reqkey' direction='out'/>"
" </method>"
- " <method name='enable_pkg'>"
+ " <method name='enable_pkgs'>"
" <arg type='u' name='uid' direction='in'/>"
" <arg type='s' name='pkgtype' direction='in'/>"
- " <arg type='s' name='pkgid' direction='in'/>"
+ " <arg type='as' name='pkgids' direction='in'/>"
" <arg type='i' name='ret' direction='out'/>"
" </method>"
- " <method name='disable_pkg'>"
+ " <method name='disable_pkgs'>"
" <arg type='u' name='uid' direction='in'/>"
" <arg type='s' name='pkgtype' direction='in'/>"
- " <arg type='s' name='pkgid' direction='in'/>"
+ " <arg type='as' name='pkgids' direction='in'/>"
" <arg type='i' name='ret' direction='out'/>"
" </method>"
" <method name='enable_app'>"
return 0;
}
-static int __handle_request_enable_pkg(uid_t uid,
+static int __handle_request_enable_pkgs(uid_t uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
char *pkgtype = NULL;
char *pkgid = NULL;
char *reqkey = NULL;
+ GVariantIter *iter;
- g_variant_get(parameters, "(u&s&s)", &target_uid, &pkgtype, &pkgid);
- if (target_uid == (uid_t)-1 || pkgid == NULL) {
+ g_variant_get(parameters, "(u&sas)", &target_uid, &pkgtype, &iter);
+ if (target_uid == (uid_t)-1 || pkgtype == NULL || iter == NULL) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(i)", PKGMGR_R_ECOMM));
return -1;
}
- reqkey = __generate_reqkey(pkgid);
- if (reqkey == NULL) {
- g_dbus_method_invocation_return_value(invocation,
- g_variant_new("(i)", PKGMGR_R_ENOMEM));
- return -1;
- }
+ while (g_variant_iter_loop(iter, "&s", &pkgid)) {
+ reqkey = __generate_reqkey(pkgid);
+ if (reqkey == NULL) {
+ g_dbus_method_invocation_return_value(invocation,
+ g_variant_new("(i)", PKGMGR_R_ENOMEM));
+ return -1;
+ }
+
+ if (_pm_queue_push(target_uid, reqkey,
+ PKGMGR_REQUEST_TYPE_ENABLE_PKG,
+ pkgtype, pkgid, "")) {
+ g_dbus_method_invocation_return_value(invocation,
+ g_variant_new("(i)", PKGMGR_R_ESYSTEM));
+ free(reqkey);
+ return -1;
+ }
- if (_pm_queue_push(target_uid, reqkey, PKGMGR_REQUEST_TYPE_ENABLE_PKG, pkgtype,
- pkgid, "")) {
- g_dbus_method_invocation_return_value(invocation,
- g_variant_new("(i)", PKGMGR_R_ESYSTEM));
free(reqkey);
- return -1;
}
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(i)", PKGMGR_R_OK));
- free(reqkey);
return 0;
}
-static int __handle_request_disable_pkg(uid_t uid,
+static int __handle_request_disable_pkgs(uid_t uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
char *pkgtype = NULL;
char *pkgid = NULL;
char *reqkey = NULL;
+ GVariantIter *iter;
- g_variant_get(parameters, "(u&s&s)", &target_uid, &pkgtype, &pkgid);
- if (target_uid == (uid_t)-1 || pkgid == NULL) {
+ g_variant_get(parameters, "(u&sas)", &target_uid, &pkgtype, &iter);
+ if (target_uid == (uid_t)-1 || pkgtype == NULL || iter == NULL) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(i)", PKGMGR_R_ECOMM));
return -1;
}
- reqkey = __generate_reqkey(pkgid);
- if (reqkey == NULL) {
- g_dbus_method_invocation_return_value(invocation,
- g_variant_new("(i)", PKGMGR_R_ENOMEM));
- return -1;
- }
+ while (g_variant_iter_loop(iter, "&s", &pkgid)) {
+ reqkey = __generate_reqkey(pkgid);
+ if (reqkey == NULL) {
+ g_dbus_method_invocation_return_value(invocation,
+ g_variant_new("(i)", PKGMGR_R_ENOMEM));
+ return -1;
+ }
+
+ if (_pm_queue_push(target_uid, reqkey,
+ PKGMGR_REQUEST_TYPE_DISABLE_PKG,
+ pkgtype, pkgid, "")) {
+ g_dbus_method_invocation_return_value(invocation,
+ g_variant_new("(i)", PKGMGR_R_ESYSTEM));
+ free(reqkey);
+ return -1;
+ }
- if (_pm_queue_push(target_uid, reqkey, PKGMGR_REQUEST_TYPE_DISABLE_PKG, pkgtype,
- pkgid, "")) {
- g_dbus_method_invocation_return_value(invocation,
- g_variant_new("(i)", PKGMGR_R_ESYSTEM));
free(reqkey);
- return -1;
}
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(i)", PKGMGR_R_OK));
- free(reqkey);
return 0;
}
ret = __handle_request_cleardata(uid, invocation, parameters);
else if (g_strcmp0(method_name, "move") == 0)
ret = __handle_request_move(uid, invocation, parameters);
- else if (g_strcmp0(method_name, "enable_pkg") == 0)
- ret = __handle_request_enable_pkg(uid, invocation, parameters);
- else if (g_strcmp0(method_name, "disable_pkg") == 0)
- ret = __handle_request_disable_pkg(uid, invocation, parameters);
+ else if (g_strcmp0(method_name, "enable_pkgs") == 0)
+ ret = __handle_request_enable_pkgs(uid, invocation, parameters);
+ else if (g_strcmp0(method_name, "disable_pkgs") == 0)
+ ret = __handle_request_disable_pkgs(uid, invocation, parameters);
else if (g_strcmp0(method_name, "getsize") == 0)
ret = __handle_request_getsize(uid, invocation, parameters);
else if (g_strcmp0(method_name, "clearcache") == 0)