Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 275e88a2 authored by Neil Fuller's avatar Neil Fuller Committed by android-build-merger
Browse files

Merge "Refactor RFCOMM / BluetoothSocket usage of LocalSocket" am: 649a89e524 am: d9094c6a

am: 75789509

Change-Id: Ib7055c5ddf2caa52082aee4b67e3ebd213e09e4b
parents 91252f9e 75789509
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -243,7 +243,7 @@ public final class BluetoothSocket implements Closeable {
        }
        }


        as.mPfd = new ParcelFileDescriptor(fds[0]);
        as.mPfd = new ParcelFileDescriptor(fds[0]);
        as.mSocket = new LocalSocket(fds[0]);
        as.mSocket = LocalSocket.createConnectedLocalSocket(fds[0]);
        as.mSocketIS = as.mSocket.getInputStream();
        as.mSocketIS = as.mSocket.getInputStream();
        as.mSocketOS = as.mSocket.getOutputStream();
        as.mSocketOS = as.mSocket.getOutputStream();
        as.mAddress = RemoteAddr;
        as.mAddress = RemoteAddr;
@@ -367,7 +367,7 @@ public final class BluetoothSocket implements Closeable {
                if (mSocketState == SocketState.CLOSED) throw new IOException("socket closed");
                if (mSocketState == SocketState.CLOSED) throw new IOException("socket closed");
                if (mPfd == null) throw new IOException("bt socket connect failed");
                if (mPfd == null) throw new IOException("bt socket connect failed");
                FileDescriptor fd = mPfd.getFileDescriptor();
                FileDescriptor fd = mPfd.getFileDescriptor();
                mSocket = new LocalSocket(fd);
                mSocket = LocalSocket.createConnectedLocalSocket(fd);
                mSocketIS = mSocket.getInputStream();
                mSocketIS = mSocket.getInputStream();
                mSocketOS = mSocket.getOutputStream();
                mSocketOS = mSocket.getOutputStream();
            }
            }
@@ -416,8 +416,8 @@ 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 (DBG) Log.d(TAG, "bindListen(), new LocalSocket ");
                if (DBG) Log.d(TAG, "bindListen(), Create LocalSocket");
                mSocket = new LocalSocket(fd);
                mSocket = LocalSocket.createConnectedLocalSocket(fd);
                if (DBG) Log.d(TAG, "bindListen(), new LocalSocket.getInputStream()");
                if (DBG) Log.d(TAG, "bindListen(), new LocalSocket.getInputStream()");
                mSocketIS = mSocket.getInputStream();
                mSocketIS = mSocket.getInputStream();
                mSocketOS = mSocket.getOutputStream();
                mSocketOS = mSocket.getOutputStream();