{
static device_callback_e type = DEVICE_CALLBACK_BATTERY_CAPACITY;
struct device_cb_info *cb_info;
- dd_list *elem;
+ dd_list *elem, *elem_next;
int val;
val = vconf_keynode_get_int(key);
/* invoke the each callback with value */
- DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
+ DD_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
cb_info->cb(type, (void*)val, cb_info->data);
}
//LCOV_EXCL_STOP
{
static device_callback_e type = DEVICE_CALLBACK_BATTERY_CHARGING;
struct device_cb_info *cb_info;
- dd_list *elem;
+ dd_list *elem, *elem_next;
int val;
val = vconf_keynode_get_int(key);
/* invoke the each callback with value */
- DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
+ DD_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
cb_info->cb(type, (void*)val, cb_info->data);
}
//LCOV_EXCL_STOP
{
static device_callback_e type = DEVICE_CALLBACK_BATTERY_LEVEL;
struct device_cb_info *cb_info;
- dd_list *elem;
+ dd_list *elem, *elem_next;
int val, status;
val = vconf_keynode_get_int(key);
status = -1;
/* invoke the each callback with value */
- DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
+ DD_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
cb_info->cb(type, (void*)status, cb_info->data);
}
//LCOV_EXCL_STOP
{
static device_callback_e type = DEVICE_CALLBACK_DISPLAY_STATE;
struct device_cb_info *cb_info;
- dd_list *elem;
+ dd_list *elem, *elem_next;
display_state_e state;
int val;
}
/* invoke the each callback with value */
- DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
+ DD_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
cb_info->cb(type, (void*)state, cb_info->data);
}
//LCOV_EXCL_STOP
{
static int type = DEVICE_CALLBACK_FLASH_BRIGHTNESS;
struct device_cb_info *cb_info;
- dd_list *elem;
+ dd_list *elem, *elem_next;
int val;
if (strncmp(signal, SIGNAL_FLASH_STATE,
_D("%s - %d", signal, val);
/* invoke the each callback with value */
- DD_LIST_FOREACH(device_cb_list[type], elem, cb_info)
+ DD_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info)
cb_info->cb(type, (void*)val, cb_info->data);
}
//LCOV_EXCL_STOP
int device_add_callback(device_callback_e type, device_changed_cb cb, void *data)
{
struct device_cb_info *cb_info;
- dd_list *elem;
+ dd_list *elem, *elem_next;
int ret, n;
if (type < 0 || type >= DEVICE_CALLBACK_MAX)
}
/* check for the same request */
- DD_LIST_FOREACH(device_cb_list[type], elem, cb_info) {
+ DD_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) {
if (cb_info->cb == cb)
return DEVICE_ERROR_ALREADY_IN_PROGRESS;
}
int device_remove_callback(device_callback_e type, device_changed_cb cb)
{
struct device_cb_info *cb_info;
- dd_list *elem;
+ dd_list *elem, *elem_next;
int ret, n;
if (type < 0 || type >= DEVICE_CALLBACK_MAX)
return DEVICE_ERROR_INVALID_PARAMETER;
/* search for the same element with callback */
- DD_LIST_FOREACH(device_cb_list[type], elem, cb_info) {
+ DD_LIST_FOREACH_SAFE(device_cb_list[type], elem, elem_next, cb_info) {
if (cb_info->cb == cb)
break;
}
//LCOV_EXCL_START Not called Callback
void restart_callback(void)
{
- dd_list *elem;
+ dd_list *elem, *elem_next;
char str_index[32];
char *arr[1];
struct haptic_handle *temp;
int ret;
- DD_LIST_FOREACH(handle_list, elem, temp) {
+ DD_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
snprintf(str_index, sizeof(str_index), "%d", temp->index);
arr[0] = str_index;
ret = dbus_method_sync(VIBRATOR_BUS_NAME,
int device_haptic_open(int device_index, haptic_device_h *device_handle)
{
- dd_list *elem;
+ dd_list *elem, *elem_next;
struct haptic_handle *handle;
struct haptic_handle *temp;
char str_index[32];
if (ret < 0)
return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
- DD_LIST_FOREACH(handle_list, elem, temp) {
+ DD_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
if (temp->handle == ret) {
found = true;
temp->index = device_index;
int device_haptic_close(haptic_device_h device_handle)
{
- dd_list *elem;
+ dd_list *elem, *elem_next;
struct haptic_handle *handle = (struct haptic_handle *)device_handle;
struct haptic_handle *temp;
char str_handle[32];
if (!ret)
return DEVICE_ERROR_NOT_SUPPORTED;
- DD_LIST_FOREACH(handle_list, elem, temp) {
+ DD_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
if (temp->handle != handle->handle)
continue;
found = true;
int device_haptic_vibrate(haptic_device_h device_handle, int duration, int feedback, haptic_effect_h *effect_handle)
{
- dd_list *elem;
+ dd_list *elem, *elem_next;
struct haptic_handle *handle = (struct haptic_handle *)device_handle;
struct haptic_handle *temp;
char str_handle[32];
priority = HAPTIC_PRIORITY_MIN;
- DD_LIST_FOREACH(handle_list, elem, temp) {
+ DD_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
if (temp != handle)
continue;
found = true;
int device_haptic_stop(haptic_device_h device_handle, haptic_effect_h effect_handle)
{
- dd_list *elem;
+ dd_list *elem, *elem_next;
struct haptic_handle *handle = (struct haptic_handle *)device_handle;
struct haptic_handle *temp;
char str_handle[32];
if (!ret)
return DEVICE_ERROR_NOT_SUPPORTED;
- DD_LIST_FOREACH(handle_list, elem, temp) {
+ DD_LIST_FOREACH_SAFE(handle_list, elem, elem_next, temp) {
if (temp != handle)
continue;
found = true;