This page illustrates sequence diagrams to be implemented by RDK App Infrastructure Thunder plugins.

References

Repository: https://github.com/rdkcentral/entservices-infra

Firebolt Lifecycle 2.0: Simplified Lifecycle 2.0 

HLA

General Information

Sequence diagrams are designed to adhere to the Single Responsibility Principle (SRP), ensuring each diagram focuses on a unique feature. 

By numbering each step, the flow remains clear and easy to follow, enhancing both readability and analysis.

Step 0-3 Common Prelaunch


For simplicity sequence diagrams are categorized yet the order of operation is numbered in sequence for continuity.

Step 0 - 3 are common for any type of launches with small adjustments.

For eg if Step 3 ends with 38 the next set of processing will continue from 39.

Step 0 : Setting up the listeners


Setup Listeners for AI 2.0:SystemApp:SystemApp:Package Manager:Package Manager:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager:Runtime Manager:Runtime Manager:Window Manager:Window Manager:Ripple:Ripple[1]Listen foronAppLifecycleStateChanged()[2]Listen foronAppLifecycleStateChanged()[3]Listen foronAppInstallationStatus()[4]Listen foronAppLifecycleStateChanged()[5]Listen foronReady()[6]Listen foronStateChanged()

Step 1: Prelaunch: Package Locking 

General Package Handling:SystemApp:SystemApp:Package Manager:Package Manager:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager[7]launchApp/preloadApp[8]isAppLoaded( appId )[9]false[10]Check Package loaded[11]lock( packageId )opt[For Browser/Cobalt apps with runtime]Package is already locked so replies faster[12]lock( runtimePackageId )[13]1. Unpacked path2. Configuration Object3. App Metadata

Step 2: Prelaunch: Spawning

Spawning:SystemApp:SystemApp:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager:Ripple:Ripple[14]spawnApp( appId, targetLifecycleState X )Target lifecycle state could be ACTIVE/PAUSED/SUSPEND[15]return true[16]allocate appInstanceId[17]newAppLifecycleState = LOADING[18]onAppLifecycleStateChanged LOADING[19]onAppLifecycleStateChanged LOADINGNeed to pass appId - for SecureStorage integration[20]onAppLifecycleStateChangedLOADING[21]createSessionUse appInstanceId for Session[22]Add environment variablefor FIREBOLT_ENDPOINT andpreload target state

Step 3: Prelaunch: Container Launch


Container Launch:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager:Runtime Manager:Runtime Manager:Window Manager:Window Manager:OCI:OCI:Ripple:RippleAppApp[23]run( appId, env )[24]onStateChanged(Starting)[25]Create Dobby Specfrom Config Object[26]Create User IdAdd Storage Manager.get using user Id[27]createDisplay(appInstanceId)[28]startContainer(spec)[29]exec()[30]onStarted[31]onStateChanged(Running)[32]newAppLifecycleState = INITIALIZING[33]onAppLifecycleStateChangedINITIALIZING[34]onAppLifecycleStateChangedINITIALIZING[35]Update app state

Step 4: Launch

Step 4A: Interactive App launched to Active


Launch for an Active Interactive App:SystemApp:SystemApp:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager:Runtime Manager:Runtime Manager:Window Manager:Window Manager:Ripple:Ripple:Firebolt App:Firebolt AppLaunch with target lifecycle state of ACTIVE1. App Lifecycle Start upurl = getenv( "FIREBOLT_ENDPOINT" )[36]Setup Lifecycle Listeners[37]Lifecycle.ready[38]appReady() [JQ][39]newAppLifecycleState = PAUSED[40]onAppLifecycleStateChangedPAUSED[41]onAppLifecycleStateChangedPAUSED[42]onStart()opt[If frame is already rendered][43]renderReady()[44]trueopt[else]Render first frame[45]Wayland event[46]onReady(appInstanceId)[47]newAppLifecycleState = ACTIVE[48]onAppLifecycleStateChangedACTIVE[49]onActivate()[50]onAppLifecycleStateChangedACTIVE[51]onAppLifecycleStateChangedACTIVEopt[SystemApp handling visibility and focus][52]wayland set_properties(appInstanceId,visible)[53]wayland set_client_focus(appInstanceId)

Step 4B: Interactive App launched to Suspend

Launch for an Suspended Interactive App:SystemApp:SystemApp:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager:Runtime Manager:Runtime Manager:Window Manager:Window Manager:Ripple:Ripple:Firebolt App:Firebolt AppOCIOCIPreloaded with target lifecycle state of SUSPENDEDurl = getenv( "FIREBOLT_ENDPOINT" )[36]Setup Lifecycle Listeners[37]Lifecycle.ready[38]appReady() [JQ][39]newAppLifecycleState = SUSPENDED[40]suspend(appInstanceId)[41]enableDisplayRender(appInstanceId, false)[42] [43]onAppLifecycleStateChangedSUSPENDED[44]onAppLifecycleStateChangedSUSPENDED[45]onStartSuspend

Step 4B Contd: Resume Suspended Interactive Launched App 

Launch for an Suspended Interactive App:SystemApp:SystemApp:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager:Runtime Manager:Runtime Manager:Window Manager:Window Manager:Ripple:Ripple:Firebolt App:Firebolt AppContd from Step 4B[46]launchApp[47]isAppLoaded(appId) = true[48]setTargetAppState(ACTIVE)Current state is SUSPENDED[49]newAppLifecycleState = PAUSED[50]resume(appInstanceId)[51]onAppLifecycleStateChangedPAUSED[52]onAppLifecycleStateChangedPAUSED[53]onResume()opt[If frame is already rendered][54]renderReady()[55]trueopt[else]Render first frame[56]Wayland event[57]onReady(appInstanceId)[58]newAppLifecycleState = ACTIVE[59]onAppLifecycleStateChangedACTIVE[60]onActivate()[61]onAppLifecycleStateChangedACTIVE[62]onAppLifecycleStateChangedACTIVEopt[SystemApp handling visibility and focus][63]wayland set_properties(appInstanceId,visible)[64]onVisible(appInstanceId)[65]wayland set_client_focus(appInstanceId)

Step 5 Deactivation

Step 5A Deactivate for Non Suspendable Apps


Launch for an Suspended Interactive App:SystemApp:SystemApp:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager:Window Manager:Window Manager:Ripple:Ripple:Firebolt App:Firebolt AppRMRMOCIOCIContd from Step 4AIf contd from Step 4b its 66[54]closeApp[55]setTargetAppState(PAUSED)[56]newAppLifecycleState = PAUSED[57]onAppLifecycleStateChangedPAUSED[58]onPause[59]onAppLifecycleStateChangedPAUSEDcheck for InstallBlocked/UninstallBlocked and move the app to terminate[60]onAppLifecycleStateChangedPAUSED[61]unloadApp[62]newAppLifecycleState = TERMINATING[63]onAppLifecycleStateChangedTERMINATINGNo guarantee for this dispatch[64]Cleanup[65]onDestroy[66]Cleanup[67]terminate[68]stopContainer

Step 5B Deactivate for Suspendable Apps


Launch for an Suspended Interactive App:SystemApp:SystemApp:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager:Runtime Manager:Runtime Manager:Window Manager:Window Manager:Ripple:Ripple:Firebolt App:Firebolt AppContd from Step 4B contd[66]closeApp[67]setTargetAppState(PAUSED)[68]newAppLifecycleState = PAUSED[69]onAppLifecycleStateChangedPAUSED[70]onPause[71]onAppLifecycleStateChangedPAUSEDcheck for InstallBlocked/UninstallBlocked and move the app to terminate[72]onAppLifecycleStateChangedPAUSEDBased on Suspension PolicyNeed some methods in App Manager to support this TBD[73]setAppTargetState(SUSPENDED)[74]newAppLifecycleState = SUSPENDED[75]suspend(appInstanceId)[76]onAppLifecycleStateChangedSUSPENDED[77]onSuspendopt[If App is enabled for Hibernation]Based on Hibernation PolicyNeed some methods in App Manager to support this TBD[78]setAppTargetState(HIBERNATED)[79]newAppLifecycleState = HIBERNATED[80]hibernate(appInstanceId)opt[Termination][81]terminateApp[82]unloadAppopt[Given current state is HIBERNATED][83]newAppLifecycleState = SUSPENDED[84]wake(appInstanceId,suspended)[85]newAppLifecycleState = SUSPENDED[86]onAppLifecycleStateChangedSUSPENDED[87]onRestore[88]newAppLifecycleState = TERMINATING[89]onAppLifecycleStateChangedTERMINATINGNo guarantee for this dispatch[90]Cleanup[91]onDestroy[92]Cleanup

  • No labels