← Back to team overview

ubuntu-phone team mailing list archive

Re: Prevent GPS from sleeping

 

On Sun, 19 Apr 2015 16:22:54 -0400
Rodney Dawes <rodney.dawes@xxxxxxxxxxxxx> wrote:

> Not currently, no. In the future, when background processing is
> available in some form, there should be a way for your app to get some
> data and process it, from the system service, in the background,
> though. I don't know when that will be possible, however.
> 
> Until then, the only way to have continuous processing for your app,
> is to ensure it is in the foreground, and the screen does not lock.
> The latter can be set by changing the screen timeout to Never in
> System Settings. This is something the person using your app would
> have to enable on their phone though, and they would also need to
> take care to keep the app in the foreground.
> 
> 
> On Sun, 2015-04-19 at 20:02 +0200, rpsoft wrote:
> > Hi Rodney,
> > 
> > Thanks for clarification.
> > The name of my app is "BikeMap".
> > So, is there any chance to prevent my app from pause if the screen
> > is locked ?
> > 
> > Regards,
> > Ralph
> > 
> > On 19.04.2015 19:35, Rodney Dawes wrote:
> > > What is your app? GPS itself remains active, as it is a system
> > > service, but when the screen is locked your app will be paused, so
> > > it will not be able to receive or perform any updates.
> > > 
> > > 
> > > On Sun, 2015-04-19 at 16:53 +0200, rpsoft wrote:
> > >> Hi,
> > >> 
> > >> I took again some tests with my app these days. Unfortunately
> > >> seems the gps device going to sleep while the phone is locked. It
> > >> has worked fine some month ago. Currently I'm on the stable
> > >> channel, Nexus 4 and I can't track any gps data anymore if the
> > >> phone is locked. Any ideas how do I can prevent this ?
> > >> 
> > >> Thank you. Regards, Ralph
> > > 
> 

Gps was turned off during sleep and non-active apps (ie background apps)
due to the fact that it was a constant drain on the battery. This
improved battery considerably but makes things like this not work.
There is one solution which is to keep your screen on and the app
active then you will keep gps active.  "powerd-cli display on" or
something along those lines. This will drain the battery considerably.
The other might be a fix in the rules that currently turn off gps so
that you can have it on all the time.  Thomas Voss might be able to
help you with that.  I have CC'd him in the email.

-- 
You Make It, I'll Break It!

I Love My Job :)

http://www.canonical.com
http://www.ubuntu.com

Attachment: pgpw8_zUCLTTp.pgp
Description: OpenPGP digital signature


Follow ups

References