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

Commit f87ada7b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5850082 from 529dd2c114f7104f3a552f68428c068422433a73 to rvc-release

Change-Id: I3faf27c1279f9c79128c404079222606be7a4874
parents 4b10f365 58f9ffb3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -858,7 +858,10 @@ public final class BluetoothAdapter {
        if (DBG) {
            Log.d(TAG, "isLeEnabled(): " + BluetoothAdapter.nameForState(state));
        }
        return (state == BluetoothAdapter.STATE_ON || state == BluetoothAdapter.STATE_BLE_ON);
        return (state == BluetoothAdapter.STATE_ON
                || state == BluetoothAdapter.STATE_BLE_ON
                || state == BluetoothAdapter.STATE_TURNING_ON
                || state == BluetoothAdapter.STATE_TURNING_OFF);
    }

    /**
+12 −0
Original line number Diff line number Diff line
@@ -75,4 +75,16 @@ import java.io.OutputStream;
        }
        mSocket.write(b, offset, count);
    }

    /**
     * Wait until the data in sending queue is emptied. A polling version
     * for flush implementation. Use it to ensure the writing data afterwards will
     * be packed in the new RFCOMM frame.
     *
     * @throws IOException if an i/o error occurs.
     * @since Android 4.2.3
     */
    public void flush() throws IOException {
        mSocket.flush();
    }
}
+14 −0
Original line number Diff line number Diff line
@@ -515,6 +515,20 @@ public final class BluetoothSocket implements Closeable {
        return mSocketIS.available();
    }

    /**
     * Wait until the data in sending queue is emptied. A polling version
     * for flush implementation. Used to ensure the writing data afterwards will
     * be packed in new RFCOMM frame.
     *
     * @throws IOException if an i/o error occurs.
     */
    @UnsupportedAppUsage
    /*package*/ void flush() throws IOException {
        if (mSocketOS == null) throw new IOException("flush is called on null OutputStream");
        if (VDBG) Log.d(TAG, "flush: " + mSocketOS);
        mSocketOS.flush();
    }

    /*package*/ int read(byte[] b, int offset, int length) throws IOException {
        int ret = 0;
        if (VDBG) Log.d(TAG, "read in:  " + mSocketIS + " len: " + length);