googlesamples / android-media-controller

Apache License 2.0
432 stars 132 forks source link

Fix crash when attempting to connect via an Intent. #4

Closed nic0lette closed 6 years ago

nic0lette commented 6 years ago

A race condition was introduced during refactor where the UI attempted to update itself before a connection was made to the MediaSession when connection information (by way of package name) was passed in via an Intent.

The change makes it so the ViewPager is marked as GONE if the connection hasn't yet been established. After a connection is then established, the view is set to VISIBLE to trigger the updates.

Change-Id: Ie713a70df7474786688f286cbe0e49eaa63a971e