Hi folks,
I'd like to propose a new event delivery extension on Tizen appfw, which is
based on publish/subscribe model.
Its implementation is based on DBus and consistent interface with previous
AppControl will be provided.
This extension's major features are below:
- event broadcasting between system modules and applications with two types of
system-event and user-event.
- auto-activation for service type application
Here is typical use case for event subscription:
First of all, app developer should add event id and some properties in the
manifest file.
<ui-application appid="org.tizen.testapp2" exec="testapp2"...>
<eventsystem
eventid=“eventsystem.tizen.system.event.battery.level_changed"
on-event-launch=“false" type="system" />
<eventsystem eventid="eventsystem.org.tizen.senderapp.user_event"
on-event-launch="false" type="user" />
</ui-application>
Then, the developer could write his code like this.
static void app_control(app_control_h app_control, void *data) {
char *eventname = NULL;
app_control_get_event_name(app_control, &eventname);
if (strcmp(eventname, SYS_EVENT_BATTERY_BATTERY_CHANGED) == 0) {
_LOGD("event name is [%s]", eventname);
}
free(eventname);
}
Assume that service app broadcasts event like below.
void func( ) {
bundle *data=bundle_create();
bundle_add(data, “user_data_key1”, ”user_data_1");
app_control_send_user_event(“eventsystem.org.tizen.senderapp.user_event”,
data);
bundle_free(data);
}
Whenever those kind of events are published, the app could get subscribed and
invoke the proper callback.
Here are all interfaces that I'm designing.
- int app_control_get_event_name(app_control_h app_control, char **event_name);
- int app_control_get_event_data(app_control_h app_control, bundle
**event_data);
- int app_control_send_user_event(const char *event_name, bundle *event_data);
- int app_control_send_user_event_trusted(const char *event_name, bundle
*event_data);
I created a new JIRA issue, TC2473 (https://bugs.tizen.org/jira/browse/TC-2473).
Welcome any idea to improve this proposal.
Best regards,
Jiwoong Im
_______________________________________________
Dev mailing list
[email protected]
https://lists.tizen.org/listinfo/dev