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;
  }

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