FUNC_ENTRY;
GSList *db_users;
GSList *db_devices;
+ GSList *db_svc_list;
GSList *l;
/* Init database */
users = g_slist_prepend(users, user);
}
+ /* Fetch service list */
+ db_svc_list = _ua_service_db_get_all_services();
+ if (!db_svc_list) {
+ UAM_INFO_C("No services in database");
+ return UAM_ERROR_NONE;
+ }
+
+ for (l = db_svc_list; NULL != l; l = g_slist_next(l)) {
+ db_service_info_t *db_svc = l->data;
+ uam_db_service_info_t *service;
+ GSList *l1;
+
+ if (!db_svc)
+ continue;
+
+ l1 = g_slist_find_custom(services,
+ db_svc->service_name, __compare_svc_name);
+ if (!l1) {
+ service = g_new0(uam_db_service_info_t, 1);
+ service->name = g_strdup(db_svc->service_name);
+ service->cycle = db_svc->cycle;
+ services = g_slist_append(services, service);
+ }
+ }
+
/* Fetch device list */
db_devices = _ua_device_db_get_all_devices();
if (!db_devices) {
g_slist_free_full(db_devices, g_free);
g_slist_free_full(db_users, g_free);
+ g_slist_free_full(db_svc_list, g_free);
/* Set/update registered device list to plugins */
if (UAM_ERROR_NONE != _uam_pm_set_registered_devices(devices))
int service_number = 0;
retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
- retv_if(0 == g_strcmp0(svc_name, UAM_SERVICE_DEFAULT), UAM_ERROR_PERMISSION_DENIED);
/* Retrieve service from list */
l = g_slist_find_custom(services, svc_name, __compare_svc_name);
/* Send service registered event to application */
if (UAM_ERROR_NONE != _uam_manager_send_event(NULL,
- UAM_EVENT_SERVICE_REGISTERED, g_variant_new("(iss)",
+ UAM_EVENT_SERVICE_REGISTERED, g_variant_new("(is)",
UAM_ERROR_NONE, service->name)))
UAM_ERR("Failed to send UAM_EVENT_SERVICE_REGISTERED");
svc_user_list = g_slist_append(svc_user_list, db_info);
}
- *count = g_slist_length(users);
+ *count = g_slist_length(svc_user_list);
*user_list = g_new0(uam_user_info_s, *count);
/* Copy users */