BREW Termination Event? | developer.brewmp.com BREW Termination Event? | developer.brewmp.com

Developer

BREW Termination Event?

Forums:

I know I can register BREW initialization via NMASK_SHELL_INIT notification in the MIF file.

Is there a mechanism to get notified when BREW shuts down, e.g. user resets the device via long-pressing the end key?

I am interested only because I have an application running in background. Some states ought to be saved in the event of brew termination.

Thanks,
Jian

EVT_EXIT event is for this Purpose. When BREW Shut Down, If your App Still be running, such as BG App. Then your app will received this Event , And then you can do something, such as store info.
Besides this, your App can Call ISHELL_OnExit to register a Callback, which will be re-called when BREW Exit, But be sure the AEECallback you passed in ISHELL_OnExit should be malloced on HEAP, and be valid All the time.

EVT_EXIT event is for this Purpose. When BREW Shut Down, If your App Still be running, such as BG App. Then your app will received this Event , And then you can do something, such as store info.
Besides this, your App can Call ISHELL_OnExit to register a Callback, which will be re-called when BREW Exit, But be sure the AEECallback you passed in ISHELL_OnExit should be malloced on HEAP, and be valid All the time.

Thanks nicefuture.
One follow up question, is the PFNFREEAPPDATA function (passed in to AEEApplet_New) guaranteed to be invoked when BREW terminates?
Thanks again!

Thanks nicefuture.
One follow up question, is the PFNFREEAPPDATA function (passed in to AEEApplet_New) guaranteed to be invoked when BREW terminates?
Thanks again!

Of cource, Actually, BREW Shutdown Procedure is as below:
1. AEE_Exit() invoked when BREW shuts down gracefully
2. EVT_EXIT broadcast to all running apps
3. All applications are closed
a. All app history entries are unlinked from the app context.
b. Once there are no more app history entries for a given application, the app is "soft closed". EVT_APP_STOP will be sent, and the app could conceivably go background.
c. Assuming the app is still running (it went background) after the previous step, BREW will "hard close" the app. EVT_APP_STOP will be sent, followed by EVT_APP_TERMINATE.
4. Currently active BREW debug modes are persisted to the FS
5. Safe mode is reset to indicate that BREW terminated gracefully.
6. All notifiers are released.
7. BREW system resources are released.
8. BREW issues callbacks registered for AEE_SCB_AEE_EXIT
Above is from Max:-)

Of cource, Actually, BREW Shutdown Procedure is as below:
1. AEE_Exit() invoked when BREW shuts down gracefully
2. EVT_EXIT broadcast to all running apps
3. All applications are closed
a. All app history entries are unlinked from the app context.
b. Once there are no more app history entries for a given application, the app is "soft closed". EVT_APP_STOP will be sent, and the app could conceivably go background.
c. Assuming the app is still running (it went background) after the previous step, BREW will "hard close" the app. EVT_APP_STOP will be sent, followed by EVT_APP_TERMINATE.
4. Currently active BREW debug modes are persisted to the FS
5. Safe mode is reset to indicate that BREW terminated gracefully.
6. All notifiers are released.
7. BREW system resources are released.
8. BREW issues callbacks registered for AEE_SCB_AEE_EXIT
Above is from Max:-)