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 |
boolean |
|
@Nullable CustomTabsCallback |
|
static @Nullable CustomTabsSessionToken |
getSessionTokenFromIntent(@NonNull Intent intent)Obtain a |
int |
hashCode() |
boolean |
isAssociatedWith(@NonNull CustomTabsSession session) |
Public methods
createMockSessionTokenForTesting
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. |
getCallback
public @Nullable CustomTabsCallback getCallback()
| Returns | |
|---|---|
@Nullable CustomTabsCallback |
|
getSessionTokenFromIntent
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 |
| Returns | |
|---|---|
@Nullable CustomTabsSessionToken |
The token that was generated. |
isAssociatedWith
public boolean isAssociatedWith(@NonNull CustomTabsSession session)
| Returns | |
|---|---|
boolean |
Whether this token is associated with the given session. |