summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/ServiceWatcher.java
AgeCommit message (Collapse)Author
2013-12-19Move some system services to separate directoriesAmith Yamasani
Refactored the directory structure so that services can be optionally excluded. This is step 1. Will be followed by another change that makes it possible to remove services from the build. Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
2013-04-22Made it easier to disable overlay mechanism of location components.Zhentao Sun
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
2013-02-01dual-mode switching single/multiuser ServiceWatcherVictoria Lease
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
2013-01-16Prevent OOM death for services under ServiceWatcher's care.Victoria Lease
Change-Id: If87be5769b55368edaf4776189e8f6e51a21eb03
2013-01-16Rename bindService to bindServiceAsUser to follow convention.Amith Yamasani
This is for the multi-user version of bindService, not the original. Change-Id: Ib2de35941196accf387b1a276a77e6f9af805ec0
2012-10-18Changes to support updating location providers.Jeff Hamilton
This reverts commit 20de160ca32a8f2936a80ffd70551a22e2371d25. Bug: 7242814 Change-Id: I9ec49a14feb835b6683186fc6da4a74ae19fbae2
2012-10-08Multiuser love for LocationManagerVictoria Lease
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
2012-10-05Revert "Changes to support updating location providers."Jeff Hamilton
This reverts commit c19efc204aee1f0f3164dc21bd2ef3fdd4259c71.
2012-10-04Changes to support updating location providers.Jeff Hamilton
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
2012-09-26Fix issue #7232952: Settings crash on tapping on Downloaded apps on a ↵Dianne Hackborn
secondary user Also tweak bind flags for new location services so they aren't put so aggressively up in the oom adj list. Change-Id: I9da25a3fea7681013b4d95b7db7e9a808f2d733b
2012-08-10Location overhaul, major commit.Nick Pelly
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