diff options
| author | 2009-07-28 18:34:28 -0700 | |
|---|---|---|
| committer | 2009-07-28 18:34:28 -0700 | |
| commit | 103209189cba985dbad20c807cd0e8fc10e06a52 (patch) | |
| tree | c88eda8a399cc08cee777e64aa9aa51b590505a1 | |
| parent | f256c4001bfd65169158af854672df0eea234d54 (diff) | |
| parent | 734d6031a662a275ec68627bd1258159041d44de (diff) | |
Merge change 8922
* changes:
GPS: Don't call native_set_agps_server() until after we call native_init().
| -rwxr-xr-x | location/java/com/android/internal/location/GpsLocationProvider.java | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java index 9e1a72c1a8af..aaac192ad3ad 100755 --- a/location/java/com/android/internal/location/GpsLocationProvider.java +++ b/location/java/com/android/internal/location/GpsLocationProvider.java @@ -197,6 +197,10 @@ public class GpsLocationProvider extends ILocationProvider.Stub { // properties loaded from PROPERTIES_FILE private Properties mProperties; private String mNtpServer; + private String mSuplServerHost; + private int mSuplServerPort; + private String mC2KServerHost; + private int mC2KServerPort; private final Context mContext; private final ILocationManager mLocationManager; @@ -348,23 +352,21 @@ public class GpsLocationProvider extends ILocationProvider.Stub { stream.close(); mNtpServer = mProperties.getProperty("NTP_SERVER", null); - String host = mProperties.getProperty("SUPL_HOST"); + mSuplServerHost = mProperties.getProperty("SUPL_HOST"); String portString = mProperties.getProperty("SUPL_PORT"); - if (host != null && portString != null) { + if (mSuplServerHost != null && portString != null) { try { - int port = Integer.parseInt(portString); - native_set_agps_server(AGPS_TYPE_SUPL, host, port); + mSuplServerPort = Integer.parseInt(portString); } catch (NumberFormatException e) { Log.e(TAG, "unable to parse SUPL_PORT: " + portString); } } - host = mProperties.getProperty("C2K_HOST"); + mC2KServerHost = mProperties.getProperty("C2K_HOST"); portString = mProperties.getProperty("C2K_PORT"); - if (host != null && portString != null) { + if (mC2KServerHost != null && portString != null) { try { - int port = Integer.parseInt(portString); - native_set_agps_server(AGPS_TYPE_C2K, host, port); + mC2KServerPort = Integer.parseInt(portString); } catch (NumberFormatException e) { Log.e(TAG, "unable to parse C2K_PORT: " + portString); } @@ -494,6 +496,13 @@ public class GpsLocationProvider extends ILocationProvider.Stub { mEnabled = native_init(); if (mEnabled) { + if (mSuplServerHost != null) { + native_set_agps_server(AGPS_TYPE_SUPL, mSuplServerHost, mSuplServerPort); + } + if (mC2KServerHost != null) { + native_set_agps_server(AGPS_TYPE_C2K, mC2KServerHost, mC2KServerPort); + } + // run event listener thread while we are enabled mEventThread = new GpsEventThread(); mEventThread.start(); |