BrowsablePlayerConnector: Always remove pending players on handler
After processing a message on it's Handler, BrowsablePlayerConnector checks if there is no pending players to call a callback with all the result. The code handling MSG_CONNECT_CB was calling a function with a callback and removing the player within this callback, as it's in a different function that the Handler#processMessage, the check to see if it was the last player was not executed and would only run on the next message. The Bluetooth app also registers a MediaBrowserService and this one usually comes last, this player doesn't have any folder so it was removed from within the callback (results.size() == 0) and the only message happening after that was CONNECT_TIMEOUT_MS after 10s. This means that you would only be able to do browsing on AVRCP only if you opened AVRCP 10s after the startup of the stack. pts-bot was triggering both cases, connecting before and after 10s which made the test flaky. Test: atest pts-bot:AVRCP/TG/MCN/CB/BI-01-C --iterations 100 Fix: 287463103 Change-Id: I8339a2e58a4880e6cfd0ebc2f2f2653da97853da
Loading
Please register or sign in to comment