Allow new Now Playing List fetches to happen by cancelling the old request
Problem: The Now Playing List is invalidated when the addressed player changes. This can happen on initial connection, when the Available Players change and a player ID is reused, or directly as a result of an Addressed Player Changed event. Typically, both events come in one after the other, causing one Now Playing list fetch, immediately followed by another. As it stands, the first request always finishes, and the future ones are ignored, despite the list getting cleared/uncached part-way through. This leads to missing data and/or incorrect lists, which can have downstream impact on playing items from the Now Playing List as well. Solution: Let another more recent fetch request for the Now Playing List invalidate the previous requsst and cause the download process to restart. These downloads are typically quick and the wasted cycles downloading sometimes-old-something-invalid data are small, or necessary. Tag: #stability Bug: 177004421 Test: atest AvrcpControllerStateMachine.java Change-Id: Idcc0a21c966622bfd442ae3b2c7cf1d8f06e75d3
Loading
Please register or sign in to comment