summaryrefslogtreecommitdiffstats
path: root/core/jni/android_location_GpsLocationProvider.cpp
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-06-19 14:54:42 -0400
committerMike Lockwood <lockwood@android.com>2009-06-19 14:54:42 -0400
commita9e546169b3c2c9c5f248d2f3abe3b934f48695d (patch)
treeca6b5b01b76e239c021903981f6a246e9566af9c /core/jni/android_location_GpsLocationProvider.cpp
parent649f99e8347984c1e031dae302830f4c9ebd3df4 (diff)
downloadframeworks_base-a9e546169b3c2c9c5f248d2f3abe3b934f48695d.zip
frameworks_base-a9e546169b3c2c9c5f248d2f3abe3b934f48695d.tar.gz
frameworks_base-a9e546169b3c2c9c5f248d2f3abe3b934f48695d.tar.bz2
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>
Diffstat (limited to 'core/jni/android_location_GpsLocationProvider.cpp')
-rwxr-xr-x[-rw-r--r--]core/jni/android_location_GpsLocationProvider.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/jni/android_location_GpsLocationProvider.cpp b/core/jni/android_location_GpsLocationProvider.cpp
index 5c4fb22..bf0bd65 100644..100755
--- a/core/jni/android_location_GpsLocationProvider.cpp
+++ b/core/jni/android_location_GpsLocationProvider.cpp
@@ -336,13 +336,15 @@ static void android_location_GpsLocationProvider_agps_data_conn_failed(JNIEnv* e
}
static void android_location_GpsLocationProvider_set_agps_server(JNIEnv* env, jobject obj,
- jint type, jint addr, jint port)
+ jint type, jstring hostname, jint port)
{
if (!sAGpsInterface) {
sAGpsInterface = (const AGpsInterface*)sGpsInterface->get_extension(AGPS_INTERFACE);
}
if (sAGpsInterface) {
- sAGpsInterface->set_server(type, addr, port);
+ const char *c_hostname = env->GetStringUTFChars(hostname, NULL);
+ sAGpsInterface->set_server(type, c_hostname, port);
+ env->ReleaseStringUTFChars(hostname, c_hostname);
}
}
@@ -365,7 +367,7 @@ static JNINativeMethod sMethods[] = {
{"native_agps_data_conn_open", "(Ljava/lang/String;)V", (void*)android_location_GpsLocationProvider_agps_data_conn_open},
{"native_agps_data_conn_closed", "()V", (void*)android_location_GpsLocationProvider_agps_data_conn_closed},
{"native_agps_data_conn_failed", "()V", (void*)android_location_GpsLocationProvider_agps_data_conn_failed},
- {"native_set_agps_server", "(III)V", (void*)android_location_GpsLocationProvider_set_agps_server},
+ {"native_set_agps_server", "(ILjava/lang/String;I)V", (void*)android_location_GpsLocationProvider_set_agps_server},
};
int register_android_location_GpsLocationProvider(JNIEnv* env)