Loading android/app/jni/com_android_bluetooth_hidd.cpp +9 −3 Original line number Original line Diff line number Diff line Loading @@ -444,12 +444,18 @@ static jboolean unplugNative(JNIEnv* env, jobject thiz) { return result; return result; } } static jboolean connectNative(JNIEnv* env, jobject thiz) { static jboolean connectNative(JNIEnv* env, jobject thiz, jbyteArray address) { ALOGV("%s enter", __FUNCTION__); ALOGV("%s enter", __FUNCTION__); jboolean result = JNI_FALSE; jboolean result = JNI_FALSE; bt_status_t ret = sHiddIf->connect(); jbyte* addr = env->GetByteArrayElements(address, NULL); if (!addr) { ALOGE("Bluetooth device address null"); return JNI_FALSE; } bt_status_t ret = sHiddIf->connect((bt_bdaddr_t*)addr); ALOGV("%s: connect() returned %d", __FUNCTION__, ret); ALOGV("%s: connect() returned %d", __FUNCTION__, ret); Loading Loading @@ -492,7 +498,7 @@ static JNINativeMethod sMethods[] = { {"replyReportNative", "(BB[B)Z", (void*)replyReportNative}, {"replyReportNative", "(BB[B)Z", (void*)replyReportNative}, {"reportErrorNative", "(B)Z", (void*)reportErrorNative}, {"reportErrorNative", "(B)Z", (void*)reportErrorNative}, {"unplugNative", "()Z", (void*)unplugNative}, {"unplugNative", "()Z", (void*)unplugNative}, {"connectNative", "()Z", (void*)connectNative}, {"connectNative", "([B)Z", (void*)connectNative}, {"disconnectNative", "()Z", (void*)disconnectNative}, {"disconnectNative", "()Z", (void*)disconnectNative}, }; }; Loading android/app/src/com/android/bluetooth/hid/HidDevService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -478,7 +478,7 @@ public class HidDevService extends ProfileService { synchronized boolean connect(BluetoothDevice device) { synchronized boolean connect(BluetoothDevice device) { if (DBG) Log.v(TAG, "connect(): device=" + device); if (DBG) Log.v(TAG, "connect(): device=" + device); return connectNative(); return connectNative(Utils.getByteAddress(device)); } } synchronized boolean disconnect(BluetoothDevice device) { synchronized boolean disconnect(BluetoothDevice device) { Loading Loading @@ -696,7 +696,7 @@ public class HidDevService extends ProfileService { private native boolean sendReportNative(int id, byte[] data); private native boolean sendReportNative(int id, byte[] data); private native boolean replyReportNative(byte type, byte id, byte[] data); private native boolean replyReportNative(byte type, byte id, byte[] data); private native boolean unplugNative(); private native boolean unplugNative(); private native boolean connectNative(); private native boolean connectNative(byte[] btAddress); private native boolean disconnectNative(); private native boolean disconnectNative(); private native boolean reportErrorNative(byte error); private native boolean reportErrorNative(byte error); } } Loading
android/app/jni/com_android_bluetooth_hidd.cpp +9 −3 Original line number Original line Diff line number Diff line Loading @@ -444,12 +444,18 @@ static jboolean unplugNative(JNIEnv* env, jobject thiz) { return result; return result; } } static jboolean connectNative(JNIEnv* env, jobject thiz) { static jboolean connectNative(JNIEnv* env, jobject thiz, jbyteArray address) { ALOGV("%s enter", __FUNCTION__); ALOGV("%s enter", __FUNCTION__); jboolean result = JNI_FALSE; jboolean result = JNI_FALSE; bt_status_t ret = sHiddIf->connect(); jbyte* addr = env->GetByteArrayElements(address, NULL); if (!addr) { ALOGE("Bluetooth device address null"); return JNI_FALSE; } bt_status_t ret = sHiddIf->connect((bt_bdaddr_t*)addr); ALOGV("%s: connect() returned %d", __FUNCTION__, ret); ALOGV("%s: connect() returned %d", __FUNCTION__, ret); Loading Loading @@ -492,7 +498,7 @@ static JNINativeMethod sMethods[] = { {"replyReportNative", "(BB[B)Z", (void*)replyReportNative}, {"replyReportNative", "(BB[B)Z", (void*)replyReportNative}, {"reportErrorNative", "(B)Z", (void*)reportErrorNative}, {"reportErrorNative", "(B)Z", (void*)reportErrorNative}, {"unplugNative", "()Z", (void*)unplugNative}, {"unplugNative", "()Z", (void*)unplugNative}, {"connectNative", "()Z", (void*)connectNative}, {"connectNative", "([B)Z", (void*)connectNative}, {"disconnectNative", "()Z", (void*)disconnectNative}, {"disconnectNative", "()Z", (void*)disconnectNative}, }; }; Loading
android/app/src/com/android/bluetooth/hid/HidDevService.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -478,7 +478,7 @@ public class HidDevService extends ProfileService { synchronized boolean connect(BluetoothDevice device) { synchronized boolean connect(BluetoothDevice device) { if (DBG) Log.v(TAG, "connect(): device=" + device); if (DBG) Log.v(TAG, "connect(): device=" + device); return connectNative(); return connectNative(Utils.getByteAddress(device)); } } synchronized boolean disconnect(BluetoothDevice device) { synchronized boolean disconnect(BluetoothDevice device) { Loading Loading @@ -696,7 +696,7 @@ public class HidDevService extends ProfileService { private native boolean sendReportNative(int id, byte[] data); private native boolean sendReportNative(int id, byte[] data); private native boolean replyReportNative(byte type, byte id, byte[] data); private native boolean replyReportNative(byte type, byte id, byte[] data); private native boolean unplugNative(); private native boolean unplugNative(); private native boolean connectNative(); private native boolean connectNative(byte[] btAddress); private native boolean disconnectNative(); private native boolean disconnectNative(); private native boolean reportErrorNative(byte error); private native boolean reportErrorNative(byte error); } }