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 

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 foronVisible()[7]Listen foronStateChanged()

Step 1: Prelaunch: Package Locking 

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

Step 2: Prelaunch: Spawning

Spawning:SystemApp:SystemApp:App Manager:App Manager:Lifecycle Manager:Lifecycle Manager:Ripple:Ripple[15]spawnApp( appId, targetLifecycleState X )Target lifecycle state could be ACTIVE/PAUSED/SUSPEND[16]return true[17]allocate appInstanceId[18]newAppLifecycleState = LOADING[19]onAppLifecycleStateChanged LOADING[20]onAppLifecycleStateChanged LOADINGNeed to pass appId - for SecureStorage integration[21]onAppLifecycleStateChangedLOADING[22]createSessionUse appInstanceId for Session[23]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[24]run( appId, env )[25]onStateChanged(Starting)[26]Create Dobby Specfrom Config Object[27]Create User IdAdd Storage Manager.get using user Id[28]createDisplay(appInstanceId)[29]Wayland env variable display name[30]Update display name[31]startContainer(spec)[32]exec()[33]onStarted[34]onStateChanged(Running)[35]newAppLifecycleState = INITIALIZING[36]onAppLifecycleStateChangedINITIALIZING[37]onAppLifecycleStateChangedINITIALIZING[38]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" )[39]Setup Lifecycle Listeners[40]Lifecycle.ready[41]appReady() [JQ][42]newAppLifecycleState = PAUSED[43]onAppLifecycleStateChangedPAUSED[44]onAppLifecycleStateChangedPAUSED[45]onStart()opt[If frame is already rendered][46]renderReady()[47]trueopt[else]Render first frame[48]Wayland event[49]onReady(appInstanceId)[50]newAppLifecycleState = ACTIVE[51]onAppLifecycleStateChangedACTIVE[52]onActivate()[53]onAppLifecycleStateChangedACTIVE[54]onAppLifecycleStateChangedACTIVEopt[SystemApp handling visibility and focus][55]wayland set_properties(appInstanceId,visible)[56]onVisible(appInstanceId)[57]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 AppPreloaded with target lifecycle state of SUSPENDEDurl = getenv( "FIREBOLT_ENDPOINT" )[39]Setup Lifecycle Listeners[40]Lifecycle.ready[41]appReady() [JQ][42]newAppLifecycleState = SUSPENDED[43]suspend(appInstanceId)[44]onAppLifecycleStateChangedSUSPENDED[45]onAppLifecycleStateChangedSUSPENDED[46]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 AppContd from Step 4A[58]closeApp[59]setTargetAppState(PAUSED)[60]newAppLifecycleState = PAUSED[61]onAppLifecycleStateChangedPAUSED[62]onPause[63]onAppLifecycleStateChangedPAUSED[64]onAppLifecycleStateChangedPAUSEDopt[Termination][65]terminateApp[66]unloadApp[67]newAppLifecycleState = TERMINATING[68]onAppLifecycleStateChangedTERMINATINGNo guarantee for this dispatch[69]Cleanup[70]onDestroy[71]Cleanup

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[65]closeApp[66]setTargetAppState(PAUSED)[67]newAppLifecycleState = PAUSED[68]onAppLifecycleStateChangedPAUSED[69]onPause[70]onAppLifecycleStateChangedPAUSED[71]onAppLifecycleStateChangedPAUSEDBased on Suspension PolicyNeed some methods in App Manager to support this TBD[72]setAppTargetState(SUSPENDED)[73]newAppLifecycleState = SUSPENDED[74]suspend(appInstanceId)[75]onAppLifecycleStateChangedSUSPENDED[76]onSuspendopt[If App is enabled for Hibernation]Based on Hibernation PolicyNeed some methods in App Manager to support this TBD[77]setAppTargetState(HIBERNATED)[78]newAppLifecycleState = HIBERNATED[79]hibernate(appInstanceId)opt[Termination][80]terminateApp[81]unloadAppopt[Given current state is HIBERNATED][82]newAppLifecycleState = SUSPENDED[83]wake(appInstanceId,suspended)[84]newAppLifecycleState = SUSPENDED[85]onAppLifecycleStateChangedSUSPENDED[86]onRestore[87]newAppLifecycleState = TERMINATING[88]onAppLifecycleStateChangedTERMINATINGNo guarantee for this dispatch[89]Cleanup[90]onDestroy[91]Cleanup

  • No labels