diff options
author | Mike Lockwood <lockwood@android.com> | 2010-10-11 12:05:20 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-11 12:05:20 -0700 |
commit | 431dd3b1bc8f2acf7cbcf08463649b5629baf398 (patch) | |
tree | 890cdae7dd8dfd5a15faca3781f2691bab97d2f6 /services/jni | |
parent | 3a4b7dfddab67c531dca23c6691063a829376d4f (diff) | |
parent | 86564dc673db6dd752c326e53404677a3db43bec (diff) | |
download | frameworks_base-431dd3b1bc8f2acf7cbcf08463649b5629baf398.zip frameworks_base-431dd3b1bc8f2acf7cbcf08463649b5629baf398.tar.gz frameworks_base-431dd3b1bc8f2acf7cbcf08463649b5629baf398.tar.bz2 |
am 86564dc6: Merge "GPS: Add update_network_state call to AGpsRillInterface" into gingerbread
Merge commit '86564dc673db6dd752c326e53404677a3db43bec' into gingerbread-plus-aosp
* commit '86564dc673db6dd752c326e53404677a3db43bec':
GPS: Add update_network_state call to AGpsRillInterface
Diffstat (limited to 'services/jni')
-rwxr-xr-x | services/jni/com_android_server_location_GpsLocationProvider.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/services/jni/com_android_server_location_GpsLocationProvider.cpp b/services/jni/com_android_server_location_GpsLocationProvider.cpp index bd722d7..43e8467 100755 --- a/services/jni/com_android_server_location_GpsLocationProvider.cpp +++ b/services/jni/com_android_server_location_GpsLocationProvider.cpp @@ -586,6 +586,23 @@ static jstring android_location_GpsLocationProvider_get_internal_state(JNIEnv* e return result; } +static void android_location_GpsLocationProvider_update_network_state(JNIEnv* env, jobject obj, + jboolean connected, int type, jboolean roaming, jstring extraInfo) +{ + const AGpsRilInterface* interface = GetAGpsRilInterface(env, obj); + if (interface && + (interface->size > ((char *)&interface->update_network_state - (char *)&interface)) && + interface->update_network_state) { + if (extraInfo) { + const char *extraInfoStr = env->GetStringUTFChars(extraInfo, NULL); + interface->update_network_state(connected, type, roaming, extraInfoStr); + env->ReleaseStringUTFChars(extraInfo, extraInfoStr); + } else { + interface->update_network_state(connected, type, roaming, NULL); + } + } +} + static JNINativeMethod sMethods[] = { /* name, signature, funcPtr */ {"class_init_native", "()V", (void *)android_location_GpsLocationProvider_class_init_native}, @@ -611,6 +628,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 }, }; int register_android_server_location_GpsLocationProvider(JNIEnv* env) |