palm-client: exiting keeps a pending background-check alarm (the time Preferences showed)
This commit is contained in:
1 parent
33867c9ffe
commit
297a53ac49
3 files changed
+14
-2
No files matched your search
@@ -94,6 +94,16 @@ void BgSchedule(void)
|
||||
SetAlarm(minutes ? TimGetSeconds() + (UInt32)minutes * 60 : 0);
|
||||
}
|
||||
|
||||
void BgScheduleIfIdle(void)
|
||||
{
|
||||
UInt16 card;
|
||||
LocalID id;
|
||||
UInt32 ref;
|
||||
|
||||
if (!FindSelf(&card, &id) || AlmGetAlarm(card, id, &ref) <= TimGetSeconds())
|
||||
BgSchedule();
|
||||
}
|
||||
|
||||
void BgAlarmTriggered(SysAlarmTriggeredParamType *p)
|
||||
{
|
||||
UInt16 card, curCard;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* for display, and BgDisplayAlarm shows an alert with an Open button.
|
||||
*
|
||||
* While the app is open it checks for itself: the alarm keeps coming and is
|
||||
* skipped, and exiting sets it N minutes on.
|
||||
* skipped.
|
||||
*/
|
||||
#ifndef VM_BGCHECK_H
|
||||
#define VM_BGCHECK_H
|
||||
@@ -24,6 +24,8 @@ void BgSetInterval(UInt16 minutes);
|
||||
|
||||
/* Sets the next alarm from the interval (clears it when off). */
|
||||
void BgSchedule(void);
|
||||
/* BgSchedule unless an alarm is already pending (at exit: keeps the time Preferences showed). */
|
||||
void BgScheduleIfIdle(void);
|
||||
|
||||
/* Launch codes; no globals needed. */
|
||||
void BgAlarmTriggered(SysAlarmTriggeredParamType *p);
|
||||
|
||||
@@ -206,7 +206,7 @@ UInt32 PilotMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
|
||||
ChannelsClose();
|
||||
MessagesClose();
|
||||
UiFontRelease();
|
||||
BgSchedule();
|
||||
BgScheduleIfIdle();
|
||||
}
|
||||
return errNone;
|
||||
}
|
||||
Reference in new issue
Block a user