summaryrefslogtreecommitdiffstats
path: root/location
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-07-28 18:30:25 -0700
committerMike Lockwood <lockwood@android.com>2009-07-28 18:33:41 -0700
commit734d6031a662a275ec68627bd1258159041d44de (patch)
tree15a382ca4666c6a7875fcd876fa4a2d99365b9c5 /location
parent6c70a8b76b636a4cc68aa0045205202d8fae8232 (diff)
downloadframeworks_base-734d6031a662a275ec68627bd1258159041d44de.zip
frameworks_base-734d6031a662a275ec68627bd1258159041d44de.tar.gz
frameworks_base-734d6031a662a275ec68627bd1258159041d44de.tar.bz2
GPS: Don't call native_set_agps_server() until after we call native_init().
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'location')
-rwxr-xr-xlocation/java/com/android/internal/location/GpsLocationProvider.java25
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 9e1a72c..aaac192 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();