On Oct 24, 6:11 pm, JP <[email protected]> wrote:
 By mapping multiple objects (listeners) with
> different attribute values to a single one (location provider), you
> never know what you will get.

The documentation says that you can't be sure what you'll get. You
will probably get location updates at least as often as specified by
the time parameter, but there's no guarantee. Maybe you'll get the
updates more often than you specified because some other app needs
them more often? I don't know.

> In the extreme, you can choke
> off the foreground app's location provider, no?

You can choke the foreground app anyway, if you want to. But you don't
- I guess.

>
> On Oct 24, 2:00 am, Lance Nanek <[email protected]> wrote:
>
> > >multiple listeners for a location provider with different minTime 
> > >intervals - which value should be used
>
> > Looks like the current implementation uses the shortest value for that
> > situation:http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> > Seems like an OK decision there from some quick tests. I called
> > requestLocationUpdates for two listeners. One with a power conserving
> > hint argument of 30 seconds. The other with 60 seconds. Both listeners
> > got the same update frequency. In number of seconds between
> > onLocationChanged calls:
> > 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 39, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
> > 37, ...
>
> > Corresponding to occasional ~30 second shutdowns. Once I called
> > removeUpdates for the listener that was registered for 30 seconds,
> > then the listener registered for 60 seconds started getting what it
> > would normally get:
> > 2, 1, 69, 1, 1, 3, 1, 2, 1, 2, 1, 2, 1, 70, 1, 1, 2, 1, 2, 1, 2,
> > 1, ...
>
> > ~60 second shutdowns. End result, the listener that was registered
> > saying it is OK with ~60 second shutdowns never actually has to wait
> > that long if there is another listener registered that wants more
> > frequent updates. Meanwhile the one that wants the most frequent
> > updates gets what it normally would.
>
> > On Oct 23, 10:30 am, JP <[email protected]> wrote:
>
> > > (Refers to the logs) This occurs every 3s, although minTime is much
> > > higher, just as you've found. I will venture to say that this is
> > > harder on the battery than to just let GPS stand.
> > > BTW, resting a location provider this way is also mis-spec'ed. If an
> > > app registers multiple listeners for a location provider with
> > > different minTime intervals - which value should be used to control
> > > the location provider?
> > > It certainly isn't in line with 1.5 behavior, or with anything I've
> > > seen on any device.
>
> > > I suppose I can't be sold on this being a feature, not a bug.
>
> > > On Oct 22, 11:40 pm, Lance Nanek <[email protected]> wrote:
>
> > >  Is this behavior hurting an app you use/wrote in some way? It seems
> > >  within spec.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to