Loading core/java/android/bluetooth/BluetoothSocket.java +8 −5 Original line number Original line Diff line number Diff line Loading @@ -416,6 +416,11 @@ public final class BluetoothSocket implements Closeable { if(mSocketState != SocketState.INIT) return EBADFD; if(mSocketState != SocketState.INIT) return EBADFD; if(mPfd == null) return -1; if(mPfd == null) return -1; FileDescriptor fd = mPfd.getFileDescriptor(); FileDescriptor fd = mPfd.getFileDescriptor(); if (fd == null) { Log.e(TAG, "bindListen(), null file descriptor"); return -1; } if (DBG) Log.d(TAG, "bindListen(), Create LocalSocket"); if (DBG) Log.d(TAG, "bindListen(), Create LocalSocket"); mSocket = LocalSocket.createConnectedLocalSocket(fd); mSocket = LocalSocket.createConnectedLocalSocket(fd); if (DBG) Log.d(TAG, "bindListen(), new LocalSocket.getInputStream()"); if (DBG) Log.d(TAG, "bindListen(), new LocalSocket.getInputStream()"); Loading Loading @@ -556,8 +561,9 @@ public final class BluetoothSocket implements Closeable { @Override @Override public void close() throws IOException { public void close() throws IOException { if (DBG) Log.d(TAG, "close() in, this: " + this + ", channel: " + mPort + ", state: " Log.d(TAG, "close() this: " + this + ", channel: " + mPort + + mSocketState); ", mSocketIS: " + mSocketIS + ", mSocketOS: " + mSocketOS + "mSocket: " + mSocket + ", mSocketState: " + mSocketState); if(mSocketState == SocketState.CLOSED) if(mSocketState == SocketState.CLOSED) return; return; else else Loading @@ -567,9 +573,6 @@ public final class BluetoothSocket implements Closeable { if(mSocketState == SocketState.CLOSED) if(mSocketState == SocketState.CLOSED) return; return; mSocketState = SocketState.CLOSED; mSocketState = SocketState.CLOSED; if (DBG) Log.d(TAG, "close() this: " + this + ", channel: " + mPort + ", mSocketIS: " + mSocketIS + ", mSocketOS: " + mSocketOS + "mSocket: " + mSocket); if(mSocket != null) { if(mSocket != null) { if (DBG) Log.d(TAG, "Closing mSocket: " + mSocket); if (DBG) Log.d(TAG, "Closing mSocket: " + mSocket); mSocket.shutdownInput(); mSocket.shutdownInput(); Loading Loading
core/java/android/bluetooth/BluetoothSocket.java +8 −5 Original line number Original line Diff line number Diff line Loading @@ -416,6 +416,11 @@ public final class BluetoothSocket implements Closeable { if(mSocketState != SocketState.INIT) return EBADFD; if(mSocketState != SocketState.INIT) return EBADFD; if(mPfd == null) return -1; if(mPfd == null) return -1; FileDescriptor fd = mPfd.getFileDescriptor(); FileDescriptor fd = mPfd.getFileDescriptor(); if (fd == null) { Log.e(TAG, "bindListen(), null file descriptor"); return -1; } if (DBG) Log.d(TAG, "bindListen(), Create LocalSocket"); if (DBG) Log.d(TAG, "bindListen(), Create LocalSocket"); mSocket = LocalSocket.createConnectedLocalSocket(fd); mSocket = LocalSocket.createConnectedLocalSocket(fd); if (DBG) Log.d(TAG, "bindListen(), new LocalSocket.getInputStream()"); if (DBG) Log.d(TAG, "bindListen(), new LocalSocket.getInputStream()"); Loading Loading @@ -556,8 +561,9 @@ public final class BluetoothSocket implements Closeable { @Override @Override public void close() throws IOException { public void close() throws IOException { if (DBG) Log.d(TAG, "close() in, this: " + this + ", channel: " + mPort + ", state: " Log.d(TAG, "close() this: " + this + ", channel: " + mPort + + mSocketState); ", mSocketIS: " + mSocketIS + ", mSocketOS: " + mSocketOS + "mSocket: " + mSocket + ", mSocketState: " + mSocketState); if(mSocketState == SocketState.CLOSED) if(mSocketState == SocketState.CLOSED) return; return; else else Loading @@ -567,9 +573,6 @@ public final class BluetoothSocket implements Closeable { if(mSocketState == SocketState.CLOSED) if(mSocketState == SocketState.CLOSED) return; return; mSocketState = SocketState.CLOSED; mSocketState = SocketState.CLOSED; if (DBG) Log.d(TAG, "close() this: " + this + ", channel: " + mPort + ", mSocketIS: " + mSocketIS + ", mSocketOS: " + mSocketOS + "mSocket: " + mSocket); if(mSocket != null) { if(mSocket != null) { if (DBG) Log.d(TAG, "Closing mSocket: " + mSocket); if (DBG) Log.d(TAG, "Closing mSocket: " + mSocket); mSocket.shutdownInput(); mSocket.shutdownInput(); Loading