summaryrefslogtreecommitdiffstats
path: root/services/jni
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2011-06-05 14:25:16 -0700
committerMike Lockwood <lockwood@android.com>2011-08-04 10:33:35 -0400
commita5fe6b2efee02ab11c35e80ec50fec62be227273 (patch)
tree0441ee5839e58c068b025f486f6d8a326e5bad6e /services/jni
parent9b0c6beed2cd5463655712ad80ed160c08611ff8 (diff)
downloadframeworks_base-a5fe6b2efee02ab11c35e80ec50fec62be227273.zip
frameworks_base-a5fe6b2efee02ab11c35e80ec50fec62be227273.tar.gz
frameworks_base-a5fe6b2efee02ab11c35e80ec50fec62be227273.tar.bz2
GPS Provider Service changes
GPS engine needs to receive network state changes from Android fw. Added db query for the current APN, also added a new parameter between JNI / HAL to the new method in AGpsRilInterface struct for gps engine to receive APN from GPSLocationService Change-Id: I62e35c948d2ac1961771d1a10581a3b8e695c05a Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'services/jni')
-rwxr-xr-xservices/jni/com_android_server_location_GpsLocationProvider.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/services/jni/com_android_server_location_GpsLocationProvider.cpp b/services/jni/com_android_server_location_GpsLocationProvider.cpp
index d0e8e57..c18a6fc 100755
--- a/services/jni/com_android_server_location_GpsLocationProvider.cpp
+++ b/services/jni/com_android_server_location_GpsLocationProvider.cpp
@@ -533,7 +533,7 @@ static jstring android_location_GpsLocationProvider_get_internal_state(JNIEnv* e
}
static void android_location_GpsLocationProvider_update_network_state(JNIEnv* env, jobject obj,
- jboolean connected, int type, jboolean roaming, jstring extraInfo)
+ jboolean connected, int type, jboolean roaming, jboolean available, jstring extraInfo, jstring apn)
{
if (sAGpsRilInterface && sAGpsRilInterface->update_network_state) {
@@ -544,6 +544,14 @@ static void android_location_GpsLocationProvider_update_network_state(JNIEnv* en
} else {
sAGpsRilInterface->update_network_state(connected, type, roaming, NULL);
}
+
+ // update_network_availability callback was not included in original AGpsRilInterface
+ if (sAGpsRilInterface->size >= sizeof(AGpsRilInterface)
+ && sAGpsRilInterface->update_network_availability) {
+ const char *c_apn = env->GetStringUTFChars(apn, NULL);
+ sAGpsRilInterface->update_network_availability(available, c_apn);
+ env->ReleaseStringUTFChars(apn, c_apn);
+ }
}
}
@@ -572,7 +580,7 @@ static JNINativeMethod sMethods[] = {
{"native_send_ni_response", "(II)V", (void*)android_location_GpsLocationProvider_send_ni_response},
{"native_agps_ni_message", "([BI)V", (void *)android_location_GpsLocationProvider_agps_send_ni_message},
{"native_get_internal_state", "()Ljava/lang/String;", (void*)android_location_GpsLocationProvider_get_internal_state},
- {"native_update_network_state", "(ZIZLjava/lang/String;)V", (void*)android_location_GpsLocationProvider_update_network_state },
+ {"native_update_network_state", "(ZIZZLjava/lang/String;Ljava/lang/String;)V", (void*)android_location_GpsLocationProvider_update_network_state },
};
int register_android_server_location_GpsLocationProvider(JNIEnv* env)