On Tuesday, November 10, 2015 at 3:28:54 PM UTC+8, Kan-Ru Chen (陳侃如) wrote:
> Douglas Turner <[email protected]> writes:
> 
> > We don't want to add more options to the geolocation API.
> 
> The reason?
> 
> > I do agree with Jonas -- we can stop sending events to backgrounded
> > applications if we add a wake lock (?) for geolocation?  A side effect of
> > this could be to have system UI that shows that geo is being used in the
> > background.
> >
> > Thoughts?
> 
> Using a new option or a new wake lock both seem fine to me. The wake
> lock state "locked-background"[1] can be used for that. But note that
> the currrent draft w3c wake-lock spec requires the document to be
> visible[2] to use wake lock. If the draft spec is implemented at some
> point, it will look like[3]
> 
>   partial interface Geolocation {
>       attribute boolean keepAwake;
>   }
> 

Yes. By adding this kind of "wakelock" to lock some services which are 
requested from the background apps, will be feasible. 

For my understanding and opinions now, adding an background option in 
geolocation option API is a way to make sure that the developers know what kind 
of the behavior will happened in the background at the beginning.  
 
And by using a "wakelock" for GPS service. Maybe we need to make it clear that 
using this GPS lock is no difference when your app is visible. It's using for 
background state only. 
 
YaChieh

> which is not very different from a new option, IMO.
> 
> [1]: 
> https://developer.mozilla.org/en-US/docs/Web/API/MozPowerManager/getWakeLockState#Return_value
> [2]: http://w3c.github.io/wake-lock/#managing-wake-locks
> [3]: http://w3c.github.io/wake-lock/#additional-lock-types
> 
> > On Thu, Nov 5, 2015 at 7:44 PM Shawn Huang <[email protected]> wrote:
> >
> >> ​On behave of Ya-Chieh Wu <[email protected]>
> >>
> >> Bugzilla:
> >> https://bugzilla.mozilla.org/show_bug.cgi?id=1216148
> >>
> >> Symptom:
> >> There is no specific way to indicate if an application wants to use GPS in
> >> the background. Currently, we don’t stop GPS when application goes to
> >> background which might result in increase in battery use. On Android and
> >> iOS, getting GPS in the background is not a default behavior.
> >>
> >>
> >> Summarize the solutions which we brought up here or in Bugzilla before:
> >>
> >> (1)add a geolocation choice in wakeLock [1]
> >>
> >> window.navigator.requestWakeLock(type)
> >> var lock = window.navigator.requestWakeLock('screen’);
> >> lock.unlock();
> >>
> >>
> >> (2)add a property in PositionOptions [2]
> >> runInBackground = true, //default is false
> >>
> >>
> >> id = navigator.geolocation.watchPosition(success, error, options);
> >> options = {
> >>   enableHighAccuracy: false,  //default: false
> >>   timeout: 5000,   //default: Infinity
> >>   maximumAge: 0  //default: Infinity
> >>  };
> >>
> >> [1]
> >>
> >> https://groups.google.com/forum/#!searchin/mozilla.dev.geolocation/Backgrounded$20apps$20using$20GPS$20|sort:relevance/mozilla.dev.geolocation/UXkd3Tz1GPc/BtqtJ81Wi2YJ
> >>
> >> [2]https://bugzilla.mozilla.org/show_bug.cgi?id=1216148#c6
> >>
> >>
> >>
> >>  any other suggestion to contribute this API ?
> >>
> >>
> >>
> >>
> >>
> >> --
> >> Regards,
> >> Shawn Huang
> >> _______________________________________________
> >> dev-geolocation mailing list
> >> [email protected]
> >> https://lists.mozilla.org/listinfo/dev-geolocation
> >>
> > _______________________________________________
> > dev-geolocation mailing list
> > [email protected]
> > https://lists.mozilla.org/listinfo/dev-geolocation

_______________________________________________
dev-geolocation mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-geolocation

Reply via email to