According the definition of Alarm API behavior (https://wiki.mozilla.org/WebAPI/AlarmAPI), we need to dynamically adjust alarm firing time for those "ignoreTimezone" alarms whenever the timezone is reset by platform. The internal logic for adjusting alarm setting time has been done in AlarmService.jsm, all we need to do is let AlarmHalService.cpp hook up an observer to listen to the system timezone changes by using hal::RegisterSystemTimeChangeObserver(), which is just available at Bug 714358. Some implementation details can found at https://bugzilla.mozilla.org/show_bug.cgi?id=749551#c99.
This might be a basecamp-clocker since we need to refine the Alarm API behaviors, although it doesn't block any app design so far.
Created attachment 660377 [details] [diff] [review] Patch Hi :cjones again :) I'd like to invite you to review this patch, which should be trivial. Please see comment #0 for more details. This should be the last piece to support the complete Alarm API behaviors.
Attachment #660377 - Flags: review?(jones.chris.g)
Gene: Will this also fire any alarms which have now "passed"? I.e. 1. User is in the GMT timezone and set an alarm for 8am. 2. Time is 7:31am. 3. User walks across the border into the GMT+1 timezone and sets the timezone setting in the phone accordingly. 4. Time on the phone is now 8:31am. This patch adjusts the time which the alarm fires. Does it also cause the alarm to fire in step 4?
Attachment #660377 - Flags: review?(jones.chris.g) → review+
(In reply to Jonas Sicking (:sicking) from comment #3) > Gene: Will this also fire any alarms which have now "passed"? > > I.e. > > 1. User is in the GMT timezone and set an alarm for 8am. > 2. Time is 7:31am. > 3. User walks across the border into the GMT+1 timezone and sets the > timezone setting > in the phone accordingly. > 4. Time on the phone is now 8:31am. > > This patch adjusts the time which the alarm fires. Does it also cause the > alarm to fire in step 4? Hi Jonas, Good question! ;) Yes! It'll fire all the alarms (specifically, "ignoreTimezone" alarms here) that have already passed no matter it's due to: 1. Normal time passing (of course). 2. Manual timezone changing. 3. Manual clock time changing. All the behaviors for re-checking passed alarms have been designed in the AlarmService.jsm. This patch is just aimed to hook it up to the system timezone changes to enable everything. ;) I won't submit this patch until you're OK with that. Please let me know. :)
Sounds great!! Thanks!
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.