Permalink
Browse files

Merge pull request #7238 from vingtetun/822463

Bug 822463 - If I hit power button just before taking a screenshot, phon...
  • Loading branch information...
2 parents 39d283d + 4d50dd0 commit 1e1426f7f4f2925293feea4917df03d5d690d2bf @vingtetun vingtetun committed Dec 28, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 apps/system/js/screen_manager.js
@@ -235,6 +235,14 @@ var ScreenManager = {
self.screen.classList.add('screenoff');
setTimeout(function realScreenOff() {
self.setScreenBrightness(0, true);
+ // Sometimes the ScreenManager.screenEnabled and mozPower.screenEnabled
+ // values are out of sync. Since the rest of the world relies only on
+ // the value of ScreenManager.screenEnabled it can be some situations
+ // where the screen is off but ScreenManager think it is on... (see
+ // bug 822463). Ideally a callback should have been used, like
+ // ScreenManager.getScreenState(function(value) { ...} ); but there
+ // are too many places to change that for now.
+ self.screenEnabled = false;
navigator.mozPower.screenEnabled = false;
}, 20);

0 comments on commit 1e1426f

Please sign in to comment.