From eb9d34630f74d0260690287f2df57c0cd3d7ba1d Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Wed, 31 Aug 2011 15:36:05 -0700 Subject: Make Bluetooth Health APIs public. Fix a few bugs: a) Pass a integer token to identify the channel. b) Close fds in case of errors. Change-Id: I2046787be5008769435f2f72a5bd67c19b749da0 --- core/jni/android_server_BluetoothService.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/jni/android_server_BluetoothService.cpp') diff --git a/core/jni/android_server_BluetoothService.cpp b/core/jni/android_server_BluetoothService.cpp index 819449a..292047b 100644 --- a/core/jni/android_server_BluetoothService.cpp +++ b/core/jni/android_server_BluetoothService.cpp @@ -1659,6 +1659,7 @@ static jobject getChannelFdNative(JNIEnv *env, jobject object, jstring channelPa if (fileDesc == NULL) { // FileDescriptor constructor has thrown an exception releaseChannelFdNative(env, object, channelPath); + close(fd); return NULL; } @@ -1667,7 +1668,7 @@ static jobject getChannelFdNative(JNIEnv *env, jobject object, jstring channelPa if (parcelFileDesc == NULL) { // ParcelFileDescriptor constructor has thrown an exception releaseChannelFdNative(env, object, channelPath); - LOGE("---Parcel File Desc is null"); + close(fd); return NULL; } -- cgit v1.1