summaryrefslogtreecommitdiffstats
path: root/core/java/android/server/BluetoothService.java
Commit message (Collapse)AuthorAgeFilesLines
* Watch for "bluetooth" in list of toggleable radios.Jeff Sharkey2009-12-221-5/+14
| | | | | | | | | Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS is a list of radios that can be toggled while in airplane mode. This change adds logic to BluetoothService to allow enabling when Settings.System.RADIO_BLUETOOTH appears in that list. Fixes http://b/2297314
* am f6e32e72: Merge change Icced7a09 into eclairJaikumar Ganesh2009-12-101-30/+30
|\ | | | | | | | | | | | | Merge commit 'f6e32e72a902d9a309410bc5306a539ea850159f' into eclair-mr2 * commit 'f6e32e72a902d9a309410bc5306a539ea850159f': Maintain a list of all Bluetooth docks.
| * Maintain a list of all Bluetooth docks.Jaikumar Ganesh2009-12-091-30/+30
| | | | | | | | | | | | | | | | | | With this change, isBluetoothDock API can be used anytime and is not in tied to dock state. The Dock State is a sticky intent so users can query for the dock state. Dr No: Eastham Bug: 2133530
* | am 8c411fb1: Merge change I79420b02 into eclairJaikumar Ganesh2009-12-031-2/+117
|\ \ | |/ | | | | | | | | | | Merge commit '8c411fb13923d1fa28fcd98452bf3d17b8b1a338' into eclair-mr2 * commit '8c411fb13923d1fa28fcd98452bf3d17b8b1a338': Add support for Car Dock.
| * Add support for Car Dock.Jaikumar Ganesh2009-12-031-2/+117
| | | | | | | | | | Dr No: Eastham Bug: 2133530
| * Register Handsfree profile before headset profile. DO NOT MERGE.Jaikumar Ganesh2009-11-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a delay between registering the two profiles, and handsfree profile is a superset of the headset profile. So some devices do an SDP and get the headset profile record before we have registered the handsfree profile. a) We can reject all incoming connections till all profiles are registered, but then this would mean we connect later in some cases. Registering profiles in this order seems fine to me. Note: There is a also the need to fix forking sdptool to register profiles, which would obliviate the need to wait 500 msecs between profile registrations. Bug: 2293792 Dr No: Eastham
* | Register Handsfree profile before headset profile.Jaikumar Ganesh2009-11-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a delay between registering the two profiles, and handsfree profile is a superset of the headset profile. So some devices do an SDP and get the headset profile record before we have registered the handsfree profile. a) We can reject all incoming connections till all profiles are registered, but then this would mean we connect later in some cases. Registering profiles in this order seems fine to me. Note: There is a also the need to fix forking sdptool to register profiles, which would obliviate the need to wait 500 msecs between profile registrations.
* | am ad431ad8: Merge change Ia3acc2ee into eclairJaikumar Ganesh2009-11-221-5/+9
|\ \ | |/ | | | | | | | | | | Merge commit 'ad431ad8631d8b19b04193ff1f89a955a7643c60' into eclair-mr2 * commit 'ad431ad8631d8b19b04193ff1f89a955a7643c60': Fix pairings lost on reboot.
| * Fix pairings lost on reboot.Jaikumar Ganesh2009-11-201-5/+9
| | | | | | | | | | Bug:2277376 Dr No:Eastham
* | am 660282dc: Merge change I706fe6b0 into eclairJaikumar Ganesh2009-11-171-9/+42
|\ \ | |/ | | | | | | | | | | Merge commit '660282dc3e81784224945be0787a9e2d4276de8c' into eclair-mr2 * commit '660282dc3e81784224945be0787a9e2d4276de8c': Check if Bluetooth is enabled before making any calls down.
| * Check if Bluetooth is enabled before making any calls down.Jaikumar Ganesh2009-11-161-9/+42
| | | | | | | | | | | | | | | | This was causing problems when apps were making calls, without turning on BT first. Bug: 2234918 Dr No: Eastham
* | am 3c58d279: Merge change I738ed802 into eclairJaikumar Ganesh2009-11-111-5/+12
|\ \ | |/ | | | | | | | | | | Merge commit '3c58d279abed1da56b0ece74ded5854c509a42a4' into eclair-mr2 * commit '3c58d279abed1da56b0ece74ded5854c509a42a4': Fix BMW and Audi auto pairing lists.
| * Fix BMW and Audi auto pairing lists.Jaikumar Ganesh2009-11-111-5/+12
| | | | | | | | | | Bug no:2256558 Dr No:Eastham
* | am 013b0e53: Merge change I143ea844 into eclairJaikumar Ganesh2009-11-111-2/+3
|\ \ | |/ | | | | | | | | | | Merge commit '013b0e531a4318b3e78c9bd0e077d3632fce2280' into eclair-mr2 * commit '013b0e531a4318b3e78c9bd0e077d3632fce2280': Add BMW and Audi to Auto Pairing black list.
| * Add BMW and Audi to Auto Pairing black list.Jaikumar Ganesh2009-11-111-2/+3
| | | | | | | | | | Bug: 2256558 Dr No: Eastham
* | am 8de4e0ad: Merge change I21d0dca3 into eclairJaikumar Ganesh2009-11-051-2/+3
|\ \ | |/ | | | | | | | | | | Merge commit '8de4e0ad8ff39d9a397cd80de5155d4c09ef98fd' into eclair-mr2 * commit '8de4e0ad8ff39d9a397cd80de5155d4c09ef98fd': Add BMW kits made by Motorola PCS to autoblack list for Bluetooth.
| * Add BMW kits made by Motorola PCS to autoblack list for Bluetooth.Jaikumar Ganesh2009-11-051-2/+3
| | | | | | | | | | | | | | This may force some Motorola headsets to thow up the Pairing Request. Bug: 2210365 Dr No: Eastham
* | am d301c904: Merge change I305c181c into eclairNick Pelly2009-10-121-4/+32
|\ \ | |/ | | | | | | | | | | Merge commit 'd301c90446644f63cda9b9263f83332676065bb4' into eclair-mr2 * commit 'd301c90446644f63cda9b9263f83332676065bb4': Delay 500ms between each registering each SDP record using sdptool.
| * Delay 500ms between each registering each SDP record using sdptool.Nick Pelly2009-10-121-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to workaround an issue where SDP records will fail to register using sdptool. When we run SystemService.start() it forks sdptool, so if we do this four times in a row these forked processes can run in parallel, and one or more of them fails. There is probably some thready safety issue in sdptool or Bluez that makes it unsafe to run sdptool in parallel. As a workaround, delay 500ms between each run of sdptool to register SDP records when starting Bluetooth. Before this fix it was easy to reproduce problems with service record registration. If you turn BT off/on multiple times you can see that sometimes one or more service records are missing. Repro rate is about 20% in my tests. Result is that remote devices cannot connect to the missing service. After this fix I am unable to reproduce any missing SDP records, after 30+ cycles of BT on/off. Motorola BT team also ran stress tests overnight with this fix and were unable to reproduce the missing SDP records. This is a low risk fix. It does delay some records from being registered by an additional 1.5 seconds (on top of the 3 second delay we already had), so if you try and very quickly connect a BT service after turning BT on it won't work the first time. Do not merge. (I will use a less hacky fix for MR2/Master) Change-Id: I305c181c3194e8ce25e3825320cc2e1ef6d3d3cc Bug: 2180800 DrNo: eastham Joke: Why can't you play cards in the jungle? Because there's too many cheetas!
| * 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-3/+4
| | | | | | | | | | | | | | | 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.
* Set the Bond State to NONE when we receive a Agent Cancel.Jaikumar Ganesh2009-10-081-1/+1
| | | | | | | | | Sometimes during OPP, we can get stuck in Pairing state when the remote end, cancels the Pairing process - we will just get onAgentCancel and thus not set the Pairing state properly. DrNo: Eastham Bug:2174874
* Introduce BluetoothAdapter.getDefaultAdapter().Nick Pelly2009-10-081-1/+1
| | | | | | | | | | | | | 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-14/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 24bb9b8af4ff6915 - 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-21/+107
| | | | | | | | | | | | | | | | | | | | | | 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
* Query from Bluez if name is not present in cache.Jaikumar Ganesh2009-09-301-3/+1
| | | | Change-Id: I78c4e64a52b8290053dedfb1326df8d4c20f8a09
* Move android.bluetooth.ParcelUuid to android.os.ParcelUuidNick Pelly2009-09-281-1/+1
| | | | Change-Id: I564429d5c5b6a5372b6ff26a53b0d7e518b53631
* Handle expiration of discovery mode in system server.Nick Pelly2009-09-251-1/+18
| | | | Change-Id: I58fd199b40ffdf8168a5489be8eedb5d25d56722
* Bluetooth API: Do not allow apps to programmatically make BT discoverable.Nick Pelly2009-09-241-2/+2
| | | | | | | | | | 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
* Send the address of the device with the UUID intent.Jaikumar Ganesh2009-09-211-0/+1
| | | | Change-Id: I6357d482550e9e02edf221add318ecd9cfadcb66
* Cache the remote device's service channel.Jaikumar Ganesh2009-09-211-6/+51
| | | | | | | | | | Bluez Device implementation is such that when a device is unpaired, we removes the device and hence there is no way to interact with it unless you pair again. Remote service channel call is used to get the rfcomm channel number which will be used in profiles like OPP which don't require pairing. Change-Id: I868a6cdfdb1b7d3591dd8b66cd0320f41a9c1b92
* Send the UUID intent even if apps have not requested for it.Jaikumar Ganesh2009-09-201-6/+5
| | | | | | | | | This will help apps listening to this intent to update icons etc if the remote uuid changes. For example, the settings app used to refresh the icons when the class bits change. It can do it now when the remote ends uuids changes too. Change-Id: Ib9af45780e83118d8877b0ef16f5b39b87fb4bef
* Maintain pending outgoing bonding address.Jaikumar Ganesh2009-09-201-2/+24
| | | | | | This helps us to distinguish between incoming and outgoing Bonding requests. Change-Id: I69e6a269b7dd6aad60e6f5711cad812291a7d313
* Add new API for fetching UUIDs using SDP.Jaikumar Ganesh2009-09-191-0/+61
| | | | | | | | | Add new API which clients can use to force an SDP query. The result is broadcast using an intent having the UUIDs. The intent is broadcast after a timeout, in case of an error. This timeout is greater than the page timeout. Change-Id: I61e6db4c05b34c42f679a66987e37e2063a793b6
* Change handling of remoteUuids.Jaikumar Ganesh2009-09-161-15/+20
| | | | | | Use the ParcelUuid instead of UUID Change-Id:Ie05d65a62e8a4df8182a4c737d46c14142bfec43
* Add Panasonic KX-TH112 to blacklist.Nick Pelly2009-09-151-2/+2
| | | | Change-Id: I12475aff4046796132beb2554cd067bcec712973
* Add black listing of car kits by name.Jaikumar Ganesh2009-09-141-2/+15
|
* Changes for BT 2.1Jaikumar Ganesh2009-09-111-1/+0
| | | | | | | | | | 1) Handle incoming 2.1 pairing requests 2) Modify displaying error messages on bond failures. 3) Add delay while accepting incoming pairing for certain 2.1 devices. When MITM is on, the link key request might come more than once. Auto accept with a delay. 4) Handle DisplayPasskey callback for pairing a 2.1 keyboard with a 2.1 device
* API_CHANGE: Cleanup, javadoc and unhide more Bluetooth API.Nick Pelly2009-09-101-26/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+2
| | | | | | | | | | | | | | | | | | | 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-28/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()
* Query for all properties if a property change is received and cache is empty.Jaikumar Ganesh2009-09-081-0/+4
|
* Add Bluetooth Device trustLixin Yue2009-09-011-0/+37
|
* Fix property being cleared when DeviceFound signal is received.Jaikumar Ganesh2009-08-281-15/+16
|
* Add trailing "\n" to debug output.Nick Pelly2009-08-261-1/+1
|
* Add uuids to adb shell dumpsys bluetoothNick Pelly2009-08-261-2/+13
|
* Set BondState to Canceled when user cancels pairing.Jaikumar Ganesh2009-08-211-0/+2
|
* Bluetooth: API change.Nick Pelly2009-08-181-0/+1210
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