Comment 130 for bug 604635

Revision history for this message
In , Kchen-d (kchen-d) wrote :

(In reply to Justin Lebar [:jlebar] from comment #98)
> > They could in theory..
>
> An app could keep the screen turned on while it's in the background only if
> we design this feature badly, IMO. It will look like *our* bug to a user if
> the screen is stuck on, even if it's a bug in the app.
>
> If we wanted to go down the road of assuming that apps are bug free, we
> could similarly declare that apps should explicitly release() all wake locks
> on unload. But we agree that's a bad idea, right?

Yeah, I agree that it's very easy to forget to release the lock. We should release all the locks when the page is closed, and we already do. But for background apps, they will want to keep the locks even when the page is invisible. So we can either allow all apps to keep their locks when they are hidden, which I think is bad, or require special permission to do that.

>
> > otherwise we have to have different permission group for them.
>
> I'm not sure what you mean by a "permission group".

I mean the background app should require special permission to keep the locks.

> What about, when we ask "is the wakelock for aTopic held?", instead of
> returning true/false, we returned "not held", "held by at least one
> foreground app", or "held by only background apps"?

That would not work because it's not clear if any "background apps" still needs the resource.