Closed Bug 738529 Opened 12 years ago Closed 12 years ago

Check "screen" wake lock in power manager

Categories

(Firefox OS Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kanru, Assigned: kanru)

References

Details

Attachments

(1 file, 1 obsolete file)

Make the wake lock api useful by enabling the basic check of "screen" topic.

ref: https://github.com/andreasgal/gaia/issues/878
Assignee: nobody → kchen
Attachment #608598 - Flags: review?(jones.chris.g)
Comment on attachment 608598 [details] [diff] [review]
check "screen" wake lock in before turn off screen.


>+  let wakeLockHandler = function wakeLockHandler(topic, state) {
>+    if (topic == "screen" && state != "locked-foreground") {
>+      if (Services.idle.idleTime > idleTimeout*1000) {
>+        screen.mozEnabled = false;
>+      }

Conversely, if the screen is off and a wake-lock is acquire, I think
android turns the screen back on.  That seems reasonable to me.  Let's
do that here.

r=me with that change
Attachment #608598 - Flags: review?(jones.chris.g) → review+
(In reply to Chris Jones [:cjones] [:warhammer] from comment #2)
> Comment on attachment 608598 [details] [diff] [review]
> check "screen" wake lock in before turn off screen.
> 
> 
> >+  let wakeLockHandler = function wakeLockHandler(topic, state) {
> >+    if (topic == "screen" && state != "locked-foreground") {
> >+      if (Services.idle.idleTime > idleTimeout*1000) {
> >+        screen.mozEnabled = false;
> >+      }
> 
> Conversely, if the screen is off and a wake-lock is acquire, I think
> android turns the screen back on.  That seems reasonable to me.  Let's
> do that here.

OK. But the code you quoted runs when the wake-lock is "released". I will add another clause for the opposite case.
Yep.  That's what I meant.
Turn screen on if the wake lock is acquired.
Attachment #608598 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/95e583913662
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: