Share via


CompanionDeviceManager.BuildPermissionTransferUserConsentIntent(Int32) Method

Definition

Build a permission sync user consent dialog.

[Android.Runtime.Register("buildPermissionTransferUserConsentIntent", "(I)Landroid/content/IntentSender;", "", ApiSince=34)]
public Android.Content.IntentSender? BuildPermissionTransferUserConsentIntent (int associationId);
[<Android.Runtime.Register("buildPermissionTransferUserConsentIntent", "(I)Landroid/content/IntentSender;", "", ApiSince=34)>]
member this.BuildPermissionTransferUserConsentIntent : int -> Android.Content.IntentSender

Parameters

associationId
Int32

The unique AssociationInfo#getId ID assigned to the association of the companion device recorded by CompanionDeviceManager

Returns

An IntentSender that the app should use to launch the UI for the user to confirm the system data transfer request.

Attributes

Remarks

Build a permission sync user consent dialog.

Only the companion app which owns the association can call this method. Otherwise a null IntentSender will be returned from this method and an error will be logged. The app should launch the Activity in the returned intentSenderIntentSender by calling Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int).

The permission transfer doesn't happen immediately after the call or when the user consents. The app needs to call #attachSystemDataTransport(int, InputStream, OutputStream) to attach a transport channel and #startSystemDataTransfer(int, Executor, OutcomeReceiver) to trigger the system data transfer}.

Java documentation for android.companion.CompanionDeviceManager.buildPermissionTransferUserConsentIntent(int).

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