ServiceInfo.ForegroundServiceTypeConnectedDevice Field

Definition

Caution

This constant will be removed in the future version. Use Android.Content.PM.ForegroundService enum directly instead of this field.

Constant corresponding to connectedDevice in the android.R.attr#foregroundServiceType attribute.

[Android.Runtime.Register("FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE", ApiSince=29)]
[System.Obsolete("This constant will be removed in the future version. Use Android.Content.PM.ForegroundService enum directly instead of this field.", true)]
public const Android.Content.PM.ForegroundService ForegroundServiceTypeConnectedDevice = 16;
[<Android.Runtime.Register("FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE", ApiSince=29)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.Content.PM.ForegroundService enum directly instead of this field.", true)>]
val mutable ForegroundServiceTypeConnectedDevice : Android.Content.PM.ForegroundService

Field Value

Value = 16

Implements

Attributes

Remarks

Constant corresponding to connectedDevice in the android.R.attr#foregroundServiceType attribute. Auto, bluetooth, TV or other devices connection, monitoring and interaction.

Starting foreground service with this type from apps targeting API level android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE and later, will require permission android.Manifest.permission#FOREGROUND_SERVICE_CONNECTED_DEVICE and one of the following permissions: android.Manifest.permission#BLUETOOTH_ADVERTISE, android.Manifest.permission#BLUETOOTH_CONNECT, android.Manifest.permission#BLUETOOTH_SCAN, android.Manifest.permission#CHANGE_NETWORK_STATE, android.Manifest.permission#CHANGE_WIFI_STATE, android.Manifest.permission#CHANGE_WIFI_MULTICAST_STATE, android.Manifest.permission#NFC, android.Manifest.permission#TRANSMIT_IR, android.Manifest.permission#UWB_RANGING, or has been granted the access to one of the attached USB devices/accessories.

Java documentation for android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE.

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