Move the volume changed event path from AVRCP to HEADSET 20/225820/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 24 Feb 2020 08:29:13 +0000 (17:29 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 25 Feb 2020 00:30:05 +0000 (09:30 +0900)
Change-Id: Ideeef3a37674f0cd42cd38a2c1b62463d07a930f
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-event-handler.c
bt-service-adaptation/services/audio/bt-service-absolute-volume.c

index b8235df..f0167ea 100644 (file)
@@ -1395,6 +1395,13 @@ void __bt_headset_event_filter(GDBusConnection *connection,
                _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
 }
@@ -1663,13 +1670,6 @@ void __bt_avrcp_event_filter(GDBusConnection *connection,
                _bt_avrcp_event_cb(BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED,
                                result, &delay,
                                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);
        }
 }
 
index 6c24945..631f3b1 100644 (file)
@@ -459,7 +459,7 @@ void _bt_audio_handle_a2dp_state_changed(const char *address, bool connected)
                __bt_audio_set_avc_mode(mode);
 
                /* Send the initial volume to application */
-               _bt_send_event(BT_AVRCP_EVENT,
+               _bt_send_event(BT_HEADSET_EVENT,
                        BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED,
                        g_variant_new("(u)", absolute_volume));
        }
@@ -497,7 +497,7 @@ void _bt_audio_handle_transport_volume_changed(unsigned int bt_vol)
                return;
        }
 
-       _bt_send_event(BT_AVRCP_EVENT,
+       _bt_send_event(BT_HEADSET_EVENT,
                BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED,
                g_variant_new("(u)", absolute_volume));
 }