The docs do mention:
"If minTime is greater than 0, the LocationManager could potentially
rest for minTime milliseconds between location updates to conserve
power."
http://developer.android.com/intl/fr/reference/android/location/LocationManager.html#requestLocationUpdates%28java.lang.String,%20long,%20float,%20android.location.LocationListener%29

So isn't it just stopping occasionally to save power like the docs say
it can?

Looking at the code where it stops, it sets an alarm to start sending
updates again based on the requested time between updates. Doing a few
tests on my G1, the time it stays stopped does seem a little off. If I
request 30 seconds minimum time between updates then the time between
updates when it turns off is usually around 37 seconds. If I request 5
then I get around 7. If I request 2 then I get 3. Maybe the stopped
time should be tweaked down a few seconds. Could be I'm in a bad spot
for GPS or something, though, and it is taking longer to start back up
than it would otherwise.

The docs do mention:
"the minimum time interval for notifications, in milliseconds. This
field is only used as a hint to conserve power, and actual time
between location updates may be greater or lesser than this value."

So I can't really complain about it being a few seconds off, though,
or about how the updates come much faster when the implementation
decides not to stop to save power in between sending them.

Is this behavior hurting an app you use/wrote in some way? It seems
within spec.

On Oct 22, 11:30 pm, JP <joachim.pfeif...@gmail.com> wrote:
> Root cause identified. Pretty obvious bug in Android 1.6,
> GpsLocationProvider.java. Source 
> here:http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
> I've reported the bug 
> here:http://code.google.com/p/android/issues/detail?id=4336
>
> Symptoms: Described above.
> To reproduce problem: Register a GPS location provider and set the min
> time interval to greater than 1. A overrun as shown in the log trace
> above occurs after a few second. GPS location provider then hibernates
> (which resets the counter) just to overrun on the next cycle.
>
> *** This affects everyone who relies on LocationListener callbacks to
> onLocationChanged(), based on time intervals.  ***
>
> Code review: When the GPS location provider reports a location update,
> the mFixCount counter is incremented, but never reset except when the
> location provider is hibernated as a result of the counter overrun.
> Look for mFixCount in the source file and it's pretty apparent.
>
> On Oct 21, 10:08 pm, JP <joachim.pfeif...@gmail.com> wrote:
>
> > Looks like I've run into some breakage from 1.5 to 1.6 after all...
> > I am registering location listeners with
> > LocationManager.requestLocationUpdates()
> > With GPS as location provider, I run into a problem with navigation
> > stopping by itself after a few seconds, just to return, stop again, in
> > an endless cycle. I haven't seen this prior to 1.6 Donut and I have no
> > clue what might cause this problem.
>
> > Here's the Logcat output:
>
> > 10-21 21:53:09.147: DEBUG/libgps(74): PDSM_PD_EVENT_GPS_BEGIN
> > 10-21 21:53:11.177: DEBUG/GpsLocationProvider(74): exceeded
> > MIN_FIX_COUNT
> > 10-21 21:53:11.177: DEBUG/GpsLocationProvider(74): stopNavigating
> > 10-21 21:53:11.177: DEBUG/libgps(74): qct_gps_stop
> > 10-21 21:53:11.187: DEBUG/libgps(74): PDSM_PD_EVENT_END
> > 10-21 21:53:11.187: DEBUG/GpsLocationProvider(74): Releasing wakelock
> > 10-21 21:53:13.097: DEBUG/dalvikvm(74): GC freed 2562 objects / 104912
> > bytes in 223ms
> > 10-21 21:53:20.227: DEBUG/dalvikvm(74): GC freed 1345 objects / 51352
> > bytes in 236ms
> > 10-21 21:53:21.180: DEBUG/GpsLocationProvider(74): ALARM_WAKEUP
> > 10-21 21:53:21.187: DEBUG/GpsLocationProvider(74): startNavigating
> > 10-21 21:53:21.187: DEBUG/libgps(74): qct_gps_set_position_mode = 1,
> > fix_frequency = 10
> > 10-21 21:53:21.187: DEBUG/libgps(74): qct_gps_start
> > 10-21 21:53:21.207: DEBUG/GpsLocationProvider(74): Acquiring wakelock
> > 10-21 21:53:22.147: DEBUG/libgps(74): PDSM_PD_EVENT_GPS_BEGIN
> > 10-21 21:53:24.167: DEBUG/GpsLocationProvider(74): TTFF: 2978
> > 10-21 21:53:27.287: DEBUG/dalvikvm(74): GC freed 1417 objects / 52512
> > bytes in 232ms
> > 10-21 21:53:34.397: DEBUG/GpsLocationProvider(74): exceeded
> > MIN_FIX_COUNT
> > 10-21 21:53:34.397: DEBUG/GpsLocationProvider(74): stopNavigating
> > (and so forth)
>
> > A web research for these logs didn't turn up anything (which is
> > unusual in my experience), so this leads me to post the question here
> > wondering what the root of the problem might be... Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to