Brew alarms persist after phone power cycle ? | developer.brewmp.com Brew alarms persist after phone power cycle ? | developer.brewmp.com

Developer

Brew alarms persist after phone power cycle ?

Forums:

Hello,

If I use ISHELL_SetAlarm or IALARMMGR_SetAlarm to set an alarm on my device, will the alarm persist across a phone power cycle if the alarm hasn't already been triggered ?

Basically I want to be able to start my app at a particular time (relative to the last time the app was run) even after a power cycle.

I know I can register to start my app when the Brew env initializes, but I will not know exactly when the app last ran, unless I wrote that to the FS and then read it back before calling ISHELL_StartApp.

TIA

Yes, alarms are intended to persist across a power-cycle.

Yes, alarms are intended to persist across a power-cycle.

mohlendo wrote:Yes, alarms are intended to persist across a power-cycle.
Thanks Max...can you elaborate on how the Alarms are persisted by the Brew env ? I did not find much info about that in the API.

mohlendo wrote:Yes, alarms are intended to persist across a power-cycle.
Thanks Max...can you elaborate on how the Alarms are persisted by the Brew env ? I did not find much info about that in the API.

Internally BREW is using an ISHELL_SetPrefs() and ISHELL_GetPrefs() on exit and initialization to keep track of alarms.

Internally BREW is using an ISHELL_SetPrefs() and ISHELL_GetPrefs() on exit and initialization to keep track of alarms.

Hello Max :)
Can you please tell me that can I get the Alram if i start an application, Set the alarm and without exiting the application properly pullout the battery from the device.
I had created one application which on start sets the alarm for one minute and after one minute it start the application and display a message. It works fine if I exit the application and wait for minute but when i do not exit the application and pullout the battery from the device Alarm is lost :( . I am using ISHELL_SetAlarm API.

Hello Max :)
Can you please tell me that can I get the Alram if i start an application, Set the alarm and without exiting the application properly pullout the battery from the device.
I had created one application which on start sets the alarm for one minute and after one minute it start the application and display a message. It works fine if I exit the application and wait for minute but when i do not exit the application and pullout the battery from the device Alarm is lost :( . I am using ISHELL_SetAlarm API.

When you make the call to ISHELL_SetAlarm(), there should be a synchronous call to ISHELL_SetPrefs(). Are you sure that the device is starting back up in time to be able to handle the 1 min alarm?
I don't know what else would be preventing the alarm from firing, unless you're somehow pulling the battery before the preferences are written.

When you make the call to ISHELL_SetAlarm(), there should be a synchronous call to ISHELL_SetPrefs(). Are you sure that the device is starting back up in time to be able to handle the 1 min alarm?
I don't know what else would be preventing the alarm from firing, unless you're somehow pulling the battery before the preferences are written.

Hi Max,
After calling ISHELL_SetAlarm() I am waiting for some time then pull out the battery and I am sure that the device is starting back up in time to be able to handle the 1 min alarm. But after that I am not able to receive the Alarm event.
I am not sure about pulling the battery before the preferences are written as its internal process.

Hi Max,
After calling ISHELL_SetAlarm() I am waiting for some time then pull out the battery and I am sure that the device is starting back up in time to be able to handle the 1 min alarm. But after that I am not able to receive the Alarm event.
I am not sure about pulling the battery before the preferences are written as its internal process.

Set alarm does live across the power cycle, at least works all the phones I have used.
Without rebooting the phone, you may want to check if your alarm is really getting set, that means if you are getting the alarm callback.

Set alarm does live across the power cycle, at least works all the phones I have used.
Without rebooting the phone, you may want to check if your alarm is really getting set, that means if you are getting the alarm callback.

Hi Ruben,
I checked this functionality on Moto Razr and the alarm does not persist after the power cycle.For that i had to have the boot up event, so that the alarm get sets again which was lost, and i retrieve this alarm from the pref file which i maintained off my own.
Regards,
Deepak

Hi Ruben,
I checked this functionality on Moto Razr and the alarm does not persist after the power cycle.For that i had to have the boot up event, so that the alarm get sets again which was lost, and i retrieve this alarm from the pref file which i maintained off my own.
Regards,
Deepak