Move the volume changed event path from AVRCP to HEADSET
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-event-handler.c
index 91108b4..f0167ea 100644 (file)
@@ -1386,7 +1386,24 @@ void __bt_headset_event_filter(GDBusConnection *connection,
                _bt_headset_event_cb(BLUETOOTH_EVENT_AG_MIC_GAIN,
                                result, &gain,
                                event_info->cb, event_info->user_data);
+#ifdef TIZEN_FEATURE_BT_AVC_TARGET
+       } else if (strcasecmp(signal_name, BT_AUDIO_AVC_MODE_CHANGED) == 0) {
+               bool mode;
+
+               g_variant_get(parameters, "(b)", &mode);
+
+               _bt_headset_event_cb(BLUETOOTH_EVENT_AUDIO_AVC_STATUS,
+                               result, &mode,
+                               event_info->cb, event_info->user_data);
+       } else if (strcasecmp(signal_name, BT_MEDIA_VOLUME_CHANGE) == 0) {
+               unsigned int volume;
+
+               g_variant_get(parameters, "(u)", &volume);
+               _bt_avrcp_event_cb(BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED,
+                               result, &volume,
+                               event_info->cb, event_info->user_data);
        }
+#endif
 }
 
 void __bt_hid_device_event_filter(GDBusConnection *connection,
@@ -2247,6 +2264,7 @@ void __bt_map_client_event_filter(GDBusConnection *connection,
                }
                g_free(folders_struct.names);
 
+               g_variant_iter_free(iter);
                g_variant_unref(folder_list_var);
 
        } else if (strcasecmp(signal_name, BT_MAP_FILTER_FIELDS_COMPLETE) == 0) {
@@ -2275,6 +2293,7 @@ void __bt_map_client_event_filter(GDBusConnection *connection,
                                fields_info.fields[i] = strdup(field);
                                i++;
                        }
+                       g_variant_iter_free(iter);
                }
 
                _bt_common_event_cb(BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
@@ -2405,9 +2424,12 @@ void __bt_map_client_event_filter(GDBusConnection *connection,
                                        messages_struct.message_items[i].is_protected = value_bool ? 1 : 0;
                                        BT_DBG("  Protected: %s", value_bool ? "true" : "false");
                                }
+
+                               g_free(value_string);
                        }
                        ++i;
                }
+               g_variant_iter_free(iter);
 
                _bt_common_event_cb(BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE,
                                result, &messages_struct,