From: Ajay Panicker Date: Tue, 8 May 2018 23:34:04 +0000 (-0700) Subject: Send UID 0 for track changed if there is no media ID X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8b7b73764a537869bc3d7cf74e2bb5830d528963;p=android-x86%2Fsystem-bt.git Send UID 0 for track changed if there is no media ID Some carkits need the track changed UID to change even though we explicitly report that UID's are refreshed on any now playing list change. UID 0 is special since it represents that the song has changed and forces an update. Bug: 72824896 Test: Tested with Audi carkit where Spotify wasn't updating past the first song previously. Change-Id: I033f9a2f96acfde25922d6912a4927b95fb89596 Merged-In: I033f9a2f96acfde25922d6912a4927b95fb89596 (cherry picked from commit 2789ae2b57085aad446d7e062f66f5d83cf26e0b) --- diff --git a/profile/avrcp/device.cc b/profile/avrcp/device.cc index 2b2172d3d..5877e9d47 100644 --- a/profile/avrcp/device.cc +++ b/profile/avrcp/device.cc @@ -366,6 +366,11 @@ void Device::TrackChangedNotificationResponse(uint8_t label, bool interim, } } + if (curr_song_id == "") { + DEVICE_LOG(WARNING) << "Empty media ID"; + uid = 0; + } + auto response = RegisterNotificationResponseBuilder::MakeTrackChangedBuilder( interim, uid); send_message_cb_.Run(label, false, std::move(response));