summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/location
Commit message (Collapse)AuthorAgeFilesLines
* Move some system services to separate directoriesAmith Yamasani2013-12-1918-5580/+0
| | | | | | | | 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
* Don't track LocationManager internal requests in AppOps (b/10725757).David Christie2013-09-122-5/+28
| | | | | | | | | AppOps stats are used to populate the "apps recently using location" list in settings->location. There is no reason to show Android OS in that list simply because of internal location requests supporting other clients. Change-Id: I6908aa63deb19d22733b8d9cdae6ea5dbbea55e0
* Fix exceptions in the Flp Hal layer:destradaa2013-09-111-1/+7
| | | | | | | | - JNI exception accessing a geofence method with wrong signature - FlpHardwareProvider exception when the monitoring status contains no location information Bug: 10691492 Change-Id: I1959712912af712dc9dc344f20afd1112da46efc
* Fixed b/10512887.Zhentao Sun2013-08-291-30/+45
| | | | | | | | | | | This is an issue caused by multi-threading. If geofence provider service is connected and disconnected immediately, the ServiceWatcher can return a null service handle to the private thread used by GeofenceProxy, and this can cause NPE and system crash. This CL also fixed a hidden race conditions bug where mGeofenceHardware is not synchronized between two threads. Change-Id: I824642cd638fbb1e6799a5a1220b047ebc2556a1
* Add support in the platform for Flp Geofencing.destradaa2013-08-133-32/+199
| | | | Change-Id: I0fb0e276d3a06322697bb5d46323779aca1f78c5
* Address Robin's code review comments in initial FlpHal submission.destradaa2013-08-092-26/+50
| | | | Change-Id: I50889599fdc5938a19b8bff4f11e64f44bcebdbf
* Add FlpHal layer to support Location Batching.destradaa2013-08-083-0/+579
| | | | Change-Id: Ia3a57d869dfb3f067a1b95fa66d54f311ddcfdc3
* Make it safe to use start/stop app ops outside of system procDianne Hackborn2013-07-171-2/+4
| | | | | | | | We now keep track of all of the active start operations per non-system process, so they can be cleaned up if the process goes away. Change-Id: I9d05f1e0281c47dbe1213de014f0491f1359685c
* More work on process tracking.Dianne Hackborn2013-06-141-1/+3
| | | | | | | | | | Re-arranged code to be more flexible, now track state of services, dump ordered list of running processes while memory was critical and low. Also rename battery stats service from "batteryinfo" to "batterystats". Change-Id: I0f4f0c8d443c49d255cb84d0fc917e8ec18b152e
* Made it easier to disable overlay mechanism of location components.Zhentao Sun2013-04-223-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "Re-introduce single-shot mode, set MS Assist Mode A when in ↵Stan Chesnutt2013-04-161-7/+52
|\ | | | | | | single-shot mode." into jb-mr2-dev
| * Re-introduce single-shot mode, set MS Assist Mode A when inStan Chesnutt2013-04-151-7/+52
| | | | | | | | | | | | | | | | single-shot mode. Fixes bug http://b.corp.google.com/issue?id=8204392 Change-Id: I5594447c75abab6b71bd12706409666bb75736c5
* | GPS Hardware geofencing.Jaikumar Ganesh2013-04-102-0/+265
|/ | | | | | Add support for doing geofencing in hardware. Change-Id: I6d5015190e8d84e1f4beb1010ed977a71c1622d0
* am d080bb07: am b9620a89: am 9434c112: Merge "Services: Adding HSPAP info in ↵Jaikumar Ganesh2013-02-071-1/+2
|\ | | | | | | | | | | | | | | | | Android" # By Arun Ravindran # Via Android Git Automerger (2) and others * commit 'd080bb07c88ca5ccf99f326789ed472448b50832': Services: Adding HSPAP info in Android
| * Merge "Services: Adding HSPAP info in Android"Jaikumar Ganesh2013-02-071-1/+2
| |\
| | * Services: Adding HSPAP info in AndroidArun Ravindran2012-09-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HSPA+ management is missing in GPS Loc service. Change-Id: If828c1b078d5989f501c3eb917a573a6db773453 Author: Arun Ravindran <arun.ravindran@intel.com> Signed-off-by: Arun Ravindran <arun.ravindran@intel.com> Signed-off-by: Regnier, PhilippeX <philippex.regnier@intel.com> Signed-off-by: Shuo Gao <shuo.gao@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Author-tracking-BZ: 41786
| | * Create telephony-common and mms-common - DO NOT MERGEWink Saville2012-07-171-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These have been created to reduce the size and complexity of frameworks/base. mms-common was created by moving all of frameworks/base/core/java/com/google/android/mms to: frameworks/opt/mms telephony-common was created by moving some of frameworks/base/telephony to: frameworks/opt/telephony Change-Id: If6cb3c6ff952767fc10210f923dc0e4b343cd4ad
* | | dual-mode switching single/multiuser ServiceWatcherVictoria Lease2013-02-016-31/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "App ops: you can now turn off operations."Dianne Hackborn2013-01-253-5/+24
|\ \ \
| * | | App ops: you can now turn off operations.Dianne Hackborn2013-01-253-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add new ops for calendar and wi-fi scans, finish implementing rejection of content provider calls, fix issues with rejecting location calls, fix bug in the new pm call to retrieve apps with permissions. Change-Id: I29d9f8600bfbbf6561abf6d491907e2bbf6af417
* | | | Fix GpsLocationProvider.enable/disable/isEnabledLaurent Tu2013-01-241-10/+10
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the issue where GpsLocationProvider.isEnabled() returns true when it is really false (and the other way around), when the handler hasn't processed the enable/disable messages yet. This can be systematically reproduced when the caller code is using the same thread as the thread of the handler in GpsLocationProvider. For example, this was happening in LocationManagerService.switchUser(). It would start by disabling all the providers (with updateProviderListenersLocked()), then re-enable them in updateProvidersLocked() only when isEnalbed()==false, which was in the wrong state since the GpsLocationProvider.ENABLE message hadn't been processed yet. As a result, the GpsLocationProvider was disabled upon startup of the phone. This is a slight problem for the enable() contract, which specifies that getStatus() must be handled, getStatus() will be handled but might have slighty not-up-to-date info in this case. Bug: 8028017 Change-Id: Iff91a11cc150e9029a6db85b64a10a926e12b0ba
* | | fix NPE in updateClientUidsVictoria Lease2013-01-151-0/+3
| | | | | | | | | | | | | | | Bug: 8009908 Change-Id: I54d97c587a3fa9d003f654f98fdfdbe21af791d6
* | | WorkSource can now track package names.Dianne Hackborn2013-01-111-35/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use this to track the package name of applications accessing GPS. And now the app ops service can enforce that callers must provide valid package names. Change-Id: I842a0abe236ea85f77926d708547f0f95c24bd49
* | | New "app ops" service.Dianne Hackborn2013-01-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial implementation, tracking use of the vibrator, GPS, and location reports. Also includes an update to battery stats to also keep track of vibrator usage (since I had to be in the vibrator code anyway to instrument it). The service itself is only half-done. Currently no API to retrieve the data (which once there will allow us to show you which apps are currently causing the GPS to run and who has recently accessed your location), it doesn't persist its data like it should, and no way to tell it to reject app requests for various operations. But hey, it's a start! Change-Id: I05b8d76cc4a4f7f37bc758c1701f51f9e0550e15
* | | prevent concurrency issues during LocationManager initVictoria Lease2013-01-023-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am 44d927ca: am 66f3d7f3: am 446ffe00: am e6299d5a: Merge "Fires geofence if ↵Victoria Lease2012-11-082-72/+247
|\ \ \ | |/ / | | | | | | | | | | | | | | | the device is already in the geofence area." into jb-mr1-dev * commit '44d927ca837f03e99a4dda52377275da2863ecbb': Fires geofence if the device is already in the geofence area.
| * | am 66f3d7f3: am 446ffe00: am e6299d5a: Merge "Fires geofence if the device ↵Victoria Lease2012-11-082-72/+247
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | is already in the geofence area." into jb-mr1-dev * commit '66f3d7f3c8247b59516cbc4ad13bea4e0b8c0ef9': Fires geofence if the device is already in the geofence area.
| | * | Fires geofence if the device is already in the geofence area.Victoria Lease2012-11-062-72/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Process the location of the fence as soon as it is added. Clarified how the distance to the fence was being used. Added more debug logs (disabled by default). Fixed a numerical overflow in the location request if the distance to the border of the nearest fence was greater than about 2000Km. Removed a useless call to request location updates passively when the geofence manager is initialized. We have no need of location updates unless there are active geofences. The effect of this call was undone the next time the location request was updated anyhow. Changed the location request to always request a fastest update interval of 0 which accomplishes the goal of passively monitoring all updates. This does not increase the power consumption because we are conservative about choosing a minimum location update interval. We're simply stating that the geofence manager is willing to handle a higher report rate which is very important. Subject location to a "freshness test" - only use relatively recent locations for geofence testing. Run all geofence updates on the handler and avoid making multiple redundant calls into the location manager when updating the provider requirements. Ensure that we update geofences correctly even if we don't know the initial location of the device at the time the geofence is created. Pin update interval value to the range [1m..2hr]. Distance to fence is now distance to fence's border, not distance to fence's centre. Bug: 7466334 Change-Id: I28e571ecfc508d5ceb9bb2afcabaaf05abb26369
* | | | am 58ed5d74: am 768d9e1a: Merge "Correct executable bit for source files"Kenny Root2012-11-073-0/+0
|\ \ \ \ | |/ / / | | | | | | | | | | | | * commit '58ed5d748c0b9b64845975ef5844ad313de7c3f6': Correct executable bit for source files
| * | | am 768d9e1a: Merge "Correct executable bit for source files"Kenny Root2012-11-073-0/+0
| |\ \ \ | | |/ / | |/| | | | | | | | | | * commit '768d9e1a72ceee7d4a5f608776b87b62d6ce4a04': Correct executable bit for source files
| | * | Correct executable bit for source filesKenny Root2012-11-073-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many media files and source code files were marked as executable in Git. Remove those. Also a shell script and python script were not marked as executable. Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
* | | | don't complain about CDMA support on non-CDMA devicesVictoria Lease2012-10-291-7/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | GpsLocationProvider emits a message on CDMA phones, warning about lack of CDMA support. It also emits this message on every other non-GSM device. I've pulled the conditions in a bit for this so that it only happens on actual CDMA devices. Change-Id: I1a122e2599c83c730be014c61385e60ef819b5a1
* | | Merge "Multiuser love for LocationManager" into jb-mr1-devVictoria Lease2012-10-096-8/+32
|\ \ \
| * | | Multiuser love for LocationManagerVictoria Lease2012-10-086-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Last position improvements for GeofenceManagerLaurent Tu2012-10-041-4/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use LocationManager.getLastPosition() in GeofenceManager instead of keeping track of it manually. Keeping track of it in GeofenceManager doesn't handle the case where we install a fence, and cross it just after that based on the last position before we installed the fence. Also shuffle around some code in LocationManagerService to remember the last position even if there are no UpdateRecords. This is useful in the GeofenceManager for example. Bug: 7047435 Change-Id: Ia8acc32e357ecc2e1bd689432a5beb1ea7dcd1c7
* | | multiuser support for LocationBlacklistVictoria Lease2012-10-041-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows primary/secondary users to have different "Google Location Services" preferences. It also reenables LocationBlacklist, which is fixed elsewhere. Bug: 7213502 Bug: 7248239 Change-Id: I94837682f95920c225c00b7da2de6dd1418a673e
* | | Avoid NPE in GpsLocationProviderVictoria Lease2012-10-011-59/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Oops, looks like we were spinning up a secondary thread to run some tasks that will just happen on the main thread regardless. Removed the secondary thread and fixed up initialisation order regarding mHandler and things that post to it. Also reordered GPS and PASSIVE provider initialisation order since GPS depends on PASSIVE. This should be both safer and easier to read. Bug: 7248029 Change-Id: I8630caf0a7bd1b2c401603075676f13dda5be4fa
* | | temporarily disable blacklistingVictoria Lease2012-09-271-0/+2
| | | | | | | | | | | | | | | Bug: 7248239 Change-Id: I2ef28fa0d6890a127fc424e58a148fe1fb15b683
* | | Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()Philip Milne2012-09-262-3/+3
| | | | | | | | | | | | Change-Id: Ie38952bbaace080e81e41e61350cda172951d548
* | | Update references to migrated global settings.Jeff Brown2012-09-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed one setting that was migrated but not marked deprecated. Removed a hidden setting that is no longer used by the new power manager service. Bug: 7231172 Change-Id: I332f020f876a18d519a1a20598a172f1c98036f7
* | | Merge "Revert "Fix for bug: #7173350. elapsedRealtimeNano() -> ↵Philip Milne2012-09-241-1/+1
|\ \ \ | | | | | | | | | | | | elapsedRealtimeNanos()"" into jb-mr1-dev
| * | | Revert "Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()"Philip Milne2012-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2f6d8829524dfca3a77e9a57c3b9c3862209877d Change-Id: Id5af767a09fc319127c4ebef837c5b7a7f75cb01
* | | | Merge "Fix for bug: #7173350. elapsedRealtimeNano() -> ↵Philip Milne2012-09-241-1/+1
|\ \ \ \ | |/ / / | | | | | | | | elapsedRealtimeNanos()" into jb-mr1-dev
| * | | Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()Philip Milne2012-09-211-1/+1
| | | | | | | | | | | | | | | | Change-Id: I71c24ea10093ece07a0780e97bc641ff548c1a44
* | | | Do not use passive GPS data for COARSE only apps.Victoria Lease2012-09-212-17/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Secure setting for LocationFudger's accuracyVictoria Lease2012-09-121-46/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the ACCURACY_METERS constant and all derived values with a secure setting. This value defaults to 2km and has a hardcoded floor of 500m. Bug: 6982024 Change-Id: Ibf97ab57145abf28c4a9747444f40250adddf23c
* | | Update airplane-mode manipulation for the new Settings namespaceChristopher Tate2012-09-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quick Settings and global actions (aka longpress-Power) toggles are included in this CL. The Settings app manipulations are updated in a different CL because that's a different git package. Bug 7132230 Change-Id: I50838f5e8d7b25a750d2bcae90bf384b09816dbb
* | | Improve multi-user broadcasts.Dianne Hackborn2012-08-301-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now use ALL and CURRENT when sending broadcasts, to specify where the broadcast goes. Sticky broadcasts are now correctly separated per user, and registered receivers are filtered based on the requested target user. New Context APIs for more kinds of sending broadcasts as users. Updating a bunch of system code that sends broadcasts to explicitly specify which user the broadcast goes to. Made a single version of the code for interpreting the requested target user ID that all entries to activity manager (start activity, send broadcast, start service) use. Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c
* | | Fix GpsLocationProvider wake lock book keeping.Jeff Brown2012-08-251-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GpsLocationProvider typically acquires a wake lock before sending a message to its handler then releases it after the message has been handled. There were two cases where messages might be removed from the handler, resulting in the wake lock being released. There were also two cases where background tasks were being started while not holding a wake lock for the duration. Fixed these issues and marked the GpsLocationProvider handler as asynchronous too so that it doesn't accidentally get blocked by traversals if it happens to share a thread with some UI. Bug: 7057752 Change-Id: I8e12fc91ae943e84db068c08ec809879537503c6
* | | Fix GPS provider thread blocked by NTP and XTRAKevin Tang2012-08-241-51/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the NTP and XTRA downloads block on the GPS provider thread. This could potentially block the next tasks for over a minute of time. If the upcoming task happens to be AGPS, AGPS will time out. Placed the NTP and XTRA downloads in separate threads. Bug: 6980618 Change-Id: I57a6aaf5348212bc1246813f6d941da7d5b19136