Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug 817888 - Dialer, new incoming call (call waiting) should turn the…

… screen back on.

r=timdream
  • Loading branch information...
commit 3382e9a3b7cd4958a94339a7e61ccefea24eef42 1 parent ac39f39
@etiennesegonzac etiennesegonzac authored
View
21 apps/communications/dialer/js/oncall.js
@@ -130,11 +130,18 @@ var CallScreen = {
this.callToolbar.classList.add('transparent');
this.incomingContainer.classList.add('displayed');
+
+ screenLock = navigator.requestWakeLock('screen');
},
hideIncoming: function cs_hideIncoming() {
this.callToolbar.classList.remove('transparent');
this.incomingContainer.classList.remove('displayed');
+
+ if (screenLock) {
+ screenLock.unlock();
+ screenLock = null;
+ }
},
syncSpeakerEnabled: function cs_syncSpeakerEnabled() {
@@ -275,8 +282,16 @@ var OnCallHandler = (function onCallHandler() {
}
if (handledCalls.length > 1) {
- // signaling the user of the new call
- navigator.vibrate([100, 100, 100]);
+ // New incoming call, signaling the user.
+ // Waiting for the screen to be turned on before vibrating.
+ if (document.mozHidden) {
+ window.addEventListener('mozvisibilitychange', function waitOn() {
+ window.removeEventListener('mozvisibilitychange', waitOn);
+ navigator.vibrate([100, 100, 100]);
+ });
+ } else {
+ navigator.vibrate([100, 100, 100]);
+ }
var number = (call.number.length ? call.number : _('unknown'));
Contacts.findByNumber(number, function lookupContact(contact) {
@@ -559,7 +574,7 @@ var OnCallHandler = (function onCallHandler() {
var message = {
type: 'recent',
entry: entry
- }
+ };
postToMainWindow(message);
}
View
8 apps/system/js/screen_manager.js
@@ -176,6 +176,14 @@ var ScreenManager = {
break;
}
+ // If the _cpuWakeLock is already set we are in a multiple
+ // call setup, turning the screen on to let user see the
+ // notification.
+ if (this._cpuWakeLock) {
+ this.turnScreenOn();
+ break;
+ }
+
this._cpuWakeLock = navigator.requestWakeLock('cpu');
window.addEventListener('userproximity', this);
break;
Please sign in to comment.
Something went wrong with that request. Please try again.