Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Bug 814632 - [Clock] Put a silent alarm screen underneath the oncall screen if the alarm goes off during a phone call r=timdream #6816

Merged
merged 1 commit into from

1 participant

@ian-liu
Collaborator

Check onRing page is visible or not during init() state.
If it's hidden, don't the active alarm with ring/vibration.

Note: In this case, system::attention_screen have set the alarm screen visibility to false since there is an oncall screen showing. It will let alarm screen underneath the oncall screen.

@ian-liu ian-liu Bug 814632 - [Clock] Put a silent alarm screen underneath the oncall …
…screen if the alarm goes off during a phone call r=timdream
7157fb8
@ian-liu
Collaborator

Got r+, let merge the pr.
We still need to deal with more visibility checks with bug 809087 and bug 817489.

@ian-liu ian-liu merged commit df38f79 into mozilla-b2g:master
@timdream timdream referenced this pull request from a commit
@timdream timdream Revert "Merge pull request #6816 from ian-liu/clock/Bug814632_silent_…
…alarm_screen_underneath_call_screen"

This reverts commit df38f79, reversing
changes made to 1734754.
b866237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 5, 2012
  1. @ian-liu

    Bug 814632 - [Clock] Put a silent alarm screen underneath the oncall …

    ian-liu authored
    …screen if the alarm goes off during a phone call r=timdream
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 7 deletions.
  1. +20 −7 apps/clock/js/onring.js
View
27 apps/clock/js/onring.js
@@ -36,9 +36,14 @@ var RingView = {
init: function rv_init() {
this.setAlarmTime();
this.setAlarmLabel();
- this.setWakeLockEnabled(true);
- this.ring();
- this.vibrate();
+ // If mozHidden is true in init state,
+ // it means that alarm screen underneath the oncall screen.
+ // Don't let the alarm ring and vibrate.
+ if (!document.mozHidden) {
+ this.setWakeLockEnabled(true);
+ this.ring();
+ this.vibrate();
+ }
document.addEventListener('mozvisibilitychange', this);
this.snoozeButton.addEventListener('click', this);
this.closeButton.addEventListener('click', this);
@@ -107,14 +112,22 @@ var RingView = {
stopAlarmNotification: function rv_stopAlarmNotification(action) {
switch (action) {
case 'ring':
- this._ringtonePlayer.pause();
+ if (this._ringtonePlayer)
+ this._ringtonePlayer.pause();
+
break;
case 'vibrate':
- window.clearInterval(this._vibrateInterval);
+ if (this._vibrateInterval)
+ window.clearInterval(this._vibrateInterval);
+
break;
default:
- this._ringtonePlayer.pause();
- window.clearInterval(this._vibrateInterval);
+ if (this._ringtonePlayer)
+ this._ringtonePlayer.pause();
+
+ if (this._vibrateInterval)
+ window.clearInterval(this._vibrateInterval);
+
break;
}
this.setWakeLockEnabled(false);
Something went wrong with that request. Please try again.