Closed Bug 1240664 Opened 4 years ago Closed 4 years ago

Follow-up to bug 1216148. Only enable geolocation wake lock in firefox OS.

Categories

(Core :: DOM: Geolocation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox46 --- fixed
firefox47 --- fixed

People

(Reporter: ywu, Assigned: ywu)

References

Details

Attachments

(1 file, 1 obsolete file)

Since browser doesn't have the wakelock implementation, we only enable geolocation wakelock in firefox OS.
Only enable Bug 1216148's behavior when there is a wakelock support.
Attachment #8714176 - Flags: review?(kchen)
Remove the redundant line of #include "mozilla/Preferences.h" in previous patch
Attachment #8714176 - Attachment is obsolete: true
Attachment #8714176 - Flags: review?(kchen)
Attachment #8714200 - Flags: review?(kchen)
Attachment #8714200 - Flags: review?(kchen) → review+
Comment on attachment 8714200 [details] [diff] [review]
Only enable Bug 1216148's behavior when there is a wakelock support

Approval Request Comment
[Feature/regressing bug #]: bug 1216148
[User impact if declined]: web content cannot use geolocation when the page is visibilityState=hidden. We don't plan to ship this on Firefox yet so this patch disables it.
[Describe test coverage new/current, TreeHerder]: manually tested
[Risks and why]: no
[String/UUID change made/needed]: no
Attachment #8714200 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/f3c3367ba057
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
1) Is there a way to turn this off as a user, e.g. if I prefer working GPS tracking to a little saved power?
2) Is there a way for "hosted apps" (websites used like apps) to use wakelocks to keep GPS working in the background?
Hey Robert,

Your idea sounds feasible and it sounds like another power manager on smartphone that could be able to turn on/off every apps' power consumption behavior. But this is another work I think. And I am not working on this though. 

Right now, we leave app developers to decide if this app is able to track in background or not. We don't ship any feature that leave this power consumption issue to users yet.

thanks!
(In reply to Robert Kaiser (:kairo@mozilla.com) from comment #6)
> 1) Is there a way to turn this off as a user, e.g. if I prefer working GPS
> tracking to a little saved power?

Not currently. Maybe this could be implemented as a per-app or per-origin permission settings like on iOS.

> 2) Is there a way for "hosted apps" (websites used like apps) to use
> wakelocks to keep GPS working in the background?

navigator.mozRequestWakeLock is exposed to content on FxOS so any web content can opt to keep GPS working in the background.
Comment on attachment 8714200 [details] [diff] [review]
Only enable Bug 1216148's behavior when there is a wakelock support

Limits some GLS changes in 46 to FxOS. Please uplift to aurora.
Attachment #8714200 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
has problems uplifting to aurora:

grafting 326532:f3c3367ba057 "Bug 1240664 - Only enable bug 1216148's behavior when there is a wakelock support. r=kanru"
merging dom/geolocation/nsGeolocation.cpp
warning: conflicts while merging dom/geolocation/nsGeolocation.cpp! (edit, then use 'hg resolve --mark')
abort: unresolved conflicts, can't continue
(use hg resolve and hg graft --continue)

could you take a look ? thanks!
Flags: needinfo?(ywu)
Hey Carsten,

It seems that it's already been merged into aurora 2 days ago as below 
http://hg.mozilla.org/releases/mozilla-aurora/rev/31ac86b9b417

Anyway thank you so much.
Flags: needinfo?(ywu)
thanks! setting the flags :)
Assignee: nobody → ywu
You need to log in before you can comment on or make changes to this bug.