summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2010-10-11 12:05:20 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-11 12:05:20 -0700
commit431dd3b1bc8f2acf7cbcf08463649b5629baf398 (patch)
tree890cdae7dd8dfd5a15faca3781f2691bab97d2f6 /services
parent3a4b7dfddab67c531dca23c6691063a829376d4f (diff)
parent86564dc673db6dd752c326e53404677a3db43bec (diff)
downloadframeworks_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')
-rwxr-xr-xservices/java/com/android/server/location/GpsLocationProvider.java8
-rwxr-xr-xservices/jni/com_android_server_location_GpsLocationProvider.cpp18
2 files changed, 26 insertions, 0 deletions
diff --git a/services/java/com/android/server/location/GpsLocationProvider.java b/services/java/com/android/server/location/GpsLocationProvider.java
index 87271e7..f9c1679 100755
--- a/services/java/com/android/server/location/GpsLocationProvider.java
+++ b/services/java/com/android/server/location/GpsLocationProvider.java
@@ -493,6 +493,11 @@ public class GpsLocationProvider implements LocationProviderInterface {
+ " info: " + info);
}
+ if (info != null) {
+ native_update_network_state(info.isConnected(), info.getType(),
+ info.isRoaming(), info.getExtraInfo());
+ }
+
if (info != null && info.getType() == ConnectivityManager.TYPE_MOBILE_SUPL
&& mAGpsDataConnectionState == AGPS_DATA_CONNECTION_OPENING) {
String apnName = info.getExtraInfo();
@@ -1601,4 +1606,7 @@ public class GpsLocationProvider implements LocationProviderInterface {
private native void native_agps_set_ref_location_cellid(int type, int mcc, int mnc,
int lac, int cid);
private native void native_agps_set_id(int type, String setid);
+
+ private native void native_update_network_state(boolean connected, int type,
+ boolean roaming, String extraInfo);
}
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)