Skip to content
Commit 8651185e authored by Beth Thibodeau's avatar Beth Thibodeau
Browse files

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
parent 10de71a3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment