foregroundServiceType
fun foregroundServiceType(hasLocationPermission: Boolean, appInForeground: Boolean, sdkInt: Int = Build.VERSION.SDK_INT): Int(source)
Returns the foreground service type bitmask to pass to startForeground().
connectedDevice is always claimed: it is the type that actually describes the radio link, it is not subject to while-in-use restrictions, and its prerequisite (BLUETOOTH_CONNECT) is declared. location is additive and is claimed only when it can be held legally, because requesting it in a state the platform forbids throws SecurityException and takes the whole start down with it.
Parameters
hasLocationPermission
whether ACCESS_FINE_LOCATION is granted.
appInForeground
whether this process currently holds a user-visible component.
sdkInt
the running platform API level.