GPS not disconnected when powersaving on KitKat

Started by GammelGreggan, October 02, 2014, 10:29:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GammelGreggan

If I set GPS interval to say 10 minutes I expect Oruxmaps to start GPS, find fix and then disconnect the GPS to save power. But as far as I can see the GPS is still connected in-between the intervals.

On Jellybean this worked fine but on KitKat this doesn't work.



I tried GPSlogger and here the GPS is disconnected between intervals.

orux

#1
Quote from: "GammelGreggan"If I set GPS interval to say 10 minutes I expect Oruxmaps to start GPS, find fix and then disconnect the GPS to save power. But as far as I can see the GPS is still connected in-between the intervals.

On Jellybean this worked fine but on KitKat this doesn't work.



I tried GPSlogger and here the GPS is disconnected between intervals.


Hi,



I think it is working fine.



This is done by android, not by the app.



Android decides if it should turn off or not the GPS chip.



Working fine with my SG4, android 4.4.2 version; GPS time between measurements set to 8 seconds.



orux

GammelGreggan

#2
Quote from: "orux"
Hi,



I think it is working fine.



This is done by android, not by the app.



Android decides if it should turn off or not the GPS chip.



Working fine with my SG4, android 4.4.2 version; GPS time between measurements set to 8 seconds.



orux


So you see the GPS icon in the status bar for a while and then it disappears for the amount of time you have set as interval, correct?

With GPSlogger the icon disappears but not with Oruxmaps.



I need to test this more.

orux

#3
Quote from: "GammelGreggan"
Quote from: "orux"
Hi,



I think it is working fine.



This is done by android, not by the app.



Android decides if it should turn off or not the GPS chip.



Working fine with my SG4, android 4.4.2 version; GPS time between measurements set to 8 seconds.



orux


So you see the GPS icon in the status bar for a while and then it disappears for the amount of time you have set as interval, correct?

With GPSlogger the icon disappears but not with Oruxmaps.



I need to test this more.


Hi,



but it depends on the android implementation.



there are devices that requires 8 seconds between measurements at least to start turning off the GPS. In other devices, 4 seconds is enough. In very old devices, 2 seconds was the default setting, and the device normally turned off the GPS.



orux

GammelGreggan

#4
Quote from: "orux"


Hi,



but it depends on the android implementation.



there are devices that requires 8 seconds between measurements at least to start turning off the GPS. In other devices, 4 seconds is enough. In very old devices, 2 seconds was the default setting, and the device normally turned off the GPS.



orux


Ok, I understand.

But still, with GPSlogger I see the gps icon (looking like a waypoint icon in the status bar) come and go, but not with the Oruxmaps.

I tried both with 30 seconds and 10 minutes interval.

Using gpsstatus app I see its icon for gps request come and go for Oruxmaps thou.

So, I am still not convinced that the gps really is turned of in between the intervals.



By the way I am on Sony Z3 with 4.4.4.

GammelGreggan

#5
I took some screenshots from when the Oruxmaps retrieves position, in-between retrieving (30 s interval) and when tracking was off.

Unfortunately I am not allowed to add them here so I put them in my Dropbox: https://www.dropbox.com/sh/hslv2kezh5iqlsy/AABiAWzSrHumxwBxg7Za3fZVa?dl=0">https://www.dropbox.com/sh/hslv2kezh5iq ... 3fZVa?dl=0">https://www.dropbox.com/sh/hslv2kezh5iqlsy/AABiAWzSrHumxwBxg7Za3fZVa?dl=0



In GPSstatus it is possible to configure an icon to be shown when any app is requesting a fix from the GPS so I used it to show that indeed Oruxmaps is following it's intervals, but the connection to the GPS is not released.



"Oruxmaps, GPS off.png" shows what it looks like when no tracking is enabled; the GPS icon is gone.

"Oruxmaps, 30 s interval, retrieving position.png" is when tracking is enabled and position is retrieved (GPS interval 1 s, i.e. always on); Androids and GPSstatus icons are visible.

"Oruxmaps, 30 s interval, between intervals.png" is when the GPS is supposed to be off due to Oruxmaps is resting; the GPSstatus icon is gone but the Android GPS icon is still visible, i.e. the GPS chip is still enabled and consumes power.



Running the same test with GPSLogger shows that the Android GPS icon also is gone during rest period.



Do you see another behavior in your phone?

orux

#6
Quote from: "GammelGreggan"I took some screenshots from when the Oruxmaps retrieves position, in-between retrieving (30 s interval) and when tracking was off.

Unfortunately I am not allowed to add them here so I put them in my Dropbox: https://www.dropbox.com/sh/hslv2kezh5iqlsy/AABiAWzSrHumxwBxg7Za3fZVa?dl=0">https://www.dropbox.com/sh/hslv2kezh5iq ... 3fZVa?dl=0">https://www.dropbox.com/sh/hslv2kezh5iqlsy/AABiAWzSrHumxwBxg7Za3fZVa?dl=0



In GPSstatus it is possible to configure an icon to be shown when any app is requesting a fix from the GPS so I used it to show that indeed Oruxmaps is following it's intervals, but the connection to the GPS is not released.



"Oruxmaps, GPS off.png" shows what it looks like when no tracking is enabled; the GPS icon is gone.

"Oruxmaps, 30 s interval, retrieving position.png" is when tracking is enabled and position is retrieved (GPS interval 1 s, i.e. always on); Androids and GPSstatus icons are visible.

"Oruxmaps, 30 s interval, between intervals.png" is when the GPS is supposed to be off due to Oruxmaps is resting; the GPSstatus icon is gone but the Android GPS icon is still visible, i.e. the GPS chip is still enabled and consumes power.



Running the same test with GPSLogger shows that the Android GPS icon also is gone during rest period.



Do you see another behavior in your phone?


Hi,



I think the GPS icon works different in android 4.4.4.



It remains visible if an application is registered to receive the signal, but I think it keeps shutting off the chip when needed (that's what GPS Status shows).



There is no indication of changes in the SDK.



orux

GammelGreggan

#7
Ok. It could be that the GPSLogger is unregistering from the gps between the intervals?!

GammelGreggan

#8
I am working in a project where we develop an Android phone and according to one of my colleagues the API in Kitkat has changed a lot. The old API is still present thou but he thinks that the handling of the GPS behind the API has changed also.

I will look into the GPS code when I have time to see if I am able to understand the behavior of the GPS icon.



Just a question; what is the difference in behavior in Oruxmaps between when stopping the logging/tracking and when the tracking is sleeping in-between the log intervals?

Do you disconnect the GPS when disabling tracking? Because, when tracking is off the GPS icon is gone.

orux

#9
Quote from: "GammelGreggan"I am working in a project where we develop an Android phone and according to one of my colleagues the API in Kitkat has changed a lot. The old API is still present thou but he thinks that the handling of the GPS behind the API has changed also.

I will look into the GPS code when I have time to see if I am able to understand the behavior of the GPS icon.



Just a question; what is the difference in behavior in Oruxmaps between when stopping the logging/tracking and when the tracking is sleeping in-between the log intervals?

Do you disconnect the GPS when disabling tracking? Because, when tracking is off the GPS icon is gone.


Hi,



oruxmaps uses ->http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates%28java.lang.String,%20long,%20float,%20android.location.LocationListener%29">http://developer.android.com/reference/ ... istener%29">http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates%28java.lang.String,%20long,%20float,%20android.location.LocationListener%29



when you start recording a track, then ->http://developer.android.com/reference/android/location/LocationManager.html#removeUpdates%28android.location.LocationListener%29">http://developer.android.com/reference/ ... istener%29">http://developer.android.com/reference/android/location/LocationManager.html#removeUpdates%28android.location.LocationListener%29



when you stop recording a track.



In the middle, it is android who decides to turn off the gps chip, based on the request parameters, and if there are more applications requesting locations.





orux