Merge "Fix PANU - Bluetooth tethering - JNI calls."
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index d197341..f91db87 100644
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -1514,7 +1514,7 @@
}
handlePanDeviceStateChange(device, BluetoothPan.STATE_CONNECTING);
- if (connectPanDeviceNative(objectPath, "nap", "panu")) {
+ if (connectPanDeviceNative(objectPath, "nap")) {
log ("connecting to PAN");
return true;
} else {
@@ -2885,7 +2885,7 @@
private native boolean disconnectInputDeviceNative(String path);
private native boolean setBluetoothTetheringNative(boolean value, String nap, String bridge);
- private native boolean connectPanDeviceNative(String path, String srcRole, String dstRole);
+ private native boolean connectPanDeviceNative(String path, String dstRole);
private native boolean disconnectPanDeviceNative(String path);
private native int[] addReservedServiceRecordsNative(int[] uuuids);
diff --git a/core/jni/android_server_BluetoothService.cpp b/core/jni/android_server_BluetoothService.cpp
index b9ae526..2c39871 100644
--- a/core/jni/android_server_BluetoothService.cpp
+++ b/core/jni/android_server_BluetoothService.cpp
@@ -1154,7 +1154,7 @@
}
static jboolean connectPanDeviceNative(JNIEnv *env, jobject object, jstring path,
- jstring srcRole, jstring dstRole) {
+ jstring dstRole) {
LOGV(__FUNCTION__);
#ifdef HAVE_BLUETOOTH
LOGE("connectPanDeviceNative");
@@ -1165,7 +1165,6 @@
if (nat && eventLoopNat) {
const char *c_path = env->GetStringUTFChars(path, NULL);
- const char *src = env->GetStringUTFChars(srcRole, NULL);
const char *dst = env->GetStringUTFChars(dstRole, NULL);
int len = env->GetStringLength(path) + 1;
@@ -1175,12 +1174,10 @@
bool ret = dbus_func_args_async(env, nat->conn, -1,onPanDeviceConnectionResult,
context_path, eventLoopNat, c_path,
DBUS_NETWORK_IFACE, "Connect",
- DBUS_TYPE_STRING, &src,
DBUS_TYPE_STRING, &dst,
DBUS_TYPE_INVALID);
env->ReleaseStringUTFChars(path, c_path);
- env->ReleaseStringUTFChars(srcRole, src);
env->ReleaseStringUTFChars(dstRole, dst);
return ret ? JNI_TRUE : JNI_FALSE;
}
@@ -1274,7 +1271,7 @@
{"setBluetoothTetheringNative", "(ZLjava/lang/String;Ljava/lang/String;)Z",
(void *)setBluetoothTetheringNative},
- {"connectPanDeviceNative", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z",
+ {"connectPanDeviceNative", "(Ljava/lang/String;Ljava/lang/String;)Z",
(void *)connectPanDeviceNative},
{"disconnectPanDeviceNative", "(Ljava/lang/String;)Z", (void *)disconnectPanDeviceNative},
};