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

Commit f59c8965 authored by Jack He's avatar Jack He
Browse files

Revert "Return -1 on socket read EOF"

This reverts commit 8dde3542.

Reason for revert: b/387799506
Test: manually validate the revert fixes issue in b/387799506
Bug: 387799506
Bug: 383671392
Change-Id: Ic2b879472e51cc8e69f863b341f2b204cd1323e8
parent 85de9d46
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) {
                    return -1;
                    throw new IOException("bt socket closed, read return: " + ret);
                }
            }
            if (bytesToRead > mL2capBuffer.remaining()) {
@@ -994,7 +994,7 @@ public final class BluetoothSocket implements Closeable {
            ret = mSocketIS.read(b, offset, length);
        }
        if (ret < 0) {
            return -1;
            throw new IOException("bt socket closed, read return: " + ret);
        }
        if (VDBG) Log.d(TAG, "read out:  " + mSocketIS + " ret: " + ret);
        return ret;