android - Find outstanding requestLocationUpdates -
i want know if there way tell if (not application) has called requestlocationupdates. writing service monitors location, don't want interfere other apps (e.g. waze, endomondo) might monitoring location. don't see api in locationmanager object can tell me if there outstanding request location update. thoughts?
yes api >= 8, can find out if application has called requestlocationupdates
calling
requestlocationupdates(locationmanager.passive_provider, mintime, mindist, listener);
official document
public static final string passive_provider
added in api level 8
a special location provider receiving locations without initiating location fix.
this provider can used passively receive location updates when other applications or services request them without requesting locations yourself. provider return locations generated other providers. can query getprovider() method determine origin of location update. requires permission access_fine_location, although if gps not enabled provider might return coarse fixes.
constant value: "passive"
onlocationchanged not called until application request fix.
Comments
Post a Comment