Remove isActiveScanRequired().
This flag was originally added to support media route providers
that are unable to discover media routes passively. However, this
would be true in practice for most media route providers since
they will usually need to poll the network periodically to find
new routes.
Previously we did not have a good way to tell when discovery was
really needed so we forced these providers to rely on active scans
instead. Unfortunately this meant that the MediaRouterButton needed
to be visible all of the time.
Now that we have CALLBACK_FLAG_REQUEST_DISCOVERY, we can be more
conservative about when discovery occurs. In practice, discovery
will only happen when an application that uses media router is in
the foreground. So it's ok for providers to do some moderate work
during normal discovery and we don't need to force them to rely
exclusively on active scans anymore.
We also remove getDiscoverableControlFilters() since it was only
needed for the case where active scans were required.
Note that we still do perform active scans when the chooser dialog
is open. However, we don't allow providers to require them.
This even works for Wifi Display because the system already knows
which displays have been paired so it doesn't require active scans
to decide whether to advertise those routes (although it does
require active scans to discover whether they are really available).
Bug: 9210033
Change-Id: I69adaf42fb461ee2b564e3605f921d23b6b5c7be
5 files changed