128 Commits

Author SHA1 Message Date
Mike Lockwood
8909631710 Wait until GpsLocationProvider is fully initialized before returning from the constructor.
Otherwise we are left with a race condition that might result in the provider
being called before it is ready.

BUG: 2539392
Change-Id: I05f4a2501c43d5fa95c0e68f5a963015cf9c6e8f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-03-24 12:38:42 -04:00
Mike Lockwood
62a8fc159a GpsLocationProvider: Do our work in a Handler running in a separate thread.
To avoid adding a new thread to the system, we take the functionality that was
in GpsNetworkThread for downloading NTP time and XTRA data and include this in
the new thread as well.

BUG: 2531728

Change-Id: I2a26b7f0aae0c60faceb36dc6bc29c915c039ae6
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-03-22 15:14:31 -04:00
Mike Lockwood
69d63446d8 Remove unused file NmeaParser.java
Change-Id: I8027b98ccf1271870243ced8a7ccc61d25a224b2
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-03-17 22:36:15 -04:00
Fred Fettinger
3c8fbdf5dd location: dump LocationProvider internal state
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>
2010-03-07 09:29:15 -05:00
Mike Lockwood
689e449b24 Check for null provider in LocationManager.getProviders()
Change-Id: I294ce0b1f364cfdf956ac55260f9d40f0704b5f7
BUG: 2485977

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-03-03 15:35:13 -05:00
Mike Lockwood
8754be5cac Hide GeocoderParams class from public API.
This does not need to be publc until we unbundle the network location provider.

Change-Id: Ib4109d2392624242eee33f271a8151588e3f0c56
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-03-02 19:39:50 -05:00
Dianne Hackborn
2269d1572e Re-arrange android-common so framework no longer links with it.
This is the framework part, moving classes around so the framework
no longer needs to link to android-common.  Makes some APIs public,
others that didn't need to be public are private in the framework,
some small things are copied.
2010-02-25 11:39:33 -08:00
Mike Lockwood
b7be5447a0 GpsLocationProvider: Be less aggressive about getting fixes in bad conditions if we have a long fix interval.
Change-Id: I68bd884409ca15e584ab70e53cf142d60f318d9c
BUG: 2215714

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-24 14:44:18 -05:00
Mike Lockwood
63598a0619 Fix broken location extras in GpsLocationProvider.
Fixes http://code.google.com/p/android/issues/detail?id=4151
(Satellite count not being provided by Location class any more. Location.getExtras() returns null.)

Change-Id: I4cf2922f4a5ed216541f8a8553523d1f6a1c1d0c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-24 11:56:33 -05:00
Mike Lockwood
a4903f254b Add passive location provider.
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>
2010-02-17 18:36:40 -05:00
Mike Lockwood
d03ff94fe5 Clean up interface between LocationManagerService and the location providers:
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>
2010-02-10 09:41:25 -05:00
Mike Lockwood
628fd6d9c1 Network Location unbundling:
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>
2010-02-08 23:20:27 -05:00
Mike Lockwood
271f9f172b Fix for GPS engines without separate session and engine status events.
GPS_STATUS_SESSION_BEGIN now implies GPS_STATUS_ENGINE_ON
and GPS_STATUS_ENGINE_OFF now implies GPS_STATUS_SESSION_END.

Change-Id: I7217dc5213ae9a5658ac81b0a14b61d3e36ca0f6
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-02 11:41:52 -05:00
Mike Lockwood
5310b36a37 resolved conflicts for merge of 21875ab3 to master
Change-Id: I447e813b3ec460bbc9050de6b95bd663bb33c86f
2010-02-02 09:15:37 -05:00
Mike Lockwood
56fcd69b14 Remove unused method LocationProviderImpl.isEnabled().
This should have been removed in my previous change.

Change-Id: I3a080888f995e77a61e3ebf1c194ccd65686af1e
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-01 15:34:52 -05:00
Mike Lockwood
2cd543aad5 Remove ILocationProvider.isEnabled() binder call and use cached value instead.
Change-Id: Id6a9f6d2e2f5cc5810a2beeb0f869f06e2d18860
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-01 12:18:59 -05:00
Neal Nguyen
1a44d5dcab Phase 2 of test cleanup: moving test files from AndroidTests closer to their sources.
Most of these are file moves; a couple notable exceptions are the changes due to the move, and fixing up test code:
- database/DatabaseCursorTest.java
- database/DatabaseStatementTest.java
- net/UriTest.java
2010-01-29 13:35:51 -08:00
Mike Lockwood
f1218be2d8 Ignore NTP time fixes that differ from system time by more than 5 minutes.
Change-Id: I603195f6925e25baccd18190016cf8611bb9dc1b
BUG: 2402380
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-01-29 09:20:06 -05:00
Neal Nguyen
22e31e5b60 Moving framework core tests closer to their source files.
Phase 2 of test case cleanup; distributing CoreTests files closer to their respective sources under frameworks.
2010-01-27 13:36:38 -08:00
Mike Lockwood
345bf168db am 47d302a0: am bb79e5fd: Merge "Be tolerant of GPS session and engine on status messages arriving out of order." into eclair
Merge commit '47d302a001c71f90bee8dc31d868b463a47f2d51'

* commit '47d302a001c71f90bee8dc31d868b463a47f2d51':
  Be tolerant of GPS session and engine on status messages arriving out of order.
2010-01-22 17:04:47 -08:00
Mike Lockwood
cf1d8cb36f Be tolerant of GPS session and engine on status messages arriving out of order.
BUG: 2366194

Change-Id: I642dacd397202f671adba5a863394438ca62988d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-01-20 10:20:54 -05:00
Mike Lockwood
52eab1c760 Unhide LocationManager APIs needed for unbundled location providers.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-01-11 12:32:50 -05:00
Joe Onorato
f5d95cbc1a less log spew 2010-01-08 15:46:24 -05:00
Mike Lockwood
be5ed378d9 Fix broken Javadoc link.
Change-Id: Ia72dc3dccf95f95c6847eb52d8b210ed774a804b
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-01-06 23:15:33 -05:00
Mike Lockwood
9d2f7a7d66 Add LocationManagerImpl class to act as a public wrapper for the ILocationProvider interface
Location providers implemented outside of the core android platform (like network location)
can subclass LocationManagerImpl to implement the location provider interface
without being bound too tightly to the location manager internals.

Change-Id: Id193d4d09f9a14bea13e81af03c914074cd37cb9
2010-01-06 22:35:46 -05:00
Mike Lockwood
34901409a4 Cleanup and add public wrapper for IGeocodeProvider interface to prepare for network location unbundling.
Change-Id: I6523d115b56dbf450121e73d48e151f200827eb4
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-01-05 23:39:29 -05:00
Paul Westbrook
7762d93621 Unbundling work
Moved AndroidHttpClient, Rfc822InputFilter, Rfc822Validator
NumberPicker, NumberPickerButton to android-common
---
2009-12-14 09:24:09 -08:00
Mike Lockwood
dbd6fd8ebb GpsLocationProvider: Do not release wakelock until the GPS engine is fully off
Change-Id: I705b1d33af2d70aa1084cca8f6280fade9461d2c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-12-07 18:46:55 -05:00
Mike Lockwood
03d246779e GPS: Fix problem with SUPL when SUPL APN is already active.
Use ConnectivityManager.CONNECTIVITY_ACTION broadcast in LocationManagerService
to notify GPS when SUPL connection is ready instead of TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED,
which is not sent in all cases.
Expand LocationProvider.updateNetworkState() to include NetworkInfo object.

Fixes bug b/2155661

Change-Id: Iee227ace7d536b36cf7973e3e6a8b7a621ce6565
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-08 17:24:21 -04:00
Mike Lockwood
9aa1fa2d36 LocationManagerService: Remove caching of last known locations to flash.
Change-Id: Ibbab20a7c48823fb74c2e175824f55248f25bf8a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-09-01 07:51:15 -04:00
Danke Xie
22d1f9fb23 gps: Network initiated SUPL
Initial contribution from Qualcomm.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-27 14:18:30 -07:00
Mike Lockwood
660bbfcc54 GpsLocationProvider: Default to AGPS on if the setting is missing.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-25 16:01:37 -07:00
Mike Lockwood
640992dec9 gps: Unhide GpsStatus.NmeaListener interface for receiving NMEA sentences
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-06 19:19:45 -04:00
Mike Lockwood
b16e7800be gps: Add GpsStatus.NmeaListener interface for receiving NMEA sentences.
NMEA sentences are passed from the GPS engine to the GpsLocationProvider.
They are then sent via the IGpsStatusListener binder interface to clients
using the same path as the other GPS status information.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-06 15:05:07 -04:00
Mike Lockwood
734d6031a6 GPS: Don't call native_set_agps_server() until after we call native_init().
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-07-28 18:33:41 -07:00
Mike Lockwood
2bb99d1e2f GpsLocationProvider: remove mAgpsConfigured configured flag.
This flag was unnecessary because the lower level GPS code already checks for this
and this was causing problems for a GPS implementation that does not use /etc/gps.conf

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-07-17 10:56:56 -04:00
Android (Google) Code Review
334a67740c am b82759a0: Merge change 6906 into donut
Merge commit 'b82759a051f55852dabe201ad3354ea9b7b2979d'

* commit 'b82759a051f55852dabe201ad3354ea9b7b2979d':
  location: Add sub-locality, sub-thoroughfare and premises fields to Address class
2009-07-14 12:54:41 -07:00
Mike Lockwood
8cd1084ed1 location: Add sub-locality, sub-thoroughfare and premises fields to Address class
This is required for fully describing locations in Japan.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-07-14 14:41:22 -04:00
Kenny Root
55ed4914de Fix typo in Javadoc for LocationManager.GPS_PROVIDER 2009-07-07 12:42:51 -07:00
Android (Google) Code Review
0d0012ef16 am 54af78a3: Merge change 5950 into donut
Merge commit '54af78a3f7064e04d7ebd64c985d4149f9f7b05c'

* commit '54af78a3f7064e04d7ebd64c985d4149f9f7b05c':
  Fix memory leaks in system_server
2009-07-02 15:23:56 -07:00
Suchi Amalapurapu
fff2fda019 Fix memory leaks in system_server
unlink DeathRecipients in a whole bunch of places to avoid memory leaks
2009-07-01 12:55:30 -07:00
Mike Lockwood
bcab8df83e Settings: Add preference to enable/disable assisted GPS.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-06-25 17:15:32 -04:00
Dianne Hackborn
3618160a1a am 2e418428: Possibly fix an issue where we thought an app was always using GPS.
Merge commit '2e418428987132ea66533cbc05f9c526eb59519a'

* commit '2e418428987132ea66533cbc05f9c526eb59519a':
  Possibly fix an issue where we thought an app was always using GPS.
2009-06-23 13:08:40 -07:00
Dianne Hackborn
2e41842898 Possibly fix an issue where we thought an app was always using GPS.
There may be some race conditions in the gps provider where it can cause a uid
to be double booked for gps usage and never released.  Address this by tweaking
some locking (so mLocation and the uid array are protected by a lock both when
reading and writing).  Also add some code to log a warning if someone tries to
note a particular uid multiple times, since the code will break in that case.

Finally, fix a problem in the battery stats where we weren't allowing a new Uid
structure to be created in many cases for calls coming in.
2009-06-23 12:51:06 -07:00
Android (Google) Code Review
15d748659d am cde13e6b: Merge change 4954 into donut
Merge commit 'cde13e6bfa6465d5770755892e2ee234a1f85d5c'

* commit 'cde13e6bfa6465d5770755892e2ee234a1f85d5c':
  gps: Check for null APN name to avoid a runtime restart.
2009-06-22 13:24:50 -07:00
Mike Lockwood
b362a9ab91 gps: Check for null APN name to avoid a runtime restart.
We still need to figure out how the APN name is getting set to empty string
by the telephony code.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-06-22 16:20:39 -04:00
Android (Google) Code Review
84c4335f86 am f781b39c: Merge change 4786 into donut
Merge commit 'f781b39cb89dc19e6ad090bd3eb1bedbe7928429'

* commit 'f781b39cb89dc19e6ad090bd3eb1bedbe7928429':
  gps: Set SUPL server via hostname rather than IP address.
2009-06-19 12:12:18 -07:00
Mike Lockwood
a9e546169b gps: Set SUPL server via hostname rather than IP address.
The GPS engine needs the hostname for the secure SUPL case
and deferring the DNS lookup to the HAL might be helpful in the future
if the SUPL server is on a carrier's private network.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-06-19 14:54:42 -04:00
Android (Google) Code Review
989895e43f am fa699ea2: Merge change 3899 into donut
Merge commit 'fa699ea22a13a92694de75ef948a81da23e71642'

* commit 'fa699ea22a13a92694de75ef948a81da23e71642':
  GpsLocationProvider: Add hooks for GPS location injection.
2009-06-11 11:41:38 -07:00
Mike Lockwood
d26ce0d903 GpsLocationProvider: Add hooks for GPS location injection.
This will allow injecting cell ID location to the GPS
(not implemented yet).

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-06-11 12:42:25 -04:00