Udostępnij za pośrednictwem


CompanionDeviceService.ServiceInterface Field

Definition

An intent action for a service to be bound whenever this app's companion device(s) are nearby.

[Android.Runtime.Register("SERVICE_INTERFACE", ApiSince=31)]
public const string ServiceInterface;
[<Android.Runtime.Register("SERVICE_INTERFACE", ApiSince=31)>]
val mutable ServiceInterface : string

Field Value

Attributes

Remarks

An intent action for a service to be bound whenever this app's companion device(s) are nearby.

The app will be kept alive for as long as the device is nearby or companion app reports appeared. If the app is not running at the time device gets connected, the app will be woken up.

Shortly after the device goes out of range or the companion app reports disappeared, the service will be unbound, and the app will be eligible for cleanup, unless any other user-visible components are running.

If running in background is not essential for the devices that this app can manage, app should avoid declaring this service.</p>

The service must also require permission android.Manifest.permission#BIND_COMPANION_DEVICE_SERVICE

Java documentation for android.companion.CompanionDeviceService.SERVICE_INTERFACE.

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