GSList *apps; /* List of apps to launch - uam_app_info_t*/
-# define APP_CONTROL_DATA_PUSH_LAUNCH_TYPE "http://tizen.org/appcontrol/data/push/launch_type"
-# define EXTRA_DATA_FROM_REGISTRATION_CHANGE "registration_change"
+#define UA_EVENT "UA_EVENT"
-static void __uam_app_launcher(uam_app_info_t *app_info)
+#define CASE_TO_STR(x) case x: return #x;
+
+const char* __uam_event_str(int event)
+{
+ switch (event) {
+ /* CHECK: List all enum values here */
+ CASE_TO_STR(UAM_EVENT_SENSOR_STATE_READY)
+ CASE_TO_STR(UAM_EVENT_SENSOR_STATE_NOT_READY)
+ CASE_TO_STR(UAM_EVENT_USER_ADDED)
+ CASE_TO_STR(UAM_EVENT_USER_REMOVED)
+ CASE_TO_STR(UAM_EVENT_DEVICE_ADDED)
+ CASE_TO_STR(UAM_EVENT_DEVICE_REMOVED)
+ CASE_TO_STR(UAM_EVENT_PRESENCE_DETECTED)
+ CASE_TO_STR(UAM_EVENT_USER_PRESENCE_DETECTED)
+ CASE_TO_STR(UAM_EVENT_ABSENCE_DETECTED)
+ CASE_TO_STR(UAM_EVENT_USER_ABSENCE_DETECTED)
+ CASE_TO_STR(UAM_EVENT_DETECTION_STARTED)
+ CASE_TO_STR(UAM_EVENT_DETECTION_STOPPED)
+ CASE_TO_STR(UAM_EVENT_DEVICE_FOUND)
+ CASE_TO_STR(UAM_EVENT_SCAN_COMPLETED)
+ default :
+ return "Unknown Event";
+ }
+}
+
+static void __uam_app_launcher(uam_app_info_t *app_info, int event)
{
FUNC_ENTRY;
int r = 0;
bundle *bund = NULL;
bund = bundle_create();
- bundle_add(bund, APP_CONTROL_DATA_PUSH_LAUNCH_TYPE, EXTRA_DATA_FROM_REGISTRATION_CHANGE);
+ bundle_add(bund, UA_EVENT, __uam_event_str(event));
int result;
result = aul_svc_set_background_launch(bund, TRUE);
FUNC_EXIT;
}
-static void __uam_resume_app(const char *dest)
+static void __uam_resume_app(const char *dest, int event)
{
FUNC_ENTRY;
GSList *l;
UAM_INFO("app_id: [%s] ", (const char*)app_info->app_id);
UAM_INFO("uid: [%d] ", app_info->uid);
- __uam_app_launcher(app_info);
+ __uam_app_launcher(app_info, event);
}
} else {
for (l = apps; NULL != l; l = g_slist_next(l)) {
UAM_INFO("app_id: [%s] ", (const char*)app_info->app_id);
UAM_INFO("uid: [%d] ", app_info->uid);
if (!g_strcmp0(app_info->sender, dest)) {
- __uam_app_launcher(app_info);
+ __uam_app_launcher(app_info, event);
break;
}
}
dest, _uam_manager_event_to_str(event), signal);
/* Check if application requires resume before sending event */
- __uam_resume_app(dest);
+ __uam_resume_app(dest, event);
if (!g_dbus_connection_emit_signal(conn, dest, UAM_EVENT_PATH,
UAM_EVENT_INTERFACE, signal, param, &error)) {