Compartir a través de


MediaRoute2ProviderService.OnDiscoveryPreferenceChanged Method

Definition

Called when the RouteDiscoveryPreference discovery preference has changed.

[Android.Runtime.Register("onDiscoveryPreferenceChanged", "(Landroid/media/RouteDiscoveryPreference;)V", "GetOnDiscoveryPreferenceChanged_Landroid_media_RouteDiscoveryPreference_Handler", ApiSince=30)]
public virtual void OnDiscoveryPreferenceChanged (Android.Media.RouteDiscoveryPreference preference);
[<Android.Runtime.Register("onDiscoveryPreferenceChanged", "(Landroid/media/RouteDiscoveryPreference;)V", "GetOnDiscoveryPreferenceChanged_Landroid_media_RouteDiscoveryPreference_Handler", ApiSince=30)>]
abstract member OnDiscoveryPreferenceChanged : Android.Media.RouteDiscoveryPreference -> unit
override this.OnDiscoveryPreferenceChanged : Android.Media.RouteDiscoveryPreference -> unit

Parameters

preference
RouteDiscoveryPreference

the new discovery preference

Attributes

Remarks

Called when the RouteDiscoveryPreference discovery preference has changed.

Whenever an application registers a MediaRouter2.RouteCallback callback, it also provides a discovery preference to specify features of routes that it is interested in. The media router combines all of these discovery request into a single discovery preference and notifies each provider.

The provider should examine RouteDiscoveryPreference#getPreferredFeatures() preferred features in the discovery preference to determine what kind of routes it should try to discover and whether it should perform active or passive scans. In many cases, the provider may be able to save power by not performing any scans when the request doesn't have any matching route features.

Java documentation for android.media.MediaRoute2ProviderService.onDiscoveryPreferenceChanged(android.media.RouteDiscoveryPreference).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to