diff options
| author | 2017-04-01 03:39:13 +0000 | |
|---|---|---|
| committer | 2017-04-01 03:39:13 +0000 | |
| commit | 37b01db0d893c67d6770dbcb262b428fa40f38ea (patch) | |
| tree | 0c37651e7a11bb590cf2fa9a486e79914cf94ca8 | |
| parent | 202c0418b1fe6b44d2ed5708b28e043709d56e59 (diff) | |
| parent | 467d572ef13466d78625cef36e4150b0d87be91a (diff) | |
Merge "Bluetooth: Add additional BluetoothSocket logging to root cause errors" am: 985fe4cbd2 am: 7eaf518b71
am: 467d572ef1
Change-Id: I779329e4de18db684ffc7020fc80785fc6c8b67f
| -rw-r--r-- | core/java/android/bluetooth/BluetoothSocket.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java index 98a5341b3025..6bf6aa0a9efa 100644 --- a/core/java/android/bluetooth/BluetoothSocket.java +++ b/core/java/android/bluetooth/BluetoothSocket.java @@ -416,6 +416,11 @@ public final class BluetoothSocket implements Closeable { if(mSocketState != SocketState.INIT) return EBADFD; if(mPfd == null) return -1; FileDescriptor fd = mPfd.getFileDescriptor(); + if (fd == null) { + Log.e(TAG, "bindListen(), null file descriptor"); + return -1; + } + if (DBG) Log.d(TAG, "bindListen(), Create LocalSocket"); mSocket = LocalSocket.createConnectedLocalSocket(fd); if (DBG) Log.d(TAG, "bindListen(), new LocalSocket.getInputStream()"); @@ -556,8 +561,9 @@ public final class BluetoothSocket implements Closeable { @Override public void close() throws IOException { - if (DBG) Log.d(TAG, "close() in, this: " + this + ", channel: " + mPort + ", state: " - + mSocketState); + Log.d(TAG, "close() this: " + this + ", channel: " + mPort + + ", mSocketIS: " + mSocketIS + ", mSocketOS: " + mSocketOS + + "mSocket: " + mSocket + ", mSocketState: " + mSocketState); if(mSocketState == SocketState.CLOSED) return; else @@ -567,9 +573,6 @@ public final class BluetoothSocket implements Closeable { if(mSocketState == SocketState.CLOSED) return; mSocketState = SocketState.CLOSED; - if (DBG) Log.d(TAG, "close() this: " + this + ", channel: " + mPort + - ", mSocketIS: " + mSocketIS + ", mSocketOS: " + mSocketOS + - "mSocket: " + mSocket); if(mSocket != null) { if (DBG) Log.d(TAG, "Closing mSocket: " + mSocket); mSocket.shutdownInput(); |