return ret;
}
+static int __process_set_app_icon(struct backend_job *job)
+{
+ int ret;
+
+ ret = pkgmgr_parser_update_app_icon_info_in_usr_db(job->pkgid,
+ job->target_uid, job->args);
+ _return_value_to_caller(job->req_id, g_variant_new("(i)", ret));
+
+ return ret;
+}
+
static int __process_migrate_external_image(struct backend_job *job)
{
char *backend_cmd;
ret = __process_set_app_label(job);
_free_backend_job(job);
break;
+ case REQUEST_TYPE_SET_APP_ICON:
+ ret = __process_set_app_icon(job);
+ _free_backend_job(job);
+ break;
case REQUEST_TYPE_MIGRATE_EXTERNAL_IMAGE:
__set_backend_busy(x);
__set_power_lock();
" <arg type='s' name='label' direction='in'/>"
" <arg type='i' name='ret' direction='out'/>"
" </method>"
+ " <method name='set_app_icon'>"
+ " <arg type='u' name='uid' direction='in'/>"
+ " <arg type='s' name='appid' direction='in'/>"
+ " <arg type='s' name='icon_path' direction='in'/>"
+ " <arg type='i' name='ret' direction='out'/>"
+ " </method>"
" <method name='migrate_external_image'>"
" <arg type='u' name='uid' direction='in'/>"
" <arg type='s' name='pkgid' direction='in'/>"
return 0;
}
+static int __handle_request_set_app_icon(uid_t uid,
+ GDBusMethodInvocation *invocation, GVariant *parameters)
+{
+ uid_t target_uid = (uid_t)-1;
+ char *appid = NULL;
+ char *icon_path = NULL;
+ char *reqkey;
+
+ g_variant_get(parameters, "(uss)", &target_uid, &appid, &icon_path);
+ if (target_uid == (uid_t)-1 || appid == NULL || icon_path == NULL) {
+ g_dbus_method_invocation_return_value(invocation,
+ g_variant_new("(i)", PKGMGR_R_ECOMM));
+ return -1;
+ }
+
+ reqkey = __generate_reqkey("app_icon");
+ if (reqkey == NULL) {
+ g_dbus_method_invocation_return_value(invocation,
+ g_variant_new("(i)", PKGMGR_R_ENOMEM));
+ return -1;
+ }
+
+ if (_push_queue(target_uid, uid, reqkey,
+ REQUEST_TYPE_SET_APP_ICON,
+ "default", appid, icon_path, NULL)) {
+ g_dbus_method_invocation_return_value(invocation,
+ g_variant_new("(i)", PKGMGR_R_ESYSTEM));
+ free(reqkey);
+ return -1;
+ }
+
+ if (!g_hash_table_insert(req_table, (gpointer)reqkey,
+ (gpointer)invocation))
+ ERR("reqkey already exists");
+
+ return 0;
+}
+
static int __handle_request_migrate_external_image(uid_t uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
parameters);
else if (g_strcmp0(method_name, "set_app_label") == 0)
ret = __handle_request_set_app_label(uid, invocation, parameters);
+ else if (g_strcmp0(method_name, "set_app_icon") == 0)
+ ret = __handle_request_set_app_icon(uid, invocation, parameters);
else if (g_strcmp0(method_name, "migrate_external_image") == 0)
ret = __handle_request_migrate_external_image(uid, invocation,
parameters);