return r;
}
-static int __sys_do(struct appcore *ac, enum sys_event event)
+static int __sys_do(struct appcore *ac, void *event_info, enum sys_event event)
{
struct sys_op *op;
if (op->func == NULL)
return __sys_do_default(ac, event);
- return op->func(op->data);
+ return op->func(event_info, op->data);
}
static int __sys_lowmem_post(void *data, void *evt)
val = vconf_keynode_get_int(key);
if (val >= VCONFKEY_SYSMAN_LOW_MEMORY_SOFT_WARNING)
- return __sys_do(data, SE_LOWMEM);
+ return __sys_do(data, (void *)&val, SE_LOWMEM);
return 0;
}
/* VCONFKEY_SYSMAN_BAT_CRITICAL_LOW or VCONFKEY_SYSMAN_POWER_OFF */
if (val <= VCONFKEY_SYSMAN_BAT_CRITICAL_LOW)
- return __sys_do(data, SE_LOWBAT);
+ return __sys_do(data, (void *)&val, SE_LOWBAT);
return 0;
}
static int __sys_langchg(void *data, void *evt)
{
- return __sys_do(data, SE_LANGCHG);
+ keynode_t *key = evt;
+ char *val;
+
+ val = vconf_keynode_get_str(key);
+
+ return __sys_do(data, (void *)val, SE_LANGCHG);
}
static int __sys_regionchg_pre(void *data, void *evt)
static int __sys_regionchg(void *data, void *evt)
{
- return __sys_do(data, SE_REGIONCHG);
+ keynode_t *key = evt;
+ char *val = NULL;
+ const char *name;
+
+ name = vconf_keynode_get_name(key);
+ if (!strcmp(name, VCONFKEY_REGIONFORMAT))
+ val = vconf_keynode_get_str(key);
+
+ return __sys_do(data, (void *)val, SE_REGIONCHG);
}
static void __vconf_do(struct evt_ops *eo, keynode_t * key, void *data)
}
EXPORT_API int appcore_set_event_callback(enum appcore_event event,
- int (*cb) (void *), void *data)
+ int (*cb) (void *, void *), void *data)
{
struct appcore *ac = &core;
struct sys_op *op;