summaryrefslogtreecommitdiffstats
path: root/location
Commit message (Collapse)AuthorAgeFilesLines
* Fix a couple of bugs from the location overhaul.Nick Pelly2012-08-102-6/+9
| | | | | | | | | | Marshall LocationRequest array correctly. Observe reportLocation from FusionEngine. Actually deliver the setRequest message to fusion engine. Change-Id: Iff64596fdd42f9fb06e563591dda9fbe0241533a
* Remove LocationManager#getLastKnownLocation(Criteria).Nick Pelly2012-08-101-30/+0
| | | | | | | | | | | This was never a public API, so we don't need to follow an orderly deprecation. And it breaks a CTS test: cts/tests/tests/location/src/android/location/cts/LocationManagerTest.java:521: reference to getLastKnownLocation is ambiguous, both method getLastKnownLocation(java.lang.String) in android.location.LocationManager and method getLastKnownLocation(android.location.Criteria) in android.location.LocationManager match mManager.getLastKnownLocation(null); ^ Change-Id: I503267e4fa577ce4bf684239da777f11b0e511f5
* Location overhaul, major commit.Nick Pelly2012-08-1020-872/+1711
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Improve Location object.Nick Pelly2012-07-202-10/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add getElapsedRealtimeNano(): Currently Location just has getTime() and setTime() based on UTC time. This is entirely unreliable since it is not guaranteed monotonic. There is a lot of code that compares fix age based on deltas - and it is all broken in the case of a system clock change. System clock can change when switching cellular networks (and in some cases when switching towers). Document the meaning of getAccuracy(): It is the horizontal, 95% confidence radius. Make some fields mandatory if they are reported by a LocationProvider: All Locations returned by a LocationProvider must include at the minimum a lat, long, timestamps, and accuracy. This is necessary to perform fused location. There are no public API's for applications to feed locations into a location provider so this should not cause any breakage. If a LocationProvider does not fill in enough fields on a Location object then it is dropped, and logged. Bug: 4305998 Change-Id: I7df77125d8a64e174d7bc8c2708661b4f33461ea
* Improve geofencing: throttle location updates with distance to fence.Nick Pelly2012-07-163-6/+28
| | | | | | | | | | | | | | | | | | | | | 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
* docs: fix several linksScott Main2012-06-221-1/+1
| | | | Change-Id: I89d9fd64dc22c90680bb05415cc966c255165af9
* Enforce the minTime parameter in LocationManager#requestLocationUpdatesNick Pelly2012-05-171-134/+259
| | | | | | | | | | | | | | | | | | 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
* docs: Add developer guide cross-references, Project ACRE, round 4Joe Fernandez2011-12-223-3/+17
| | | | Change-Id: I1b43414aaec8ea217b39a0d780c80a25409d0991
* Cherry-picking Id45abeba and Ia065dec6 for MR1Makoto Onuki2011-12-131-4/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------- MCC detection fixes for CountryDetector - Don't get and cache phone tpe at the initialization time. At this point TelephonyManager is probably not ready yet. - Refresh MCC whenever we get the service state changed callback, even when the state hasn't actually changed, in order to make sure we get refresh country properly when MCC changes. - Also remove the initialization of mPhoneStateListener, which prevented us from registering phone state listener properly. - Also fix tests which were already failing. Bug 5670680 ------------------------------------------------------- Add logging to country detector logic This is for debugging purposes to verify the effects of change Id45abeba1b1e843053ac2c946861b439ca568de4. Bug: 5670680 Change-Id: I238d953484e2c8135f7dac70fce8662c8300a286
* Acknowledge that the platform guarantees UTF-8 and UTF-16.Jesse Wilson2011-07-191-2/+2
| | | | | | | | These log statements were dead code. That isn't much of a problem, except that the 'e.getMessage()' that was being logged could be null, and that would cause a real problem. Change-Id: I8573bc687a7eda73782bd028e8ddc048a1954dc5
* am e0009bb0: am 98395483: am 9f2cbf14: am e06749e1: Merge "Add ↵Conley Owens2011-07-011-1/+1
|\ | | | | | | | | | | | | FLAG_AUTO_CANCEL flag for multiple supl notifications." * commit 'e0009bb0b700dcfeba3ff77f8c33113499674432': Add FLAG_AUTO_CANCEL flag for multiple supl notifications.
| * am 98395483: am 9f2cbf14: am e06749e1: Merge "Add FLAG_AUTO_CANCEL flag for ↵Conley Owens2011-06-301-1/+1
| |\ | | | | | | | | | | | | | | | | | | multiple supl notifications." * commit '98395483e4309f7b92348136491575861008b3c0': Add FLAG_AUTO_CANCEL flag for multiple supl notifications.
| | * Add FLAG_AUTO_CANCEL flag for multiple supl notifications.Anshuman Pandey2011-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Added FLAG_AUTO_CANCEL to notification flags in GpsNetInitiatedHandler.java. This is done to clear consecutive notifications in UI Change-Id: I84be36af0b556f43ffd7d51ac04ff12300090ca5 Signed-off-by: Anshuman Pandey <anshuman.pandey@stericsson.com> Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
| * | Fix the javadoc for LocationManager.requestSingleUpdate()Amith Yamasani2011-03-291-22/+26
| | | | | | | | | | | | | | | | | | It was saying the same thing as requestLocationUpdates(), but it only provides a single update. Change-Id: I0a0f612104a946b7db96928505bb95673377a335
* | | Use upper case country codes in Country.javaDaisuke Miyakawa2011-06-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously external/libphonenumber accepted lower case country codes (e.g. "us") but now it doesn't for performance reason. Actually ISO 3166-1 doesn't allow lower cases, so we should not rely on them. Need to fix unit tests for PhoneNumberUtils, as it implicitly relies on the previous behavior. See also I3a3e6db84ed0d24290b1be19651fa9a82de4cc39 Bug: 4941319 Change-Id: If16f6531f274a0faf5e28724854409ca9b00a669
* | | Use passive provider for location based country detectionDaisuke Miyakawa2011-04-281-3/+3
| | | | | | | | | | | | | | | Bug: 4345419 Change-Id: Ia3e071b97c6971538ea994fdee6029db928201d6
* | | Fix the javadoc for LocationManager.requestSingleUpdate()Amith Yamasani2011-03-281-22/+26
|/ / | | | | | | | | | | It was saying the same thing as requestLocationUpdates(), but it only provides a single update. Change-Id: Ib677d40e050a82332df539a823cc677de1fcb4fd
* | am ce57a7f3: am 6504490c: am dff6b8e7: Merge "Add --non-constant-id to aapt."Xavier Ducrohet2011-02-281-46/+21
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit 'ce57a7f35344e76689d30f45964d1e37b78280cb': GpsLocationProvider: Clean up HAL initialization/cleanup sequence Fixed GSM encoded network initiated position request Ensuring thread-safe usage of DateFormat. Fixing infinite loop for zero duration. Fix for an infinite loop while scrolling lists. WAPPushManager, WAP Push over SMS message handler Add --non-constant-id to aapt.
| * Fixed GSM encoded network initiated position requestHakan Gustavsson2011-02-221-46/+21
| | | | | | | | | | | | | | | | | | | | | | | | GSM encoded network initiated position requests were previously not correctly decoded. The GSM encoded string was decoded as ASCII but not all characters are encoded in the same way for GSM and ASCII. These characters was not displayed. Besides that, when the number of characters was evenly divided by 8 the last character was lost. This is also corrected. Change-Id: Ic70b7c28bbba1f2936a9cc99e78f8002cc5c8761
* | Update package descriptions with editorial revisions.Scott Main2011-01-261-5/+4
| | | | | | | | | | | | | | | | | | Notably, this removes exessive info about resources from the content package, because it's not a good location and the info is avilable in the dev guide, but also added some of the info to the Resources class description. Change-Id: Ie78af26c9cec66314deb98e53078f48e16c08e70
* | resolved conflicts for merge of ee27dd35 to masterJean-Baptiste Queru2010-12-071-16/+17
|\ \ | |/ | | | | Change-Id: Ia9f4ea86b8554ff04a3aa6b9e065239ae73740e7
| * resolved conflicts for merge of 78742e01 to stage-korg-masterJean-Baptiste Queru2010-12-071-16/+17
| |\ | | | | | | | | | Change-Id: I0ce429afeb26184f075b4ed326fc4e1c0833e905
| | * Strings for NI position request are moved to resourcesHakan Gustavsson2010-12-031-16/+17
| | | | | | | | | | | | | | | | | | | | | The strings used by the framework for network initiated position requests are now string resources that can be properly localized. Change-Id: If1cba89adb1bfcb9c8fdb59b9c5aa1107b11279e
| | * GPS: Initialize XTRA support when GPS is enabledMike Lockwood2010-08-301-2/+6
| | | | | | | | | | | | | | | | | | | | | BUG: 2923148 Change-Id: If9a643e385c6c567b30f47d4caa35fa812a2ba43 Signed-off-by: Mike Lockwood <lockwood@android.com>
| | * GPS: Don't set XTRA download pending flag at boot time.Mike Lockwood2010-08-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | XTRA data downloads are now strictly on demand from the GPS engine. Also fix typo in handleDownloadXtraData() Change-Id: Ied1a6e2e62134add4d965326aae909c86f834682 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | | am cb51c0c7: am 3e94b94f: Merge "Remove old location classes." into gingerbreadDianne Hackborn2010-09-282-442/+0
|\ \ \ | |/ / | | | | | | | | | | | | | | | Merge commit 'cb51c0c7b155a5141a51fc4d3e57792da7e89cc4' * commit 'cb51c0c7b155a5141a51fc4d3e57792da7e89cc4': Remove old location classes.
| * | Remove old location classes.Dianne Hackborn2010-09-282-442/+0
| | | | | | | | | | | | Change-Id: Ib7e883c64996a8bfaaa755d88b855e17e3442e26
* | | am e5317fbd: am 4f67e1cc: Merge "Add location shared library for location ↵Dianne Hackborn2010-09-285-0/+524
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | provider APIs." into gingerbread Merge commit 'e5317fbd48875896e04a34d955edf650f11f9771' * commit 'e5317fbd48875896e04a34d955edf650f11f9771': Add location shared library for location provider APIs.
| * | Add location shared library for location provider APIs.Dianne Hackborn2010-09-285-0/+524
| | | | | | | | | | | | | | | | | | | | | First part, adding the existing classes in their new library. The old code will be removed once everything gets switched to using this. Change-Id: I27b6ad8c75c16f35300090e95f12a7db5608e3a3
* | | am 24956d36: am 307aef01: Merge "LocationManager: Hide location provider and ↵Mike Lockwood2010-09-205-5/+11
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | 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-205-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-132-8/+13
|\ \ \ | |/ / | | | | | | Change-Id: I27004dc464f5771d3205ae5757c6eccc5b16854d
| * | Track client requests through location manager.Dianne Hackborn2010-09-132-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+7
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | 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-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add new system service CountryDetectorBai Tao2010-07-287-0/+465
|/ / | | | | | | | | | | | | | | | | | | a. The CountryDetector detects the country the user is in in order of mobile network, location, sim card or locale. It will be used by contact and contact provider. b. All added APIs are hidden at this stage. Change-Id: I4ba278571ffb6ab6ded0996d4f440a18534f8ed4
* | Don't throw an exception from isProviderEnabled and getLastKnownLocationMike Lockwood2010-07-171-3/+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>
* | andriod.location.Criteria: Simplify new location criteria APIs a bit.Mike Lockwood2010-06-231-96/+25
| | | | | | | | | | | | | | | | Remove ACCURACY_BEST and only use ACCURACY_MEDIUM for horizontal accuracy. Remove accuracy priority support, since it be difficult to implement in some cases. Change-Id: I785a781f8d8f3bf3be6693ad71d077b6eb280c31 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | Merge "Add Geocorder.isImplemented()" into krakenMike Lockwood2010-05-242-1/+21
|\ \
| * | Add Geocorder.isImplemented()Mark Vandevoorde2010-05-212-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Fix broken Javadoc linksMike Lockwood2010-05-212-8/+8
|/ / | | | | | | | | Change-Id: I6896d6ec16b522e9e63776c0992ef55a6db82d50 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | Unhide new location manager APIs:Mike Lockwood2010-05-215-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Criteria.java LocationManager.java New APIs for criteria based location requests and single shot support. GeocoderParams.java GeocodeProvider.java LocationProvider.java APIs for network location unbundling. Change-Id: I3311fa01ce76fe4cba3537617e5b1c8d1f1d42b7 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | New Location Manager APIs for Criteria based requests and single shot mode.Mike Lockwood2010-05-217-310/+564
| | | | | | | | | | | | | | | | | | | | 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 b6f0cbdc: merge from open-source masterThe Android Open Source Project2010-05-101-0/+6
|\ \ | |/ | | | | | | | | | | Merge commit 'b6f0cbdcbb566368ebe0468f61de024f644db6e1' into kraken * commit 'b6f0cbdcbb566368ebe0468f61de024f644db6e1': Include the API level 4 fields in the Parcel.
| * merge from open-source masterThe Android Open Source Project2010-05-101-0/+6
| |\ | | | | | | | | | Change-Id: Ia4cbea9d94b2ff34fc8ce97c1fe35ca5898d6c1c
| | * Merge "Include the API level 4 fields in the Parcel."Jean-Baptiste Queru2010-05-101-0/+6
| | |\
| | | * Include the API level 4 fields in the Parcel.Paul Watts2010-01-201-0/+6
| | | |
| * | | merge from open-source masterThe Android Open Source Project2010-05-061-23/+23
| |\ \ \ | | |/ / | | | | | | | | Change-Id: I4c28751bd84b41259b12b0f3e3307e11234c8b64
| | * | GpsLocationProvider: Store new Location before onGpsStatusChanged is sentHakan Gustavsson2010-04-191-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In reportLocation() the new location is now stored before the callback onGpsStatusChanged(GPS_EVENT_FIRST_FIX) is sent. This will prevent users from getting a faulty location from LocationManager.getLastKnownLocation() after receiving onGpsStatusChanged(GPS_EVENT_FIRST_FIX). Change-Id: I6c654b2acbf2e216c99058a20f068bf4721a1c7a
| | * | merge from open-source masterThe Android Open Source Project2010-02-051-0/+2
| | |\ \