MediaRoute2ProviderService.OnDiscoveryPreferenceChanged Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| OnDiscoveryPreferenceChanged(RouteDiscoveryPreference, IDictionary<String,RouteDiscoveryPreference>) |
Called when any individual app's |
| OnDiscoveryPreferenceChanged(RouteDiscoveryPreference) |
Called when the |
OnDiscoveryPreferenceChanged(RouteDiscoveryPreference, IDictionary<String,RouteDiscoveryPreference>)
Called when any individual app's RouteDiscoveryPreference discovery preference has
changed, which typically means the composite preference has also changed.
[Android.Runtime.Register("onDiscoveryPreferenceChanged", "(Landroid/media/RouteDiscoveryPreference;Ljava/util/Map;)V", "GetOnDiscoveryPreferenceChanged_Landroid_media_RouteDiscoveryPreference_Ljava_util_Map_Handler", ApiSince=36)]
[Android.Runtime.RequiresPermission("android.permission.MEDIA_CONTENT_CONTROL")]
public virtual void OnDiscoveryPreferenceChanged(Android.Media.RouteDiscoveryPreference compositePreference, System.Collections.Generic.IDictionary<string,Android.Media.RouteDiscoveryPreference> perAppPreferences);
[<Android.Runtime.Register("onDiscoveryPreferenceChanged", "(Landroid/media/RouteDiscoveryPreference;Ljava/util/Map;)V", "GetOnDiscoveryPreferenceChanged_Landroid_media_RouteDiscoveryPreference_Ljava_util_Map_Handler", ApiSince=36)>]
[<Android.Runtime.RequiresPermission("android.permission.MEDIA_CONTENT_CONTROL")>]
abstract member OnDiscoveryPreferenceChanged : Android.Media.RouteDiscoveryPreference * System.Collections.Generic.IDictionary<string, Android.Media.RouteDiscoveryPreference> -> unit
override this.OnDiscoveryPreferenceChanged : Android.Media.RouteDiscoveryPreference * System.Collections.Generic.IDictionary<string, Android.Media.RouteDiscoveryPreference> -> unit
Parameters
- compositePreference
- RouteDiscoveryPreference
A composite object aggregating the route preferences for all apps
with registered MediaRouter2.RouteCallback callbacks.
- perAppPreferences
- IDictionary<String,RouteDiscoveryPreference>
A mapping of app package name to the
RouteDiscoveryPreference discovery preference just for
that app. This map will only be populated if the caller holds the
Manifest.permission#MEDIA_CONTENT_CONTROL
MEDIA_CONTENT_CONTROL permission.
- Attributes
Remarks
Called when any individual app's RouteDiscoveryPreference discovery preference has changed, which typically means the composite preference has also changed.
This is similar to #onDiscoveryPreferenceChanged(RouteDiscoveryPreference) but provides more granular per-app preference information if the provider has permission to see it.
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
OnDiscoveryPreferenceChanged(RouteDiscoveryPreference)
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.
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.