summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothOutputStream.java
AgeCommit message (Collapse)Author
2021-04-16More Bluetooth API annotation updates.Jeff Sharkey
This change adds a "BluetoothPermissionChecker" that ensures that all Bluetooth permission annotations are consistent. In addition, it verifies that all Bluetooth public APIs have been audited to be permission protected where relevant. We've currently standardized on saying that APIs that return device or Bluetooth state information (without sharing details about any particular remote Bluetooth device) do not need to be permission protected. This change is only annotations and has no behavior changes. Bug: 183626724 Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true Change-Id: Ie80b15b058359bf1e9a6ee881b89cb3e5b584ca1
2019-09-04Revert "Revert "Remove a misleading "flush" function.""Christian Wailes
This reverts commit 3d30e625e338d452c2a9e91dc2ad477e8500e5eb. Reason for revert: Fixed the test broken by the original commit Bug: 139192244 Bug: 140336855 Test: m -> flash -> boot Test: atest CtsJvmtiAttachingHostTestCases Change-Id: I4c67ad8709652c4710ef24564e0240f74f817f8c
2019-08-31Revert "Remove a misleading "flush" function."Ian Kasprzak
This reverts commit 0388ad1f72c70ca96cabc8b1a4a107877752b187. Reason for revert: Driodcop: aosp-master test-mapping showing multiple failures (b/140336855). Change-Id: If44e273dd111802db8b44db1e5a67a4628c72e3c
2019-08-27Remove a misleading "flush" function.Chris Wailes
This patch removes LocalSocketImpl.flush(). In practice this function was simply a wrapper around `Thread.sleep(10)`. All direct calls to this function have been removed. The `flush()` function is still called on several objects that wrap a SocketOutputStream. This will make booting a device 20ms faster than it currently is. Bug: 139192244 Test: Build -> flash -> boot -> launch app Change-Id: I0a96f4bc72461670370f61e847349f32af5ac774
2017-08-24Fix checkstyle errors (2/2)Jack He
* Manual style corrections with IDE assistance * Variable name refactors are done through IDE * Corrected general style errors such as: - "final private var" -> "private final var" - "&&", "+", "||" should not be at the end of line - Non-static private variable should be like "mVar" - Private static variable should be like "sVar" - Code file should always end with newline - Inherited methods should be annotated with @Override and no @hide tags - Public methods should always have a JavaDoc entry - "int[] array" is preferred over "int array[]" - private methods should be accessed without "this." when there is no name collisions. - "boolean ? true : false" -> boolean - "boolean ? false : true" -> !boolean - "boolean == true" OR "boolean != false" -> boolean - "boolean != true" OR "boolean == false" -> !boolean Bug: 63596319 Test: make checkbuild, no functional changes Change-Id: Iabdc2be912a32dd63a53213d175cf1bfef268ccd
2017-08-24Fix checkstyle errors (1/2)Jack He
* Automatic style corrections through IDE Bug: 63596319 Test: make checkbuild, no manual changes, no functional changes Change-Id: I2397d55abc34c9b7a9b748bec6137778df3421a7
2013-04-24Added flush() for bluetooth output streamzzy
Bug 8498784 Zebra QL420 Plus Bluetooth printer fails on Android 4.2.2
2009-09-02Immediately destroy BluetoothSocket's on close().Nick Pelly
Unfortunatley, shutdown() on the underlying fd does not actually stop a listening socket from listening. You need to call close() on the fd to do this. There is no way around it. So this means the Java BluetoothSocket code has to call destroyNative() during BluetoothSocket.close(). Since native methods cannot be called after destroyNative(), add a ReadWrite lock and mClosed field to protect access to native methods. This fixes the "resource busy" error when Bluetooth OPP and Bluetooth PBAP tried to resume listening after turning BT off and then on.
2009-06-02Implement bulk read and writes for Bluetooth sockets.Nick Pelly
Before: 0.1 kB/s After: 100 kB/s (in my java BT speed test app)
2009-05-26New BluetoothSocket API.Nick Pelly
Modeled on blocking java.net.Socket and java.net.ServerSocket library. Public interface is: public final class BluetoothSocket implements Closeable { public static BluetoothSocket createRfcommSocket(String address, int port) throws IOException; public static BluetoothSocket createInsecureRfcommSocket(String address, int port) throws IOException; public void connect() throws IOException; public void close() throws IOException; public String getAddress(); public InputStream getInputStream() throws IOException; public OutputStream getOutputStream() throws IOException; } public final class BluetoothServerSocket implements Closeable { public static BluetoothServerSocket listenUsingRfcommOn(int port) throws IOException; public static BluetoothServerSocket listenUsingUnsecureRfcommOn(int port) throws IOException; public BluetoothSocket accept() throws IOException; public BluetoothSocket accept(int timeout) throws IOException; public void close() throws IOException; }