Closed Bug 790497 Opened 12 years ago Closed 12 years ago

Alarm API - Adjust firing time for "ignoreTimezone" alarms when timezone is reset

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18
blocking-basecamp +

People

(Reporter: airpingu, Assigned: airpingu)

References

Details

(Keywords: feature, Whiteboard: [LOE:S])

Attachments

(1 file)

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.
Assignee: nobody → clian
Blocks: alarm-api
blocking-basecamp: --- → ?
Depends on: 714358
Attached patch PatchSplinter Review
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)
blocking-basecamp: ? → +
Keywords: feature
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+
Whiteboard: [LOE:S]
(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. :)
Keywords: checkin-needed
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/305aa7e41494
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Depends on: 791962
No longer depends on: 791962
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: