aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothAdapter.java
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Bluetooth: correcting return value from cancelDiscoveryAlbert Mojir2011-06-021-1/+1
|/ / | | | | | | | | | | | | BluetoothAdapter.cancelDiscovery was previously always returning false. Change-Id: Ic1fd134d4b710438d95c5b8ca009104529dd1bf5
* | Make BluetoothPan inherit from BluetoothProfile.Jaikumar Ganesh2011-02-231-0/+3
| | | | | | | | Change-Id: Ibd3e24e391be93ebe2cf975bd075efb68e10c1ff
* | Make BluetoothInputDevice inherit from BluetoothProfile.Jaikumar Ganesh2011-02-221-0/+3
| | | | | | | | | | | | This makes it in sync with BluetoothHeadset and BluetoothA2dp profiles. Change-Id: I3ddb1d18b04aacb173b7bc376bca21c277a6afe4
* | Fix BluetoothAdapter Connection change intent doc.Jaikumar Ganesh2011-02-011-4/+4
| | | | | | | | | | Bug: 3414206 Change-Id: Icf87e28e11b0b5072fe546225bbfb1dc68487ef0
* | docs: small javadoc, but also make the existing getProfileProxy docs ↵Scott Main2011-01-191-4/+5
| | | | | | | | | | | | visible... had wrong comment tag Change-Id: Ia4b2178057c0263ec8f835342815082de87b3af1
* | Expose insecure rfcomm Bluetooth API.Jaikumar Ganesh2010-12-231-1/+37
| | | | | | | | | | | | | | | | | | | | This complements the secure rfcomm API. The link key is unauthenticated and is subject to MITM attacks. The link key may be encrypted depending on the type of Bluetooth device. This helps apps which don't need the extra security or have their own security layer built on top of the rfcomm link. Change-Id: I71b2fa8de469ef98faa204b4dafac18a8e21d0d9
* | Update BT code for voice capability cases.Jaikumar Ganesh2010-11-241-0/+15
| | | | | | | | | | | | | | 1. Disable PBAP and Headset / Handsfree records. 2. Add API to query for local adapter UUIDs. Change-Id: Ic84ba6a49738adc89a8695d3a4890f08562e0621
* | Add an API call to get the ConnectionState of the Bluetooth Adapter.Jaikumar Ganesh2010-10-261-0/+22
| | | | | | | | Change-Id: Icd87d7720189034946aaa98e1a6c5d03ef4219e5
* | resolved conflicts for merge of c242248f to masterJake Hamby2010-09-301-4/+4
|\| | | | | | | Change-Id: I8810cc6dbd532de002d6a623ad93e86afb48c0b4
| * 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
* | New public APIs for BluetoothA2dp and BluetoothHeadset profiles.Jaikumar Ganesh2010-09-281-0/+104
|/ | | | Change-Id: I1cc4b109542dfd62473cb95797c8c3d0d15725f4
* Fix Bluetooth Javadoc to clarify the maximum device name length.Jake Hamby2010-09-161-6/+6
| | | | | | | | The maximum length of a Bluetooth device name is 248 bytes using UTF-8 encoding. Updated the Javadoc to clarify that the length is limited by the number of UTF-8 bytes and not the number of characters. Change-Id: I135671f5ee6c5eb6372f3fbbc5fccb02de65e6c4
* Out Of Band API for Secure Simple Pairing.Jaikumar Ganesh2010-09-131-0/+33
| | | | Change-Id: I54ded27ab85d46eef3d2cca84f2394b1ffe88ced
* Update javadoc for the API and change return of getBondedDevices().Jaikumar Ganesh2010-08-091-1/+31
| | | | | | | | | | getBondedDevices() *might* work if called before the Bluetooth State intent is broadcasted. However, this can cause ANRs and problems. This API was updated to return null, if called before the intent is received. However, this might cause existing apps to crash. Return an empty set instead. Change-Id: Ibc484d3394aa0bbebd651221efde6a7015ce7110
* Check whether Bluetooth is enabled before making any API calls.Jaikumar Ganesh2010-08-091-0/+10
| | | | | | | | For example, Settings app makes calls to get Bonded Devices before Bluetooth is on. This leads to ANRs and will prevent autoconnection. Change-Id: I56748a9bd1d603b5782c17775c6b20b831bf6572
* Removing STOPSHIP logs.Jaikumar Ganesh2010-05-181-1/+1
| | | | | Bug: 2694602 Change-Id: Id56e1ddcf5ea76de32238cd6761f2caf053f1fa1
* am cdd8b7ec: docs: add the Bluetooth developer guide, and make some ↵Scott Main2009-12-101-4/+19
|\ | | | | | | | | | | | | | | | | revisions to the BT javadocs Merge commit 'cdd8b7ec707d0005c3176b4481cab730a92df236' into eclair-mr2 * commit 'cdd8b7ec707d0005c3176b4481cab730a92df236': docs: add the Bluetooth developer guide,
| * docs: add the Bluetooth developer guide,Scott Main2009-12-091-4/+19
| | | | | | | | and make some revisions to the BT javadocs
* | am d4f7b55a: am a7848ce8: docs for ESR: add docs to bluetooth explainin that ↵Scott Main2009-11-201-5/+16
|\| | | | | | | | | | | | | | | | | discovery should be cancelled before connecting to a device Merge commit 'd4f7b55a572b897e800d8335f83916223ba84e22' into eclair-mr2 * commit 'd4f7b55a572b897e800d8335f83916223ba84e22': docs for ESR: add docs to bluetooth explainin that discovery should
| * am a7848ce8: docs for ESR: add docs to bluetooth explainin that discovery ↵Scott Main2009-11-201-5/+16
| |\ | | | | | | | | | | | | | | | | | | | | | | | | should be cancelled before connecting to a device Merge commit 'a7848ce834a484d194d05afd8097ab3014f9b449' into eclair * commit 'a7848ce834a484d194d05afd8097ab3014f9b449': docs for ESR: add docs to bluetooth explainin that discovery should
| | * docs for ESR: add docs to bluetooth explainin that discovery shouldScott Main2009-11-191-5/+16
| | | | | | | | | | | | | | | | | | be cancelled before connecting to a device bug: 2160782,2198463
* | | am 50c66f86: am 88427cff: Merge change Ibcfb7d10 into eclair-sdkScott Main2009-11-101-5/+22
|\| | | | | | | | | | | | | | | | | | | | Merge commit '50c66f861a2d3bf10924a326f1ab078c511a0207' into eclair-mr2 * commit '50c66f861a2d3bf10924a326f1ab078c511a0207': docs: add more documentation for the bluetooth apis.
| * | am 88427cff: Merge change Ibcfb7d10 into eclair-sdkScott Main2009-11-101-5/+22
| |\| | | | | | | | | | | | | | | | | | | Merge commit '88427cff609e668185010af2244500be5823595e' into eclair * commit '88427cff609e668185010af2244500be5823595e': docs: add more documentation for the bluetooth apis.
| | * docs: add more documentation for the bluetooth apis.Scott Main2009-11-091-5/+22
| | | | | | | | | | | | | | | | | | more descriptions for some of the classes and a new overview and pseudo-code example for using BT APIs in the package summary.
* | | am 8d51f710: Merge change Icdd2864e into eclairMichael Chan2009-11-061-4/+6
|\| | | | | | | | | | | | | | | | | | | | Merge commit '8d51f7101d2427953dbff9b4b8f8c9fdc0dc4a91' into eclair-mr2 * commit '8d51f7101d2427953dbff9b4b8f8c9fdc0dc4a91': b/2234854 Fixed Bluetooth API return codes for requesting permission to enable bluetooth
| * | b/2234854 Fixed Bluetooth API return codes for requesting permission to ↵Michael Chan2009-11-051-4/+6
| | | | | | | | | | | | enable bluetooth
* | | am 3cf254d2: Merge change I4b3db907 into eclairJaikumar Ganesh2009-10-301-19/+4
|\| | | | | | | | | | | | | | | | | | | | Merge commit '3cf254d2ba303da3354ed65fd7f3136e87a56b9f' into eclair-mr2 * commit '3cf254d2ba303da3354ed65fd7f3136e87a56b9f': Revert the channge where channels were not selected randomly.
| * | Revert the channge where channels were not selected randomly.Jaikumar Ganesh2009-10-301-19/+4
| |/ | | | | | | | | | | | | | | The Bluez SDP bug has been fixed. Reverting parts of the commit: 07b84cb5bb5283352a27cc0cf651586ed00035a0 Bug: 2173752 Dr No: Eastham
| * Remove STOPSHIP BT logging.Nick Pelly2009-10-091-1/+1
|/ | | | | | | | | Do not merge. Change-Id: I428bc0fc67030f24112f2e9c865824dfaea4897d DrNo: eastham Bug: 2089423 Joke: Why was Tigger looking in the toilet? To find Pooh
* BT API security audit: fix a couple of permission mistakes.Nick Pelly2009-10-091-0/+2
| | | | | | | | | | | | | | | Make functions that are meant to be BLUETOOTH_ADMIN really BLUETOOTH_ADMIN. Add some missing javadoc for permissions. The only functional change here is the BLUETOOTH->BLUETOOTH_ADMIN changes. This is super safe because every system app that uses BT has both permissions. Change-Id: Iddc61f9fd5d81fe0171358665a0fa52f2fa02871 DrNo: eastham Joke: How do you catch a rabbit? Hide behind a tree and make carrott noises.
* Introduce BluetoothAdapter.getDefaultAdapter().Nick Pelly2009-10-081-5/+33
| | | | | | | | | | | | | This is the main entry point to the Bluetooth APIs, and returns the default local Bluetooth adapter. It replaces context.getSystemService(Context.BLUETOOTH_SERVICE). This was never in a public SDK release. DrNo: eastham Bug: 2158765 Joke: Why can't you play cards in the jungle? Because there's too many cheetas! Change-Id: Ieed8be009ee5aba621cb69090ee8c8a9c19c840d
* Encourage developers to connect RFCOMM by UUID instead of Channel.Nick Pelly2009-10-071-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Provide an API for apps to use a dynamic RFCOMM channel and SDP record.Nick Pelly2009-10-061-17/+141
| | | | | | | | | | | | | | | | | | | | | | 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
* Move android.bluetooth.ParcelUuid to android.os.ParcelUuidNick Pelly2009-09-281-0/+1
| | | | Change-Id: I564429d5c5b6a5372b6ff26a53b0d7e518b53631
* Add an API to request a system activity to turn on Bluetooth.Nick Pelly2009-09-281-1/+21
| | | | Change-Id: I2fca33ad27017ea4e2ecba37854b749682d07672
* Handle expiration of discovery mode in system server.Nick Pelly2009-09-251-6/+13
| | | | Change-Id: I58fd199b40ffdf8168a5489be8eedb5d25d56722
* Fix typo in Bluetooth docs.Brad Fitzpatrick2009-09-251-2/+2
|
* Bluetooth API: Do not allow apps to programmatically make BT discoverable.Nick Pelly2009-09-241-1/+38
| | | | | | | | | | Instead add ACTION_REQUEST_DISCOVERABLE for the system to show a dialog to adjust discoverable mode. Also remove createBond(), removeBond() and cancelBondProcess(). The Settings App already handles these automatically when connections require bonding. Change-Id: I216154cd1b6de410de64ba91b07d7263ac03e8df
* Reject lowercase characters in checkBluetoothAddress().Nick Pelly2009-09-181-2/+4
| | | | | | | | This keeps consistency with Bluez which uses upper case string address. It's important to keep the case the same so that .equals() in BluetoothService.java work. Change-Id: I6404ca137d0aec3cc2e6e7cb79763d5305a03547
* API_CHANGE: Cleanup, javadoc and unhide more Bluetooth API.Nick Pelly2009-09-101-52/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a large batch, and covers: -- Bluetooth Device Discovery -- BluetoothAdapter.ACTION_DISCOVERY_STARTED BluetoothAdapter.ACTION_DISCOVERY_FINISHED BluetoothAdapter.startDiscovery() BluetoothAdapter.cancelDiscovery() BluetoothAdapter.isDiscovering() -- Bluetooth bonding (pairing) -- BluetoothAdapter.getBondedDevices() BluetoothDevice.ACTION_BOND_STATE_CHANGED BluetoothDevice.EXTRA_BOND_STATE BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE BluetoothDevice.BOND_NONE BluetoothDevice.BOND_BONDING BluetoothDevice.BOND_BONDED BluetoothDevice.getBondState() BluetoothDevice.createBond() BluetoothDevice.cancelBondProcess() BluetoothDevice.removeBond() -- BluetoothClass -- BluetoothDevice.ACTION_CLASS_CHANGED BluetoothDevice.EXTRA_CLASS BluetoothDevice.getBluetoothClass() BluetoothClass.Service.* BluetoothClass.Device.Major.* BluetoothClass.Device.* BluetoothClass.getDeviceClass() BluetoothClass.getMajorDeviceClass() BluetoothClass.hasService() -- Misc BluetoothDevice -- BluetoothDevice.ACTION_ACL_CONNECTED BluetoothDevice.ACTION_ACL_DISCONNECTED_REQUESTED BluetoothDevice.ACTION_ACL_DISCONNECTED BluetoothDevice.ACTION_DISCOVERED BluetoothDevice.ACTION_NAME_CHANGED BluetoothDevice.EXTRA_DEVICE BluetoothDevice.EXTRA_NAME BluetoothDevice.EXTRA_RSSI -- Misc BluetoothAdapter -- BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED BluetoothAdapter.EXTRA_LOCAL_NAME BluetoothAdapter.checkBluetoothAddress() I deprecated BluetoothIntent and moved each intent into the class it relates to. Change-Id: I877b1280428ab46278b2bc25668bb44cda22dc36
* API_CHANGENick Pelly2009-09-091-0/+9
| | | | | | | | | | | | | | | | | | | Deprecate BluetoothError.java. I spent a lot of time experimenting with a class BluetoothError to enumerate the many error codes returned by the Bluetooth API. But at the end of the day they were never used. The vast majority of method calls only really need a true/false error value, and often not even that. Methods which do need more detailed error enumeration (for example, bonding failures) can have there own enumerated error codes. But there is no need for a common set of error codes. Also change the IPC failed warnings in BluetoothA2dp to Log.e. These indicate a very serious error. Introduce BluetoothAdapter.ERROR and BluetoothDevice.ERROR as helper sentinel values.
* API_CHANGENick Pelly2009-09-091-71/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another round of Bluetooth API clean up, javadoc'ing and unhide'ing. -- Symbols for getting/setting bluetooth state -- BluetoothAdapter.ACTION_STATE_CHANGED BluetoothAdapter.EXTRA_STATE BluetoothAdapter.EXTRA_PREVIOUS_STATE BluetoothAdapter.STATE_OFF BluetoothAdapter.STATE_TURNING_ON BluetoothAdapter.STATE_ON BluetoothAdapter.STATE_TURNING_OFF BluetoothAdapter.isEnabled() BluetoothAdapter.getState() BluetoothAdapter.enable() BluetoothAdapter.disable() -- Symbols for getting/setting scan mode -- BluetoothAdapter.ACTION_SCAN_MODE_CHANGED BluetoothAdapter.EXTRA_SCAN_MODE BluetoothAdapter.EXTRA_PREVIOUS_SCAN_MODE BluetoothAdapter.SCAN_MODE_NONE BluetoothAdapter.SCAN_MODE_CONNECTABLE BluetoothAdapter.SCAN_MODE_DISCOVERABLE BluetoothAdapter.getScanMode() BluetoothAdapter.setScanMode() -- Symbols for getting address/names -- BluetoothAdapter.getAddress() BluetoothAdapter.getName() BluetoothAdapter.setName()
* Add javadoc to explain which permissions are required for Public BT API's.Nick Pelly2009-09-081-0/+1
|
* Immediately destroy BluetoothSocket's on close().Nick Pelly2009-09-021-3/+3
| | | | | | | | | | | | | | | 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-17/+62
| | | | | | | 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-0/+331
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