CustomTabsSessionToken

public class CustomTabsSessionToken


Wrapper class that can be used as a unique identifier for a session. Also contains an accessor for the CustomTabsCallback for the session if there was any.

Summary

Public methods

static @NonNull CustomTabsSessionToken

Provides browsers a way to generate a mock CustomTabsSessionToken for testing purposes.

boolean
@Nullable CustomTabsCallback
static @Nullable CustomTabsSessionToken

Obtain a CustomTabsSessionToken from an intent.

int
boolean

Public methods

createMockSessionTokenForTesting

Added in 1.2.0
public static @NonNull CustomTabsSessionToken createMockSessionTokenForTesting()

Provides browsers a way to generate a mock CustomTabsSessionToken for testing purposes.

Returns
@NonNull CustomTabsSessionToken

A mock token with no functionality.

equals

public boolean equals(Object o)

getCallback

Added in 1.2.0
public @Nullable CustomTabsCallback getCallback()
Returns
@Nullable CustomTabsCallback

CustomTabsCallback corresponding to this session if there was any non-null callbacks passed by the client.

getSessionTokenFromIntent

Added in 1.2.0
public static @Nullable CustomTabsSessionToken getSessionTokenFromIntent(@NonNull Intent intent)

Obtain a CustomTabsSessionToken from an intent. See CustomTabsIntent.Builder for ways to generate an intent for custom tabs.

Parameters
@NonNull Intent intent

The intent to generate the token from. This has to include an extra for EXTRA_SESSION.

Returns
@Nullable CustomTabsSessionToken

The token that was generated.

hashCode

public int hashCode()

isAssociatedWith

Added in 1.2.0
public boolean isAssociatedWith(@NonNull CustomTabsSession session)
Returns
boolean

Whether this token is associated with the given session.