diff options
| author | zzy <zhenye@broadcom.com> | 2013-04-16 17:17:37 -0700 |
|---|---|---|
| committer | Matthew Xie <mattx@google.com> | 2013-04-24 00:24:34 -0700 |
| commit | 71bfafc84af4b820748b12e1a1010b0dfa7bdea6 (patch) | |
| tree | 68d7af239f31abb6ebb440b72fad3c2b51ca48be /core/java/android/bluetooth/BluetoothOutputStream.java | |
| parent | 51f7ca4521c3508a233eefe97f53092213eacb60 (diff) | |
Added flush() for bluetooth output stream
Bug 8498784
Zebra QL420 Plus Bluetooth printer fails on Android 4.2.2
Diffstat (limited to 'core/java/android/bluetooth/BluetoothOutputStream.java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothOutputStream.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothOutputStream.java b/core/java/android/bluetooth/BluetoothOutputStream.java index 62242a2672ff..117dd47c1ab1 100644 --- a/core/java/android/bluetooth/BluetoothOutputStream.java +++ b/core/java/android/bluetooth/BluetoothOutputStream.java @@ -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(); + } } |
