OSDN Git Service

Send UID 0 for track changed if there is no media ID
authorAjay Panicker <apanicke@google.com>
Tue, 8 May 2018 23:34:04 +0000 (16:34 -0700)
committerHansong Zhang <hsz@google.com>
Wed, 30 May 2018 03:35:22 +0000 (20:35 -0700)
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)

profile/avrcp/device.cc

index 2b2172d..5877e9d 100644 (file)
@@ -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));