AppInteractionSession.CreateParams.Builder


public static final class AppInteractionSession.CreateParams.Builder
extends Object

java.lang.Object
   ↳ android.app.AppInteractionSession.CreateParams.Builder


Builder for CreateParams.

Summary

Public constructors

Builder()

Constructor for Builder.

Public methods

AppInteractionSession.CreateParams build()

Builds the CreateParams.

AppInteractionSession.CreateParams.Builder setExtras(Bundle extras)

Sets the additional metadata for this session.

AppInteractionSession.CreateParams.Builder setOnStartIntentSenderCallback(Executor executor, Consumer<IntentSender> callback)

Called when the session creation needs to be approved by the user.

AppInteractionSession.CreateParams.Builder setTargetPackages(List<String> targetPackages)

Sets the target packages for which the app interaction session will be interacting with.

Inherited methods

Public constructors

Builder

Added in version 37.2
public Builder ()

Constructor for Builder.

Public methods

build

Added in version 37.2
public AppInteractionSession.CreateParams build ()

Builds the CreateParams.

Returns
AppInteractionSession.CreateParams This value cannot be null.

setExtras

Added in version 37.2
public AppInteractionSession.CreateParams.Builder setExtras (Bundle extras)

Sets the additional metadata for this session.

Parameters
extras Bundle: The additional metadata for this session.
This value cannot be null.

Returns
AppInteractionSession.CreateParams.Builder This value cannot be null.

setOnStartIntentSenderCallback

Added in version 37.2
public AppInteractionSession.CreateParams.Builder setOnStartIntentSenderCallback (Executor executor, 
                Consumer<IntentSender> callback)

Called when the session creation needs to be approved by the user.

This callback would be called when AppInteractionManager.createSession(CreateParams,Executor,OutcomeReceiver) requires confirmation from the user.

Applications should launch the UI for the user to allow the creation of the session by calling Context.startIntentSender(IntentSender,Intent,int,int,int).

Parameters
executor Executor: the executor to run the callback on.
This value cannot be null.
Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.

callback Consumer: the callback to be called when the session request needs to be approved by the user.
This value cannot be null.

Returns
AppInteractionSession.CreateParams.Builder This value cannot be null.

setTargetPackages

Added in version 37.2
public AppInteractionSession.CreateParams.Builder setTargetPackages (List<String> targetPackages)

Sets the target packages for which the app interaction session will be interacting with.

Parameters
targetPackages List: The list of target packages for which the app interaction session will be interacting with.
This value cannot be null.

Returns
AppInteractionSession.CreateParams.Builder This value cannot be null.