[DO NOT MERGE] Prevent FDs from being leaked when accepted sockets are closed

Bug: 28672558
Change-Id: I4bc14bd7f098e34012c2ae1eeba2d439145901f0
This commit is contained in:
Ajay Panicker
2016-09-08 13:23:02 -07:00
parent 9f37a8900e
commit 85bc33a8f4

View File

@@ -191,6 +191,7 @@ public final class BluetoothSocket implements Closeable {
as.close();
throw new IOException("bt socket acept failed");
}
as.mPfd = new ParcelFileDescriptor(fds[0]);
as.mSocket = new LocalSocket(fds[0]);
as.mSocketIS = as.mSocket.getInputStream();
as.mSocketOS = as.mSocket.getOutputStream();