History log of /frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2ec5c5cced4bd5b9dfbb7578f573c56b3bbc7ddf 10-Jul-2015 Soonil Nagarkar <sooniln@google.com> Fix reintroduction of b/10845061

Prevent crash in case where NLP is not available. Also fix an integer
overflow bug that remained uncaught.

BUG: 22345134
Change-Id: If6ff7b12f0d15bb2fe97589f8b0be10f9ed06197
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
55fc40cbb7e7d3ef1bda96109d5ed005fef72f85 29-Jan-2015 Soonil Nagarkar <sooniln@google.com> Fix FusionEngine so it isn't confused by location providers enabling/disabling.

Bug: 18900529
Change-Id: I80ebf9e0482148897eb943b44bf711577b6dcf7a
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
b30f38383e4691bf23311f62649aa504832731db 13-Oct-2013 Victoria Lease <violets@google.com> do not request location from unavailable providers

This commit prevents a system_server crash when applications attempt
to use the fused location provider on systems that do not have a
network location provider available.

Bug: 10845061
Change-Id: I85b33806e05566e8b68ee2ccc401b1c565fd7b9a
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
03cdd3d275499df3ef1059905899dcc5aaf2ab01 02-Feb-2013 Victoria Lease <violets@google.com> dual-mode switching single/multiuser ServiceWatcher

This changelist revises LocationManager's previous multiuser system.

Location provider services that are not multiuser-aware continue to
run as before: ServiceWatcher binds to location provider services as
the current active user. When the device switches from one user to
another, ServiceWatcher unbinds from the old user's location provider
service and binds to the new user's instance.

Now, location provider services that are multiuser-aware or
user-agnostic can declare "serviceIsMultiuser" metadata in their
AndroidManifest.xml to prevent ServiceWatcher from performing this
switching. These services will run as singleton services and will be
expected to handle user switches on their own.

With this feature in, I was able to switch FusedLocationProvider to
run in multiuser mode, sharing the system_server process instead of
running in its own process. The NetworkLocationProvider is unchanged,
still running in singleuser mode, cheerfully oblivious to the
possibility that there might be any user on the device besides the
one it services.

Bug: 8028045
Change-Id: I1a5bd032918419bab6edb46c62ff8c6811170654
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
161f42619b82995f88f6e299b6c74cb8382c4135 04-Dec-2012 Laurent Tu <laurentt@google.com> Protect against NPE in FusionEngine.java.

Bug: 7629406
Change-Id: Ic49a069eef47a62fb1e0c6f284a705a62c6ae232
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
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/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
779b77455fc51382ecafa210b8a805d2a616da55 31-Oct-2012 Victoria Lease <violets@google.com> fix NLP for COARSE applications, build FLP with SDK

In this commit, we provide a means for unbundled location providers
to attach an EXTRA_NO_GPS_LOCATION to the Locations that they report.

We also build FusedLocation against the SDK rather than the internal
tree.

Used in conjunction with I394ded497b8de40d1f85618bff282553cdf378cb
to fix NLP for applications with only ACCESS_COARSE_LOCATION
permission.

Bug: 7453355
Change-Id: Ie696f7abff9ef5237740ab87fe9f537a1c812c54
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
0fdfa6b49e7642a90a1b98881e4e2801cbcd3c77 12-Oct-2012 Victoria Lease <violets@google.com> Simplify fused location provider.

The previous location fusion algorithm produced very poor results
outdoors, where stale-but-accurate network locations had too much
influence over the final fused location.

I swapped the previous fusion algorithm out with an algorithm
that has been well-tested elsewhere and should produce superior
results.

Bug: 7341419
Change-Id: Iba71950a07907cbf26429c4e377b5e2ed91ba302
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
20de160ca32a8f2936a80ffd70551a22e2371d25 05-Oct-2012 Jeff Hamilton <jham@android.com> Revert "Changes to support updating location providers."

This reverts commit c19efc204aee1f0f3164dc21bd2ef3fdd4259c71.
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
c19efc204aee1f0f3164dc21bd2ef3fdd4259c71 03-Oct-2012 Jeff Hamilton <jham@android.com> Changes to support updating location providers.

There is now only a single config value pointing
at a list of packages to get certs from. The old
system was a bit confusing.

The fused location provider also now builds
against SDK 17, and the meta data service version
tag was renamed from the overly generic "version"
to "serviceVersion".

Bug: 7242814
Change-Id: I00d27c9cbd5cc31a37bb4a98160435d15a72e19e
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
4118012da9a22694b3353040a485f8cdc27e2f17 26-Sep-2012 Philip Milne <pmilne@google.com> Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()

Change-Id: Ie38952bbaace080e81e41e61350cda172951d548
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
bc391d58c8d09bd58b57dda20dd9d2281d90db32 24-Sep-2012 Philip Milne <pmilne@google.com> Merge "Revert "Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()"" into jb-mr1-dev
53fe75677212d0eb45e256a78599d7866256bc6a 24-Sep-2012 Philip Milne <pmilne@google.com> Revert "Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()"

This reverts commit 2f6d8829524dfca3a77e9a57c3b9c3862209877d

Change-Id: Id5af767a09fc319127c4ebef837c5b7a7f75cb01
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
b00df8e929f9ba865a95a7df3f949e6169332954 24-Sep-2012 Philip Milne <pmilne@google.com> Merge "Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()" into jb-mr1-dev
2f6d8829524dfca3a77e9a57c3b9c3862209877d 21-Sep-2012 Philip Milne <pmilne@google.com> Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()

Change-Id: I71c24ea10093ece07a0780e97bc641ff548c1a44
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.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/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
4e31c4fffbc42b4c2b5dca6431cfeef9e078f5b4 14-Aug-2012 Nick Pelly <npelly@google.com> Add javadoc for new location API's.

Change-Id: If15024ee88421c07ba3a174747774fc451fd002e
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java
08ca1046fe4f1890f91241f8d082a024ef6cfd93 11-Aug-2012 Nick Pelly <npelly@google.com> Fix a couple of bugs from the location overhaul.

Marshall LocationRequest array correctly.

Observe reportLocation from FusionEngine.

Actually deliver the setRequest message to fusion engine.

Change-Id: Iff64596fdd42f9fb06e563591dda9fbe0241533a
/frameworks/base/packages/FusedLocation/src/com/android/location/fused/FusionEngine.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/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java