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

Commit 8cb43d74 authored by Bhakthavatsala Raghavendra's avatar Bhakthavatsala Raghavendra Committed by Gerrit Code Review
Browse files

Merge "Return -1 on socket read EOF" into main

parents 4ac48c7a 8dde3542
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -978,7 +978,7 @@ public final class BluetoothSocket implements Closeable {
            if (mL2capBuffer.remaining() == 0) {
                if (VDBG) Log.v(TAG, "l2cap buffer empty, refilling...");
                if (fillL2capRxBuffer() == -1) {
                    throw new IOException("bt socket closed, read return: " + ret);
                    return -1;
                }
            }
            if (bytesToRead > mL2capBuffer.remaining()) {
@@ -994,7 +994,7 @@ public final class BluetoothSocket implements Closeable {
            ret = mSocketIS.read(b, offset, length);
        }
        if (ret < 0) {
            throw new IOException("bt socket closed, read return: " + ret);
            return -1;
        }
        if (VDBG) Log.d(TAG, "read out:  " + mSocketIS + " ret: " + ret);
        return ret;