History log of /frameworks/base/services/java/com/android/server/location/GeocoderProxy.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c5fc9988f11acc58229fb6ae80d346277318ada4 18-Apr-2013 Zhentao Sun <robinvane@google.com> Made it easier to disable overlay mechanism of location components.

Fixed b/8276827

Vendor might want to provide their own implementation of "network
location", "fused location" and "geocoder" service. Location manager now
allows those service to be replaced by packages that have the same
signature as one of the packages in config_locationProviderPackageNames.
Such behavior might not be desirable on some devices. This change
make this behavior configurable by 3 boolean flags.

Details:
- Added three boolean flags in core/res/res/values/config.xml to enable
or disable NLP/FLP/Geocoder overlay
- Added 3 package name for the stock NLP/FLP/Geocoder. They are needed
only when overlay is disabled because LocationManagerService need to
know which package is preferred when searching for
NLP/FLP/Geocoder service.
- Made ServiceWatcher able to handle non-overlayable services.
- Fixed an NPE isue in ServiceWatcher. mPm.queryIntentServicesAsUser
might return null.
- Fixed an bug: justCheckThisPackage in bindBestPackageLocked is always
ignored.

Change-Id: Id221961ac7c3aa8ad44b894f9523f04f770ae237
/frameworks/base/services/java/com/android/server/location/GeocoderProxy.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/services/java/com/android/server/location/GeocoderProxy.java
5cd731a2333479d85b1bdf6dbf8a185df2877146 20-Dec-2012 Victoria Lease <violets@google.com> prevent concurrency issues during LocationManager init

systemReady() was returning before the LocationManagerService was
actually ready. Applications making LocationManager transactions
during their startup could possibly hit a race condition with the
yet-uninitialised LocationManagerService.

To guarantee that LocationManagerService is actually ready before
returning from systemReady(), we simply do the startup work on the
thread that called systemReady(), rather than spin up a secondary
thread to do the work asynchronously.

LocationWorkerHandler still needs a thread to do its work on, so
rather than have it run on the secondary thread that was
previously used for systemReady()'s work, we create a HandlerThread
for it.

Additionally, LocationManagerService.init() really needed to grab
lock for some of the things it was doing. I moved all of the code
that could benefit from mutex protection to a single section of
systemReady() and wrapped it up with a lock while I was at it.

Bug: 7723944
Change-Id: I51d480e2781622c3a14769c3a2019a2407dcfd8a
/frameworks/base/services/java/com/android/server/location/GeocoderProxy.java
b711d57ca4e2c6a1befbfa1a41f4b8094755a93f 02-Oct-2012 Victoria Lease <violets@google.com> Multiuser love for LocationManager

LocationManagerService now keeps track of the current user ID and
denies location requests made by all but the foreground user.

Additionally, location settings are now user-specific, rather than
global to the device. Location provider services now run as specific
users, and when the device's foreground user changes, we rebind to
appropriately-owned providers.

Bug: 6926385
Bug: 7247203
Change-Id: I346074959e96e52bcc77eeb188dffe322b690879
/frameworks/base/services/java/com/android/server/location/GeocoderProxy.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/services/java/com/android/server/location/GeocoderProxy.java
00355d5a592533a3ecb0a5a74aef8e69dd16902a 28-May-2012 Nick Pelly <npelly@google.com> Make location providers upgradeable.

Use config_netowrkLocationProviderPackageName and
config_geocodeProviderPackageName as intial packages. If another
package exists (or is later installed) that also implements a
provider, and has the same signatures as the original providers,
and has a hgiher version number, then use that instead.

The old code used a funky fix of package name substring checks
and service checks that was broken and not upgradeable.

Bug: 6499445
Change-Id: Ic58f09cf85d31d9abf47707093e22f31dda25cf0
/frameworks/base/services/java/com/android/server/location/GeocoderProxy.java
130b0d2b2629bdd8fc415e0f3da947f965a3f29d 27-Jul-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4466531: onServiceConnected() not called after...

...apk reinstall; affects user privacy

Disconnecting a ServiceConnection after an app is torn down could
impact the bookkeeping of the same service if it has been started
for the app.

Also address issue #5073927: GSF process can't be killed

A new flag allows the systems location manager service to tell
the activity manager to not pull bound services up forever into
the visible adj level.

Change-Id: I2557eca0e4bd48f3b10007c40ec878e769fd96a8
/frameworks/base/services/java/com/android/server/location/GeocoderProxy.java
8863c43d9efda108c880814b0a18688b75d70153 04-Oct-2010 Mark Vandevoorde <mtv@google.com> Remove races in Geocoder/LocationProvider Proxy

The proxy must ensure that enable/disable calls are not reordered when
proxied; this change adds synchronization to prevent such reordering
that could happen following an onServiceConnected() callback, and to
ensure cross-thread visibility of writes.

Also, when the package is updated, the old service instance must be
unbound and the new one bound. This changes uses a separate
Connection object per service instance (package version) to avoid
confusing the binder objects.

Change-Id: I0907f7eed211b97ccfffa395754f1eb8ea8d8fec
/frameworks/base/services/java/com/android/server/location/GeocoderProxy.java
e97ae40dffe7d7f8917c51c4f3f6c1b18c238565 29-Sep-2010 Mike Lockwood <lockwood@android.com> location: rebind to network location and geocoder services after package update

Change-Id: I2d7db3512b9edd7e0ba27d97442967fc2278e3b9
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/services/java/com/android/server/location/GeocoderProxy.java
00b74270c9f136a8727c5f6cda0997a3a905f385 26-Mar-2010 Mike Lockwood <lockwood@android.com> Move files internal to LocationManagerService from framework.jar to services.jar

Change-Id: Iebbfc49b8300ab59730733efdf489ec87ea45a25
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/services/java/com/android/server/location/GeocoderProxy.java