Handle media load events while testing for resume
An app can send additional notifications, resulting in onMediaDataLoaded calls, while we are waiting for the callback from its MediaBrowserService to return. Previously this would result in disconnecting and then starting a new attempt to connect to the MBS. Instead, 1. notify MediaDataManager immediately when we initiate the test connection, so that if we get additional onMediaDataLoaded calls while testing, it will not try again 2. only disconnect the mediaBrowser in onMediaDataLoaded when the key changes, since this is only relevant when resuming via the MBS. Otherwise we might prematurely disconnect while waiting for the callback result. Bug: 189702977 Test: manual - checked repro with test app Test: atest MediaResumeListenerTest Change-Id: I55cf2be6e62ef72c777899575d9caab78eda31be
Loading
Please register or sign in to comment