Loading framework/java/android/bluetooth/BluetoothOutputStream.java +11 −0 Original line number Diff line number Diff line Loading @@ -84,4 +84,15 @@ 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(); } } framework/java/android/bluetooth/BluetoothSocket.java +12 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ public final class BluetoothSocket implements Closeable { if (VDBG) Log.d(TAG, "socket fd passed by stack fds: " + fds); if(fds == null || fds.length != 1) { Log.e(TAG, "socket fd passed from stack failed, fds: " + fds); as.close(); throw new IOException("bt socket acept failed"); } as.mSocket = new LocalSocket(fds[0]); Loading Loading @@ -407,6 +408,17 @@ public final class BluetoothSocket implements Closeable { if (VDBG) Log.d(TAG, "available: " + mSocketIS); 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. */ /*package*/ void flush() throws IOException { if (VDBG) Log.d(TAG, "flush: " + mSocketOS); mSocketOS.flush(); } /*package*/ int read(byte[] b, int offset, int length) throws IOException { Loading Loading
framework/java/android/bluetooth/BluetoothOutputStream.java +11 −0 Original line number Diff line number Diff line Loading @@ -84,4 +84,15 @@ 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(); } }
framework/java/android/bluetooth/BluetoothSocket.java +12 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ public final class BluetoothSocket implements Closeable { if (VDBG) Log.d(TAG, "socket fd passed by stack fds: " + fds); if(fds == null || fds.length != 1) { Log.e(TAG, "socket fd passed from stack failed, fds: " + fds); as.close(); throw new IOException("bt socket acept failed"); } as.mSocket = new LocalSocket(fds[0]); Loading Loading @@ -407,6 +408,17 @@ public final class BluetoothSocket implements Closeable { if (VDBG) Log.d(TAG, "available: " + mSocketIS); 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. */ /*package*/ void flush() throws IOException { if (VDBG) Log.d(TAG, "flush: " + mSocketOS); mSocketOS.flush(); } /*package*/ int read(byte[] b, int offset, int length) throws IOException { Loading