From c825a0819bf0dd476a81bce90d2f304ff32a7581 Mon Sep 17 00:00:00 2001 From: zhangyuan20 Date: Thu, 14 Nov 2024 20:21:08 +0800 Subject: [PATCH] framework/avrcp: get metadata when NOTIFICATION_EVT_TRACK_CHANGED bug: v/42362 Rootcause: Get metadata when NOTIFICATION_EVT_TRACK_CHANGED received. Signed-off-by: zhangyuan20 --- service/profiles/avrcp/control/avrcp_control_service.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/service/profiles/avrcp/control/avrcp_control_service.c b/service/profiles/avrcp/control/avrcp_control_service.c index 45956f2..eba132e 100644 --- a/service/profiles/avrcp/control/avrcp_control_service.c +++ b/service/profiles/avrcp/control/avrcp_control_service.c @@ -364,6 +364,9 @@ static void handle_avrcp_get_capability_response(avrcp_msg_t* msg) case NOTIFICATION_EVT_VOLUME_CHANGED: /* don't work on controller role */ break; + case NOTIFICATION_EVT_TRACK_CHANGED: + bt_sal_avrcp_control_register_notification(addr, *cap, 0); + break; default: break; } @@ -412,6 +415,11 @@ static void handle_avrcp_register_notification_response(avrcp_msg_t* msg) /* don't work on controller role */ break; } + case NOTIFICATION_EVT_TRACK_CHANGED: { + BT_LOGD("track changed, get track info now..."); + bt_sal_avrcp_control_get_element_attributes(addr, 0, NULL); + break; + } default: break; }