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
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user