Package 

Interface SessionReadyManager


  • 
    public interface SessionReadyManager
    
                        

    Interface for managing session readiness conditions and triggering callbacks when all conditions are met.

    This interface is responsible for:

    • Registering conditions based on launch counter

    • Tracking condition satisfaction state

    • Invoking the callback when all conditions are satisfied

    Conditions are evaluated based on the launch counter:

    • Counter == 0: Only foreground condition

    • Counter >= 1: Foreground condition + deeplink processing condition (if applicable)

    • Method Detail

      • setOnSessionReadyListener

         abstract Unit setOnSessionReadyListener(SessionReadyListener listener)

        Registers a callback to be invoked when the session is ready. If a callback is already registered, it will be replaced.

        If evaluation is already in progress and all conditions are satisfied, the callback will be triggered immediately. This supports late registration scenarios where the listener is set after the app moves to foreground.

        Parameters:
        listener - The callback listener, or null to unregister
      • startEvaluation

         abstract Unit startEvaluation(Intent activityIntent)

        Starts a new session readiness evaluation cycle based on the provided intent. Registers conditions based on the current launch counter and intent state. Marks the foreground condition as satisfied immediately since this is called from onBecameForeground.

        This method runs evaluation even if no listener is registered yet, allowing for late registration where the listener can be set after conditions are already satisfied.

        Parameters:
        activityIntent - The intent from the activity that moved to foreground
      • onDeeplinkExtractionFinished

         abstract Unit onDeeplinkExtractionFinished()

        Marks the deeplink processed condition as satisfied. Should be called when deeplink processing completes. Can be called before evaluation starts - condition will be marked satisfied and checked when evaluation begins. Condition state is stored regardless of whether a listener is registered.

      • finishEvaluation

         abstract Unit finishEvaluation()

        Completes the current evaluation cycle. Resets all conditions and clears the list to prepare for the next cycle.

      • isSessionReady

         abstract Boolean isSessionReady()

        Returns whether all session readiness conditions are currently satisfied.