aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothSocket.java
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Bluetooth stopped working in master - "bad file descriptor""Zhihai Xu2013-07-261-7/+2
| | | | | | This reverts commit 626db853b28d64e493dd7b75073d2af838d0bc6a. Change-Id: I9ffaf5580924c150145d37ec38ffde602199b7e2
* Bluetooth stopped working in master - "bad file descriptor"Zhihai Xu2013-07-241-2/+7
| | | | | | | ignore IllegalArgumentException in BluetoothSocket.close(). bug: 9960585 Change-Id: I301aa388b738dcb92b643fdd96b5c9cb6f8b3efe
* Explicit locale when formatting machine strings.Jeff Sharkey2013-06-111-1/+2
| | | | | Bug: 9390451 Change-Id: I3581c53407554a1dffd541fb42b06d68f20a7be0
* Added flush() for bluetooth output streamzzy2013-04-241-0/+12
| | | | | | Bug 8498784 Zebra QL420 Plus Bluetooth printer fails on Android 4.2.2
* Clean up debug messagesMatthew Xie2012-11-291-1/+1
| | | | | | bug 7626174 Change-Id: I65cdcaf2c48a78468b6cef0b8591289435068b24
* timeout support for accept() and added check for signal sizezzy2012-11-281-7/+9
| | | | | | bug 7592240 Change-Id: Ide1868da669c190cdfed90f7af3f739ec9da690b
* License of files Bluetooth package is not updated to ASL2Zhihai Xu2012-10-231-1/+13
| | | | | | bug 7385618 Change-Id: I6232f537f4fda979d3aabe3a059c11d3299de9b8
* Add serial port profile support and allow to connect to rfcomm channel ↵zzy2012-10-151-1/+4
| | | | | | | | without sdp discovery bug 7272974 Change-Id: Idc10edc056b48da2fd96bea84eba3fb73b97bab1
* Reduce android.bluetooth package debug messagesMatthew Xie2012-10-091-17/+20
| | | | | | bug 7174712 Change-Id: I8d3fdc8edbe42068b5a550660d7b24854c3c4af4
* Fixed socket not closing on BT off. Used RemoteCallbackList to monitor ↵fredc2012-07-161-1/+1
| | | | | | binder deaths in BluetoothManagerService. Change-Id: I524964bd2836d8c5a4bae095b93ac9481337941d
* Fixed issue with Settings app crashing after during on/off and unpair.fredc2012-07-161-2/+2
| | | | | | Fixed issue with BluetoothAdapter.getRemoteDevice() returning null. Change-Id: Ie86813532530a6b57bde1c430c7b4875ecc7354c
* Non persistent adapter servicefredc2012-07-161-15/+9
| | | | | | | | | | | | | | | | | | Change-Id: Ib13d5c77416e58161df0e04d7a15ec0dddbde8b5 Conflicts: core/java/android/bluetooth/BluetoothInputDevice.java Conflicts: core/java/com/android/internal/app/ShutdownThread.java services/java/com/android/server/SystemServer.java Conflicts: services/java/com/android/server/SystemServer.java services/java/com/android/server/pm/ShutdownThread.java
* Added new rfcomm multi accept codezzy2012-07-161-220/+281
|
* Changes for new Bluetooth APIs.Jaikumar Ganesh2012-07-131-4/+14
| | | | | | | Changes to Bluetooth Adapter, Device and IBluetooth interfaces for new Bluetooth APIs. Delete AudioGateway. Change-Id: Ib51b31187eafde261441b9311b5e7e13c8bff82f
* Avoid calling BluetoothSocket.destroyNative twiceJason Simmons2012-05-031-2/+4
| | | | | | | | | | | | If the destroyNative JNI method is called twice, it will attempt to free the socketData twice, and the second free will cause an assertion failure. To avoid this, check whether mSocketState has already been set to CLOSED while holding the write lock. If it has, then destroyNative has already been called and should not be called again. Bug: 3096033 Change-Id: Ic7c0bbf21823d389b26919da8c533d8ac4d49064
* docs: Add developer guide cross-references, Project ACRE, round 4Joe Fernandez2011-12-221-0/+6
| | | | Change-Id: I1b43414aaec8ea217b39a0d780c80a25409d0991
* Add public api BluetoothSocket.isConnected.Matthew Xie2011-05-231-12/+32
| | | | | | | | It's a convenent function to get the connection status of the bluetooth socket, ie, whether there is an active connection with remote device. bug 2149043 Change-Id: I4ca4e98c646f70746d838632f3035376b22d579b
* Typo fixes in comments and minor code cleanups.Jake Hamby2010-09-301-4/+4
| | | | | | | | | * Fix some typos in Javadoc and log messages. * Remove redundant initializer in BluetoothAdapter.readOutOfBandData() * Use canonical "UTF-8" charset name instead of "UTF8" in BluetoothDevice.convertPinToBytes() Change-Id: I58cd5dc48a7ad0053d204c5f590b4b3d438d8672
* docs for ESR: add docs to bluetooth explainin that discovery shouldScott Main2009-11-191-0/+9
| | | | | | be cancelled before connecting to a device bug: 2160782,2198463
* docs: add more documentation for the bluetooth apis.Scott Main2009-11-091-16/+28
| | | | | | more descriptions for some of the classes and a new overview and pseudo-code example for using BT APIs in the package summary.
* Encourage developers to connect RFCOMM by UUID instead of Channel.Nick Pelly2009-10-071-14/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | Hide createRfcommSocket(int channel) Add createRfcommSocketWithServiceRecord(UUID uuid) Rename listenUsingRfcomm(String,UUID) -> listenUsingRfcommWithServiceRecord(..) Now we have a complete API for developers to make peer-peer RFCOMM connections with hard-coding the limited (30) RFCOMM channels, instead using SDP lookup of an UUID. This commit addresses two serious bugs: - Do not throw IOException on accepting an incoming RFCOMM connection with BluetoothSocket. This was a regression from commit ee1402d8d697be3a - Workaround failure of bluez to update SDP cache when channel changes by trying to use the same RFCOMM channel on the server every time, instead of picking server channels randomly. This is a pretty ugly workaround, and we are still trying to fix the caching issue - but with this workaround we are at least shippable and apps will work at least until they start colliding on the 30 RFCOMM channels. DrNo: eastham Bug: 2158900 Joke: What did the digital watch say to his mom? "Look mom no hands." Change-Id: Ia4879943b83afac06b6f1a3f2391cf1628afce7d
* Fix docs builds.Nick Pelly2009-10-061-1/+1
|
* Provide an API for apps to use a dynamic RFCOMM channel and SDP record.Nick Pelly2009-10-061-4/+24
| | | | | | | | | | | | | | | | | | | | | | Hide listenUsingRfcommOn(int channel) Add listenUsingRfcomm(String name, ParcelUuid uuid) The new API automatically finds a free RFCOMM channel and registers an SDP record with the given uuid and name. The SDP record is automatically removed when the socket is closed, or if the application dies. Apps are prevented from registering SDP records with the uuid of system Bluetooth profiles, such as A2DP, HFP and OPP. Apps are prevented from removing SDP records that they did not create. This is tracked by pid. TODO: Provide an API for the connecting app to look up an SDP record. Bug: 2158900 DrNo: eastham Joke: "What did the dog say to the tree? bark." Change-Id: Ia92f51c34615a7270a403255ad2b8faa98c4a3f5
* Add javadoc to explain which permissions are required for Public BT API's.Nick Pelly2009-09-081-0/+3
|
* Immediately destroy BluetoothSocket's on close().Nick Pelly2009-09-021-9/+93
| | | | | | | | | | | | | | | 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.
* API CHANGENick Pelly2009-08-191-20/+34
| | | | | | | Javadoc, and unhide the first pieces of the Bluetooth API. With this commit there is enough public API to connect and use an RFCOMM connection between Bluetooth devices.
* Bluetooth: API change.Nick Pelly2009-08-181-55/+31
| | | | | | | | | | | | | | | Split BluetoothDevice into BluetoothDevice and BluetoothAdapter. BluetoothAdapter: Represents the local BT adapter. Operations on the local adapter (start a scan, etc). BluetoothDevice: Represents a remote BT device. Operations on remote devices (pair, connect, etc). IBluetoothDevice.aidl -> Bluetooth.aidl BluetoothDeviceService.java -> BluetoothDeviceService.java TODO: Javadoc
* Implement and expose SCO socket support in BluetoothSocket.java.Nick Pelly2009-06-021-16/+37
| | | | | | Implement L2CAP socket support, but do not expose it (untested). NEXT: Switch to Builder style constructor instead of factory method.
* Implement bulk read and writes for Bluetooth sockets.Nick Pelly2009-06-021-2/+2
| | | | | | Before: 0.1 kB/s After: 100 kB/s (in my java BT speed test app)
* New BluetoothSocket API.Nick Pelly2009-05-261-0/+176
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; }