Language

CompanionDeviceManager.IsSystemDataTransportAttached(Int32) Method

Definition

Checks if a transport is currently attached for a given association id.

[Android.Runtime.Register("isSystemDataTransportAttached", "(I)Z", "", ApiSince=37)]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_COMPANION_MESSAGE_PCC")]
public bool IsSystemDataTransportAttached(int associationId);
[<Android.Runtime.Register("isSystemDataTransportAttached", "(I)Z", "", ApiSince=37)>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_COMPANION_MESSAGE_PCC")>]
member this.IsSystemDataTransportAttached : int -> bool

Parameters

associationId
Int32

The unique AssociationInfo#getId() id of the device association

Returns

true if a system data transport is attached for the given association id, false otherwise.

Attributes

Remarks

Checks if a transport is currently attached for a given association id.

A transport is considered attached if attachSystemDataTransport(int,InputStream,OutputStream) has been successfully called for the given associationId, and detachSystemDataTransport(int) has not yet been called.

This is useful for determining if the system is ready to handle data transfers before calling startSystemDataTransfer(int,Executor,OutcomeReceiver).

The caller must meet one of the following requirements: It is the package that originally created the association; It holds the android.permission.ACCESS_COMPANION_MESSAGE_PCC permission and the association must be verified as a trusted device

Android reference for android.companion.CompanionDeviceManager.isSystemDataTransportAttached.

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