SessionInfoIntentEncoder


public class SessionInfoIntentEncoder


Helper to encode and decode a SessionInfo from an Intent

Summary

Public methods

static boolean

Returns whether or not the given intent contains an encoded SessionInfo.

static @NonNull SessionInfo

Decodes a new SessionInfo for a given intent

static void
encode(@NonNull SessionInfo sessionInfo, @NonNull Intent intent)

Sets the unique identifier for the given intent and encodes the passed SessionInfo in its extras.

Public methods

containsSessionInfo

Added in 1.3.0
public static boolean containsSessionInfo(@NonNull Intent intent)

Returns whether or not the given intent contains an encoded SessionInfo.

decode

Added in 1.3.0
public static @NonNull SessionInfo decode(@NonNull Intent intent)

Decodes a new SessionInfo for a given intent

encode

Added in 1.3.0
public static void encode(@NonNull SessionInfo sessionInfo, @NonNull Intent intent)

Sets the unique identifier for the given intent and encodes the passed SessionInfo in its extras.

The intent identifier that's created is unique based on toString. The Intent field that's set is either setIdentifier on API 29 and above, or setData.