diff options
| author | 2014-09-03 19:29:02 +0000 | |
|---|---|---|
| committer | 2014-09-03 19:29:03 +0000 | |
| commit | ddfa8e18fd78b939d948d46ba7c20ebb3d056c23 (patch) | |
| tree | 202e5113f71dd8281776e26a9481296389616b8c | |
| parent | 1f0ce3382132d02981193a1fa27306a6c7baaf50 (diff) | |
| parent | 726652e9d3f1adf6b68dedfa4618b490b7f1b4a3 (diff) | |
Merge "Close the base socket when bindListen fails" into lmp-dev
| -rw-r--r-- | core/java/android/bluetooth/BluetoothSocket.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java index b98e5aed8ff0..36997e544841 100644 --- a/core/java/android/bluetooth/BluetoothSocket.java +++ b/core/java/android/bluetooth/BluetoothSocket.java @@ -375,6 +375,14 @@ public final class BluetoothSocket implements Closeable { } // else ASSERT(mPort == channel) ret = 0; } catch (IOException e) { + if (mPfd != null) { + try { + mPfd.close(); + } catch (IOException e1) { + Log.e(TAG, "bindListen, close mPfd: " + e1); + } + mPfd = null; + } Log.e(TAG, "bindListen, fail to get port number, exception: " + e); return -1; } |