summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/LocationManagerService.java
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve geofencing: throttle location updates with distance to fence.Nick Pelly2012-07-161-356/+93
| | | | | | | | | | | | | | | | | | | | | Previously any geofence (proximity alert) would turn the GPS on at full rate. Now, we modify the GPS interval with the distance to the nearest geofence. A speed of 100m/s is assumed to calculate the next GPS update. Also o Major refactor of geofencing code, to make it easier to continue to improve. o Discard proximity alerts when an app is removed. o Misc cleanup of nearby code. There are other upcoming changes that make this a good time for some house-keeping. TODO: The new geofencing heuristics are much better than before, but still relatively naive. The next steps could be: - Improve boundary detection - Improve update thottling for large geofences - Consider velocity when throttling Change-Id: Ie6e23d2cb2b931eba5d2a2fc759543bb96e2f7d0
* Fix NPE when public API removeProximityAlert() used before addProximityAlert().Nick Pelly2012-06-131-1/+3
| | | | | Bug: 6313992 Change-Id: I905ad9ea771286727ce4a3a2334f2a0dac967c3d
* Make location providers upgradeable.Nick Pelly2012-05-291-25/+108
| | | | | | | | | | | | | | 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
* Enforce the minTime parameter in LocationManager#requestLocationUpdatesNick Pelly2012-05-171-11/+20
| | | | | | | | | | | | | | | | | | There is a long history in Android, on both GED and non GED devices of GPS providers ignoring the minTime parameter making location updates every second. The problem is usually poor GPS drivers that claim to do scheduling but then do not. By making the minTime parameter strict (instead of a hint) we can add a CTS test to ensure that udpates to not occur too frequently. I believe this is the desired behavior from apps. If apps want to take advantage of more frequent updates when another application asks for those updates then it can use the passive provider. The CTS test for GPS has already been submitted (as part of CTS Verifier). Bug: 6424983 Change-Id: I163b9e44ea7ab71530b86fc2282614e0150e90f1
* Log PID of apps requesting location updates.Nick Pelly2012-05-041-2/+11
| | | | | | BUG=6444765 Change-Id: Ib948b8fddb99f95f63486fbc096a26609c1a6c21
* Move handling of package changes to a background thread.Dianne Hackborn2012-04-191-1/+1
| | | | | | Helps get rid of some jank when installing applications. Change-Id: I97d0022f82d67796e334d37086e5911dd6ca6b62
* Move away from deprecated NetworkInfo extra.Jeff Sharkey2012-01-301-2/+4
| | | | | | | | | Because the NetworkInfo included in CONNECTIVITY_ACTION broadcast extra does not reflect the state applicable to the calling UID, and the last sticky broadcast may have stale state, transition to calling ConnectivityManager.getActiveNetworkInfo() directly. Change-Id: I86b316fbedd0273585ad5f1248b091bc3a3a5520
* Fix issue #4902856: Don't let apps register non-explicit PendingIntentsDianne Hackborn2011-06-301-24/+53
| | | | | | | | | | | | | | Location manager now checks for such intents, and logs a warning when they are given to it. Nothing thrown yet, it needs to check the targetSdkVersion of the caller somehow. When sending the pending intent, we require that the recipient hold the appropriate permission. This should pretty much close the security hole. Includes a bunch of infrastructure in the activity manager needed to support all this. Change-Id: I4dba7a98a7b8bbb9e347666451aa9cb1efad1848
* am 1b571bd3: am 1d28a840: Merge "Location Manager: Fix ↵Mike Lockwood2010-10-261-6/+7
|\ | | | | | | LocationManager.getBestProvider filtering." into gingerbread
| * Location Manager: Fix LocationManager.getBestProvider filtering.Mike Lockwood2010-10-261-6/+7
| | | | | | | | | | | | | | | | | | | | getBestProvider should only return location providers that the client has permission to use. BUG: 3124614 Change-Id: I065091d0445092563bc53fb4f7d93a1ab6bebb9a Signed-off-by: Mike Lockwood <lockwood@android.com>
* | am 6c8d8d89: am 8c32bddf: Merge "GPS: Disable verbose logging" into gingerbreadMike Lockwood2010-10-251-1/+4
|\| | | | | | | | | | | | | Merge commit '6c8d8d8927373fdb9ad1c853396b5dbc8295f996' * commit '6c8d8d8927373fdb9ad1c853396b5dbc8295f996': GPS: Disable verbose logging
| * GPS: Disable verbose loggingMike Lockwood2010-10-251-1/+4
| | | | | | | | | | | | | | BUG: 3127049 Change-Id: I9efd9eb7ff69724b133f3b70c52e173f49ddfbc5 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | am 11eada78: am ba2ec2b4: Merge "Enable framework GPS and location manager ↵Mike Lockwood2010-10-191-7/+10
|\| | | | | | | | | | | | | | | | | logging" into gingerbread Merge commit '11eada780dc82fcac2a1dad4e2dde1d310b4231c' * commit '11eada780dc82fcac2a1dad4e2dde1d310b4231c': Enable framework GPS and location manager logging
| * Enable framework GPS and location manager loggingMike Lockwood2010-10-181-7/+10
| | | | | | | | | | Change-Id: Id54fc01e7288e7d90d7b76824b708bcb2ee88333 Signed-off-by: Mike Lockwood <lockwood@google.com>
* | am 98e1f384: am aecab79b: Merge "Remove races in Geocoder/LocationProvider ↵Mike Lockwood2010-10-101-11/+16
|\| | | | | | | | | | | | | | | | | Proxy" into gingerbread Merge commit '98e1f3840f06d3dfea987154da25d5351460d080' * commit '98e1f3840f06d3dfea987154da25d5351460d080': Remove races in Geocoder/LocationProvider Proxy
| * Remove races in Geocoder/LocationProvider ProxyMark Vandevoorde2010-10-051-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | resolved conflicts for merge of 53b07027 to masterMike Lockwood2010-09-301-10/+34
|\| | | | | | | Change-Id: Ia5ce86d84454a4be76e71aeb77942ba8d88d2700
| * location: rebind to network location and geocoder services after package updateMike Lockwood2010-09-301-9/+31
| | | | | | | | | | Change-Id: I2d7db3512b9edd7e0ba27d97442967fc2278e3b9 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | am 24956d36: am 307aef01: Merge "LocationManager: Hide location provider and ↵Mike Lockwood2010-09-201-1/+1
|\| | | | | | | | | | | | | | | | | geocode provider APIs." into gingerbread Merge commit '24956d36f46dd7be0b029a7b2b43c1020ae8a4c5' * commit '24956d36f46dd7be0b029a7b2b43c1020ae8a4c5': LocationManager: Hide location provider and geocode provider APIs.
| * LocationManager: Hide location provider and geocode provider APIs.Mike Lockwood2010-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | Also rename Geocoder.isImplemented() to Geocoder.isPresent() BUG: 3000738 BUG: 3001413 Change-Id: I56bb4e9a9c59f8b79de585eeb168f74c3ff1a853 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | resolved conflicts for merge of 53686433 to masterDianne Hackborn2010-09-131-4/+23
|\| | | | | | | Change-Id: I27004dc464f5771d3205ae5757c6eccc5b16854d
| * Track client requests through location manager.Dianne Hackborn2010-09-131-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a problem where applications could ask the location manager to do very heavy-weight things (like... say... update location every minute), which would get accounted against the system instead of the application because ultimately it is the system making the heavy calls (wake locks, etc). To solve this, we introduce a new class WorkSource representing the source of some work. Wake locks and Wifi locks allow you to set the source to use (but only if you are system code and thus can get the permission to do so), which is what will be reported to the battery stats until the actual caller. For the initial implementation, the location manager keeps track of all clients requesting periodic updates, and tells its providers about them as a WorkSource param when setting their min update time. The network location provider uses this to set the source on the wake and wifi locks it acquires, when doing work because of the update period. This should also be used elsewhere, such as in the GPS provider, but this is a good start. Change-Id: I2b6ffafad9e90ecf15d7c502e2db675fd52ae3cf
* | am d71021cb: am 0c731f99: Merge "Send broadcast intent when configured ↵Brad Fitzpatrick2010-08-271-2/+6
|\| | | | | | | | | | | | | | | | | location providers change." into gingerbread Merge commit 'd71021cb30bd20dabd6783f4235d5f245a7bd1a3' * commit 'd71021cb30bd20dabd6783f4235d5f245a7bd1a3': Send broadcast intent when configured location providers change.
| * Send broadcast intent when configured location providers change.Brad Fitzpatrick2010-08-271-2/+6
| | | | | | | | | | | | | | | | | | See e.g. http://code.google.com/p/android/issues/detail?id=10042 This is also needed by the power control widget, which has no reliable way otherwise of staying in-sync. Change-Id: I8f2b6b79b1843329bae952a25ea56f15e3cf92aa
* | am 27ef0f73: am 9714d2c4: Merge "Don\'t throw an exception from ↵Adam Bliss2010-07-191-6/+2
|\| | | | | | | | | | | | | | | | | isProviderEnabled and getLastKnownLocation" into gingerbread Merge commit '27ef0f732c5a97ba88a699b7490045e5370cf51f' * commit '27ef0f732c5a97ba88a699b7490045e5370cf51f': Don't throw an exception from isProviderEnabled and getLastKnownLocation
| * Don't throw an exception from isProviderEnabled and getLastKnownLocationMike Lockwood2010-07-171-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | if the location provider does not exist. Instead use the same behavior as if the provider were disabled in settings (return false for isProviderEnabled and null from getLastKnownLocation). This eliminates for a lot of exception handling around some simple queries to the location manager. BUG: 2841014 Change-Id: I4fbe0c088e915c90969e13083201dd3e7f4029cb Signed-off-by: Mike Lockwood <lockwood@android.com>
* | am a5437f2d: am 88437284: Fix build error (Boolean -> boolean)Mark Vandevoorde2010-05-241-1/+1
|\|
| * Fix build error (Boolean -> boolean)Mark Vandevoorde2010-05-241-1/+1
| | | | | | | | Change-Id: I2f337e23f4b092de41523f1195546e9d65851c84
* | am 749afee8: am 1e11e95f: Merge "Add Geocorder.isImplemented()" into krakenMike Lockwood2010-05-241-0/+4
|\|
| * Add Geocorder.isImplemented()Mark Vandevoorde2010-05-211-0/+4
| | | | | | | | | | | | | | | | | | | | The Geocorder interface is not part of the Android core. It requires a backend service which may or may not be available on a device. The new isImplemented static method allows apps to discover whether the Geocorder is in fact available on the device. Change-Id: I2b5cf7bcc9cce4766bcbb156e91edf34b01f9296
* | am dc0ca1d5: am 88262733: Merge "New Location Manager APIs for Criteria ↵Mike Lockwood2010-05-211-26/+273
|\| | | | | | | based requests and single shot mode." into kraken
| * New Location Manager APIs for Criteria based requests and single shot mode.Mike Lockwood2010-05-211-26/+273
| | | | | | | | | | | | | | | | | | | | Use MS-Assisted mode for single shot GPS fixes if it is supported. Add finer grained control over accuracy to the android.location.Criteria class and location criteria logic from LocationManager to LocationManagerService Change-Id: I156b1f6c6a45d255c87ff917cf3e9726a6d7a75b Signed-off-by: Mike Lockwood <lockwood@android.com>
* | am 4d0c3083: am c7c856fb: am d2084bb6: am e1d7dca6: Merge ↵Mike Lockwood2010-05-121-1/+1
|\| | | | | | | "LocationManagerService: Call updateNetworkState on providers that are disabled." into froyo
| * am d2084bb6: am e1d7dca6: Merge "LocationManagerService: Call ↵Mike Lockwood2010-05-121-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | updateNetworkState on providers that are disabled." into froyo Merge commit 'd2084bb689bb680eb886d5cfbd27adc6f2e9da1c' into kraken * commit 'd2084bb689bb680eb886d5cfbd27adc6f2e9da1c': LocationManagerService: Call updateNetworkState on providers that are disabled.
| | * LocationManagerService: Call updateNetworkState on providers that are disabled.Mike Lockwood2010-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a problem with Network Location not working after SetupWizard until the network state changes. Change-Id: Ief81b76beb5cc90b2ca7d8aa2d4c99221898f01d BUG: 2671347 Signed-off-by: Mike Lockwood <lockwood@android.com>
| * | Move files internal to LocationManagerService from framework.jar to services.jarMike Lockwood2010-04-041-17/+18
| |/ | | | | | | | | Change-Id: Iebbfc49b8300ab59730733efdf489ec87ea45a25 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | Preflight before attempting to start network location and geocoder servicesMike Lockwood2010-03-261-2/+3
| | | | | | | | Signed-off-by: Mike Lockwood <lockwood@android.com>
* | Move files internal to LocationManagerService from framework.jar to services.jarMike Lockwood2010-03-261-17/+18
|/ | | | | Change-Id: I3dbb40210d87708e0bff46729f707d4ab8e29e42 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Fix LocationManager.getProvider() API breakage.Mike Lockwood2010-03-121-1/+1
| | | | | | | | getProvider() needs to work for providers that are disabled. It should only return null if the provider does not exist. Change-Id: Ieb9fbd8965a10329377bc8ac9d8061cebe519ab5 Signed-off-by: Mike Lockwood <lockwood@android.com>
* location: dump LocationProvider internal stateFred Fettinger2010-03-071-1/+10
| | | | | | | | | | | For each location provider, call getInternalState() to see if it has any state information to include in a bugreport. If the returned string is not null, then print a header with the provided name followed by the returned string. Change-Id: I0a388d7fba14ac8cadcb80eda0a0ceb95032410b Signed-off-by: Fred Fettinger <fred.fettinger@motorola.com> Signed-off-by: Mike Lockwood <lockwood@android.com>
* Remove the ProximityAlerts update Receiver when the last ProximityAlert expires.Sean Foy2010-03-041-1/+2
| | | | | | | Fixes issue 6900. Change-Id: Ifcd3fa9c34cfca02ed5e7a94aded33984ac81c60 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Don't eat IllegalArgumentExceptions in LocationManagerService.Mike Lockwood2010-03-021-0/+18
| | | | | | | The exeptions should be returned to the Binder client instead. Change-Id: I8ab36880622bf8b4fdf28407dec50652c48b6712 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Switch the services library to using the new SlogJoe Onorato2010-03-011-35/+36
|
* Don't start location providers until the system is ready.Mike Lockwood2010-02-221-3/+6
| | | | | | | Change-Id: Id545e95705e59ffbaaab8a679a1b7df488813101 BUG: 2461320 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Fix issue #2438980: Implement package watcher for voice recognizer service ↵Dianne Hackborn2010-02-221-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setting I am getting tired of writing package monitor code, realized this is missing in a number of places, and at this point it has gotten complicated enough that I don't think anyone actually does it 100% right so: Introducing PackageMonitor. Yes there are no Java docs. I am still playing around with just what this thing is to figure out what makes sense and how people will use it. It is being used to fix this bug for monitoring voice recognizers (integrating the code from the settings provider for setting an initial value), to replace the existing code for monitoring input methods (and fix the bug where we wouldn't remove an input method from the enabled list when it got uninstalled), to now monitor live wallpaper package changes (now allowing us to avoid reverting back to the default live wallpaper when the current one is updated!), and to monitor device admin changes. Also includes a fix so you can't uninstall an .apk that is currently enabled as a device admin. Also includes a fix where the default time zone was not initialized early enough which should fix issue #2455507 (Observed Google services frame work crash). In addition, this finally introduces a mechanism to determine if the "force stop" button should be enabled, with convenience in PackageMonitor for system services to handle it. All services have been updated to support this. There is also new infrastructure for reporting battery usage as an applicatin error report.
* Don't return passive location provider unless app has fine permissions.Bryan Mawhinney2010-02-181-1/+2
|
* Add passive location provider.Mike Lockwood2010-02-171-11/+26
| | | | | | | | | The passive location provider allows receiving location updates without actually triggering them. This allows an application to receive location updates that are being generated due to other clients of the location manager. Change-Id: Ibf7a96b089c56875d4f62d3210252ae8d9f32768 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Clean up interface between LocationManagerService and the location providers:Mike Lockwood2010-02-101-46/+44
| | | | | | | | | | | | | | | | LocationManagerService now uses new Java interface LocationProviderInterface rather than LocationProviderProxy to refer to location providers internally. LocationProviderProxy and the ILocationProvider binder interface are only used for location providers implemented as services (NetworkLocationProvider) Built-in location providers (GpsLocationProvider and mock providers) now just implement LocationProviderInterface rather than using a Binder interface and proxy object. Delete obsolete and unused TestLocationProvider class. Change-Id: Id800e7c1864f7c666f8e37125c05896493b9c8c4 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Network Location unbundling:Mike Lockwood2010-02-081-63/+33
| | | | | | | | | | | | | | | | | | | | | The network location and geocode provider services are now started on demand and their interfaces are now retrieved via bindService(). Remove obsolete LocationManager installLocationProvider() and installGeocodeProvider() methods. Add abstract class android.location.provider.GeocodeProvider to provide a public wrapper to the IGeocodeProvider Binder interface. Replaces the LocationManager.GeocodeProvider interface. Rename LocationProviderImpl to android.location.provider.LocationProvider. Move LocationManager.reportLocation() to android.location.provider.LocationProvider, so all methods related to external location providers are now all in one class. Avoid calling from the Location Manager Service into providers that are disabled so we do not start the network location service unnecessarily. Change-Id: If3ed2d5d62b83ba508006711d575cad09f4a0007 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Rename media resource broadcastsSuchi Amalapurapu2010-02-081-3/+3
| | | | | | Add checks for fwdlocked and updated system apps add more tests remove duplicate adds