History log of /frameworks/base/location/java/android/location/LocationRequest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7ab7f538924371a9dd4be7a27a6ae3b4c04b301c 30-Oct-2012 Laurent Tu <laurentt@google.com> Hide new location APIs and undeprecate old ones

Hide all new location APIs related to LocationRequest/Geofence and
undeprecate all deprecated APIs consequently to the LocationRequest and
Geofence introduction. Also introduce LocationRequestUnbundled for
LocationProviders to use.

Change-Id: I5b116c7d342041f45b341c88a4b6813571118018
/frameworks/base/location/java/android/location/LocationRequest.java
37425c3475877f2fdadb78f669ec57fecf82dca7 17-Oct-2012 Victoria Lease <violets@google.com> LocationManager permissions cleanup

This commit is the result of a comprehensive permissions review for
MR1 release. It addresses a number of deviations from spec and from
MR0's behavior, bringing MR1 into sync with both.

It also cleans up the concept of "location resolution permission",
representing it internally as an enumerated access level to reduce
reliance on cumbersome string manipulation. There's a function to
convert the enum int into a permission string where needed, too.

Additionally, this confines caller-identity-sensitive calls to the
hopefully-obviously-named "getCallerAllowedResolutionLevel()". This
should make it much easier to prove correctness with respect to
accidentally calling functions that depend upon the caller's identity
after identity has already been shed by Binder.clearCallingIdentity().

Change-Id: I446169aee8fb2fde26ac6d04b479b40253782acb
/frameworks/base/location/java/android/location/LocationRequest.java
e72fe16146dd33cb218bf8c16b069f68f331fdf8 04-Oct-2012 Laurent Tu <laurentt@google.com> Prevent overflow in LocationRequest.setExpireIn()

Prevent overflow in LocationRequest.setExpireIn(), for example,
when we pass in Long.MAX_VALUE.

Bug: 7047435
Change-Id: Ie56928a59fb387173fbd3887c0ef9aede00f8152
/frameworks/base/location/java/android/location/LocationRequest.java
09016ab4dd056a16809419d612cb865a14980880 16-Sep-2012 Victoria Lease <violets@google.com> Do not use passive GPS data for COARSE only apps.

FusionEngine now attaches a secondary location that has never seen
GPS data to its result. LocationFudger uses the GPS-less location so
that COARSE apps never see data from the GPS provider.

When the previous location is updated, the previous GPS-less location
is carried over if the location update was GPS-only.

Additionally, apps without FINE permission are not notified when GPS
location changes, and any attempt to use GPS_PROVIDER without FINE
permission is met by a stern SecurityException.

Bug: 7153659
Change-Id: I12f26725782892038ce1133561e1908d91378a4a
/frameworks/base/location/java/android/location/LocationRequest.java
4e31c4fffbc42b4c2b5dca6431cfeef9e078f5b4 14-Aug-2012 Nick Pelly <npelly@google.com> Add javadoc for new location API's.

Change-Id: If15024ee88421c07ba3a174747774fc451fd002e
/frameworks/base/location/java/android/location/LocationRequest.java
74fa7eabda3d0c1a85e0b568e3fc4230ed4fe7a4 14-Aug-2012 Nick Pelly <npelly@google.com> Improve coarse locations.

Fix a couple of bugs, and modify the behavior of the random offset.

The random offset now slowly changes over time, to mitigate against
applications averaging out the offset over time while at a
grid boundary.

Change-Id: Iecffff29145b8c2b30d1eca1662cf9d3e8cff756
/frameworks/base/location/java/android/location/LocationRequest.java
6fa9ad4afcd762aea519ff61811386c23d18ddb2 16-Jul-2012 Nick Pelly <npelly@google.com> Location overhaul, major commit.

Themes: Fused Location, Geofencing, LocationRequest.

API changes
o Fused location is always returned when asking for location by Criteria.
o Fused location is never returned as a LocationProvider object, nor returned
as a provider String. This wouldn't make sense because the current API
design assumes that LocationProvider's have fixed properties (accuracy, power
etc).
o The fused location engine will tune itself based on the criteria passed
by applications.
o Deprecate LocationProvider. Apps should use fused location (via Criteria
class), instead of enumerating through LocationProvider objects. It is
also over-engineered: designed for a world with a plethora of location
providers that never materialized.
o The Criteria class is also over-engineered, with many methods that aren't
currently used, but for now we won't deprecate them since they may have
value in the future. It is now used to tune the fused location engine.
o Deprecate getBestProvider() and getProvider().
o Add getLastKnownLocation(Criteria), so we can return last known
fused locations.
o Apps with only ACCESS_COARSE_LOCATION _can_ now use the GPS, but the location
they receive will be fudged to a 1km radius. They can also use NETWORK
and fused locatoins, which are fudged in the same way if necessary.
o Totally deprecate Criteria, in favor of LocationRequest.
Criteria was designed to map QOS to a location provider. What we
really need is to map QOS to _locations_.
The death knell was the conflicting ACCURACY_ constants on
Criteria, with values 1, 2, 3, 1, 2. Yes not a typo.
o Totally deprecate LocationProvider.
o Deprecate test/mock provider support. They require a named provider,
which is a concept we are moving away from. We do not yet have a
replacement, but I think its ok to deprecate since you also
need to have 'allow mock locations' checked in developer settings.
They will continue to work.
o Deprecate event codes associated with provider status. The fused
provider is _always_ available.
o Introduce Geofence data object to provide an easier path fowards
for polygons etc.

Implementation changes
o Fused implementation: incoming (GPS and NLP) location fixes are given
a weight, that exponentially decays with respect to age and accuracy.
The half-life of age is ~60 seconds, and the half-life of accuracy is
~20 meters. The fixes are weighted and combined to output a fused
location.
o Move Fused Location impl into
frameworks/base/packages/FusedLocation
o Refactor Fused Location behind the IProvider AIDL interface. This allow us
to distribute newer versions of Fused Location in a new APK, at run-time.
o Introduce ServiceWatcher.java, to refactor code used for run-time upgrades of
Fused Location, and the NLP.
o Fused Location is by default run in the system server (but can be moved to
any process or pacakge, even at run-time).
o Plumb the Criteria requirements through to the Fused Location provider via
ILocation.sendExtraCommand(). I re-used this interface to avoid modifying the
ILocation interface, which would have broken run-time upgradability of the
NLP.
o Switch the geofence manager to using fused location.
o Clean up 'adb shell dumpsys location' output.
o Introduce config_locationProviderPackageNames and
config_overlay_locationProviderPackageNames to configure the default
and overlay package names for Geocoder, NLP and FLP.
o Lots of misc cleanup.
o Improve location fudging. Apply random vector then quantize.
o Hide internal POJO's from clients of com.android.location.provider.jar
(NLP and FLP). Introduce wrappers ProviderRequestUnbundled and
ProviderPropertiesUnbundled.
o Introduce ProviderProperties to collapse all the provider accuracy/
bearing/altitude/power plumbing (that is deprecated anyway).
o DELETE lots of code: DummyLocationProvider,
o Rename the (internal) LocationProvider to LocationProviderBase.
o Plumb pid, uid and packageName throughout
LocationManagerService#Receiver to support future features.

TODO: The FLP and Geofencer have a lot of room to be more intelligent
TODO: Documentation
TODO: test test test

Change-Id: Iacefd2f176ed40ce1e23b090a164792aa8819c55
/frameworks/base/location/java/android/location/LocationRequest.java