summaryrefslogtreecommitdiff
path: root/core/java/android/server/BluetoothEventLoop.java
Commit message (Collapse)AuthorAgeFilesLines
* Delete various Bluetooth files for stack integration.Jaikumar Ganesh2012-07-131-1067/+0
|
* Check null of address in onDeviceCreatedMatthew Xie2012-05-011-1/+5
| | | | | | | | | address can be null that returned from getAddressFromObjectPath. If it is null case, donot continue call getRemoteDeviceProperties. Otherwise it causes null pointer exception and crash the system. Bug 6338780 Change-Id: Ib190342032ab2ad11c49f44fa6d4b2509a861514
* Get alias for Bluetooth devices.Jeff Brown2012-04-201-0/+4
| | | | | | | | | | | Bluetooth devices can be renamed by the user. Make the input system aware of the user-specified name and transparently pass it down to applications. This enables the keyboard layout picker Settings UI to use device names that are consistent with what the user set in the Bluetooth UI. Bug: 6363157 Change-Id: I8eea26ce2c69c2a3f09c8de02e9e847610e0419c
* Call notifyIncomingA2dpConnection with correct rejected statusMatthew Xie2011-11-161-2/+2
| | | | | | | | notifyIncomingA2dpConnection was called with wrong rejected status. Fix this. bug 5626476 Change-Id: Ie8e4a8bdc6f6357a62172c86c21ee547376952a4
* Send CONNECT_OTHER_PROFILE to Device profile for hfp and a2dp incoming connectMatthew Xie2011-11-111-1/+2
| | | | | | | | | | | | Send CONNECT_OTHER_PROFILE to Device profile for low priority hfp and a2dp incoming connect. In the case when HFP autoconnect is off but a2dp autoconnect is on, if HF autoconnect to HFP, phone will reject HFP but connect a2dp. Before this fix, phone reject HFP. A2dp will not get connected unless the HF do media auto-connect, which most carkits do not do. Also do similar change for incoming a2dp connection bug 5091838 Change-Id: Ife1815f527bcd94e0d9ffc645028484fa9c49a43
* Add Register before boot flag.Jaikumar Ganesh2011-09-141-0/+3
| | | | | | In some instances, the device might connect before we have booted up. Change-Id: I1a50585207a2b0b2339acb048dffaea84e1a91e9
* Merge "Add error codes for channel disconnection / connection."Jaikumar Ganesh2011-09-091-0/+17
|\
| * Add error codes for channel disconnection / connection.Jaikumar Ganesh2011-09-081-0/+17
| | | | | | | | | | | | | | | | Channel connection / disconnection was handled as boolean, doesn't capture all the values. Also make it asynchronous instead of the dbus call being synchronous. Change-Id: If30177b9f93b7c83f162fbbc1233edf3e46dbfea
* | Apply timeout for powerdown event and reset state machine when bluez crashesMatthew Xie2011-09-081-17/+2
|/ | | | | | | | | | The powerdown event was missed some time for unknown reasons and bluez could crash for unknown reasons. We will debug on the issue. But for the time being, we add a powerdown timer and process power up event to recover from bluez crash bug 5239719 Change-Id: Ie7315fb01e029747951e1a97a2d2f1dce53a997b
* Implement switchConnectable with Powered property setting instead of scan modesMatthew Xie2011-08-151-12/+9
| | | | | | | | | | Bluez powered property setting is more apropriate for what this method intend to achieve and it fixes a bug that incoming connection request wake up the stack in The pairable events are replaced by power and discoverable events HotOff state bug 5080232 Change-Id: I43b44cb2f5203bd99bf764d5a1696e8ff52a31db
* Merge "Move mBluetoothService.runBluetooth after broadcasting the STATE_ON ↵Matthew Xie2011-08-021-2/+0
|\ | | | | | | intent."
| * Move mBluetoothService.runBluetooth after broadcasting the STATE_ON intent.Matthew Xie2011-08-021-2/+0
| | | | | | | | | | | | | | | | | | | | This is because broadcastState method move the Bluetooth adapter state to ON. The mBluetoothService.runBluetooth should be called only in the ON state. Remove mIsDiscovering variable in BluetoothService. Fix a bug in BluetoothA2dpService that caused 2 times of state change from DISCONNECTED to CONNECTING that messed up BluetoothService's connection state count. Change-Id: Ifb782a845ae70f007d2e036d930bb55f445d68b5
* | Fix tethering using BT.Jaikumar Ganesh2011-08-021-17/+16
|/ | | | | | | | | 1. Since Input device runs in Bluetooth Service, avoid the proxy call. 2. Accept or reject incoming tethering connections. This broke because of incoming connection request change for phonebook, HID, A2DP. Change-Id: Ia8c537bb79e4dbc66cfb6b23dcad4f99dbf950b3
* Merge "Provide an API to set the friendly name of a remote device."Matthew Xie2011-07-281-0/+2
|\
| * Provide an API to set the friendly name of a remote device.Matthew Xie2011-07-281-0/+2
| | | | | | | | | | | | | | | | BluetoothDevice setName overwrite the locally cached remote name. The changed name is saved in the local storage so that the change is preserved over power cycle. bug 5081605 Change-Id: I486966033828d153bfb1076a99e274c8a7f41636
* | Add ability to turn BT on / off on a per application basis.Jaikumar Ganesh2011-07-261-2/+2
|/ | | | | | | | | | This changes adds an API for system applications to enable bluetooth without all the side effects like auto connection to headsets etc. Also some tweaks to the adapter state machine Change-Id: Ib9f22d548a26d72334b300101c8eb0d80f08a4bb
* Keep Bluetooth module hot to quickly swith it on/offMatthew Xie2011-07-251-3/+15
| | | | | | | | | | | Add BluetoothAdapterStateMachine to maintain a inter state machine other than the public BluetoothAdapter states. This is a improvement to BluetoothService code. 2 internal state are added, LoadingFirmware and FirmwareLoaded to place the Bluetooth module in a ready-to-switch-on state so that it can be quickly switched on to have a better user experience bug 5021787 Change-Id: Ia352e88cba509d9e98c900f85e7479f8cee1de5e
* Remove Car audio class from auto pairing.Jaikumar Ganesh2011-07-141-1/+0
| | | | | | | | | Majority of the cars don't auto pair unlike headsets, as they have a display. Instead of maintaining a blacklist of such cars, disable auto pairing with 0000. This is legacy anyway as newer cars come with 2.1 pairing. Change-Id: I644e2da4d11cf2d250d846853523d7975ca000fc
* Incoming Bluetooth Connection requests - dialog.Matthew Xie2011-07-071-12/+22
| | | | | | | | This sends the intents to the Settings app to show the dialogs for the incoming connection requests. Includes down merged contributions from Jaikumar Ganesh. Change-Id: Ic8b857aad3554315aae39a0e871eb94d0ac98a91
* Implement APIs for Bluetooth Health profile.Jaikumar Ganesh2011-06-241-0/+27
| | | | | | | This first patch implements all the APIs. The APIs wil be made public soon. The data specification API will be submited in another patchset. Change-Id: I2462683b7e07380e2c42474b0036b34d03b4bed1
* Refactor android.server.BluetoothService classes.Jake Hamby2011-02-241-29/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | Several cleanups to BluetoothService: - Move BluetoothService.BondState inner class to top level. - Extract adapter and remote device properties cache management logic into two new classes: BluetoothAdapterProperties and BluetoothDeviceProperties. - Add getter methods for other classes in the package to access the new properties cache objects for multi-part operations. - Inline log() method in BluetoothService and selected the appropriate Log method (Log.d, Log.w, Log.e) for each message. - Refactor dump() method into smaller sized pieces. - Clean up logic of updateCountersAndCheckForConnectionStateChange() method for better readability. - Change sendConnectionStateChange() to return instead of sending an intent if the current or previous state values are invalid. Previously the code sent an intent with -1 for the invalid state. - Added Javadoc comments to document the methods that are called from native Bluez code. - Fixed some typos and code style issues. Original Change by: Jake Hamby Modified by: Jaikumar Ganesh Change-Id: I76ebac00ecd29566dcb2d1ad3e7a486b7530ce24
* Make BluetoothPan inherit from BluetoothProfile.Jaikumar Ganesh2011-02-231-1/+1
| | | | Change-Id: Ibd3e24e391be93ebe2cf975bd075efb68e10c1ff
* Make BluetoothInputDevice inherit from BluetoothProfile.Jaikumar Ganesh2011-02-221-19/+16
| | | | | | This makes it in sync with BluetoothHeadset and BluetoothA2dp profiles. Change-Id: I3ddb1d18b04aacb173b7bc376bca21c277a6afe4
* Reject incoming tethering connections if Tethering option is not enabled.Jaikumar Ganesh2011-02-071-2/+1
| | | | Change-Id: I40aa08ad5a3f3a2169551bbe35682910daced098
* Wait till SDP records are registered before sending intent.Jaikumar Ganesh2011-02-031-0/+3
| | | | | | | | | | | | | | | Wait till all SDP records are registered, before sending STATE_ON intent. This would fix crashes in Settings app when the profile manager is not registered. Problem: We were sending Bluetooth State on intent before we got the uuid state change intent from Bluez, which is asynchronous. Hence when the Settings app queries for the profiles to decide if headset profile was registered it would get false and the profile manager would be null causing crashes. This was not 100 % reproducible, well because it was a race condition. Change-Id: I791eb63dfbc78aba4c06fd8db933069cb5fde00d
* Make connection / disconnect failure more robust.Jaikumar Ganesh2011-01-191-8/+26
| | | | | | Add error codes so that the states can be tracked better. Change-Id: Ic07a5d34589134b68dedeb4803ccb523aa01b567
* Phone crash when old callback func is woken up when enabling BT.Staffan Lindvall2011-01-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the remote Jerry device is powered down the BT link to the phone is dropped, and the Jerry firmware in the phone quite immediately tries to re-connect to the Jerry device. Then SDP and Discover Services is started, fetchRemoteUuids() -> discoverServicesNative(). This results in an asynchronous dbus call dbus_func_args_async() that is provided with a callback function, onDiscoverServicesResult(), but before this callback function is used Bluetooth is disabled according to the problem scenario above. For some reason this discover services activity is not cleared when Bluetooth is disabled, so when Bluetooth is enabled again the (old) callback function onDiscoverServicesResult() is executed, but the following getAddressFromObjectPath() fails. The reason for this is that the deviceObjectPath parameter contains an old value, containg the process id of the old bluetoothd (the one running before Bluetooth was disabled). Then the new updated AdapterObjectPath /org/bluez/<new bluetooth hd pid>/hci0/dev_ is not a prefix of the old deviceObjectPath /org/bluez/<old bluetooth hd pid>/hci0/dev_<BT_ADDR>, which results in that null will be used as address in sendUuidIntent(), and later on, ending up in the BluetoothDevice constructor where and IllegalArgumentExceotion is thrown due to Bluetooth address = null. Then the phone will crash. Making sure sendUuidIntent() is not called when address is null is a work-around for the problem. Change-Id: I8ff60bad80de3b379cef0970402943dfa4de3cfd
* Add ability to parse keyboard fixed pin auto pair blacklist.Jaikumar Ganesh2011-01-121-1/+8
| | | | | | | Try auto pairing with such keyboards. Also fix bug where dynamic auto pairing file was not being created. Change-Id: I93afb96fee8bc4f245f96ec5961979c620de7948
* Revert "Add temporary hack for keyboards not following spec."Jaikumar Ganesh2011-01-121-19/+8
| | | | This reverts commit 8cc316e4f4458725f78b2b7ebde2f780f9b8447b.
* Add temporary hack for keyboards not following spec.Jaikumar Ganesh2011-01-061-8/+19
| | | | Change-Id: Ic206d45e54f0dc2ccf8124adb08df0c768d7e130
* Follow the spec recommendation for keyboard pairing.Jaikumar Ganesh2011-01-061-5/+29
| | | | | | Generate a variable pin and show it to the user. Change-Id: Id4aae7a16f25c67d6c6ead6fd936cb14087f3c7a
* Enable Bluetooth reverse tethering.Jaikumar Ganesh2010-12-221-3/+5
| | | | Change-Id: I84a508b64f18a1445b8ac424f2a36d56ef432375
* Add EXTRA_LOCAL_ROLE to Pan State change intent.Jaikumar Ganesh2010-12-211-5/+10
| | | | | | This will help apps distinguish between reverse and normal tethering. Change-Id: I5327ad75dc2cbf478e4f7c2cd6ef1dbe8fba9e93
* Add FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT to name changed broadcast.Jaikumar Ganesh2010-12-151-0/+1
| | | | | | | | BT can come up before the system boots up and we send a broadcast, this can cause issues. Bug: 3259948 Change-Id: I53ce6b9851fbf611309db1f0a16768ef9f388e0c
* Add direct calls to Bluez to add SDP records.Jaikumar Ganesh2010-12-131-1/+1
| | | | | | This helps Settings app to enable just the Headset service. Change-Id: Ia9c39467df1e83d665e377313e16e6c54991f6d6
* Revert "Don't call cancel discovery when its already canceelled."Jake Hamby2010-11-191-0/+2
| | | | | This reverts commit 58d0dcb75b776bba0737412d2f5e203792b06a52. Fixes a bug where discovery would start every 20-30 seconds.
* Don't call cancel discovery when its already canceelled.Jaikumar Ganesh2010-11-121-2/+0
| | | | | | Reported by: Leijun Tao Change-Id: I5f04ecde16d147776a30810210cd3c973aee4d87
* Clean up some logging to make it more useful to debug.Jaikumar Ganesh2010-10-261-4/+4
| | | | Change-Id: Ic30210ea6886b1c4630d7671a4b01736512e9da8
* Make setting the adapter properties asynchronous.Jaikumar Ganesh2010-10-251-0/+2
| | | | | | | | | 1. These involve disk operations and multiple processes. 2. onPropertyChange already informs us asychronously. 3. Settings app is the only user, will have to revisit the function if we make them public. Change-Id: If019a83c05a0c9e625f27faf99063d33f369f0d8
* Update BT APIs return type from Set to List.Jaikumar Ganesh2010-10-221-4/+5
| | | | Change-Id: Ia27220dd26cde13007f6938c830517ee7f6968ce
* Fix race condition between starting of service and getting the Profile Proxy.Jaikumar Ganesh2010-10-181-0/+2
| | | | | | Incoming A2DP connections were not working. Change-Id: I5a3322ddb39b2512495b4cd2e35593da0f605087
* resolved conflicts for merge of bbb90d13 to masterJaikumar Ganesh2010-10-151-1/+8
|\ | | | | | | Change-Id: I85de73f6e11e7547a006d41ca49021bca19af14b
| * am c008ca96: Merge "Work around for errant headsets." into gingerbreadJaikumar Ganesh2010-10-131-1/+8
| |\ | | | | | | | | | | | | | | | | | | Merge commit 'c008ca96bb32289958010dcf8f247c35ab9b1f18' into gingerbread-plus-aosp * commit 'c008ca96bb32289958010dcf8f247c35ab9b1f18': Work around for errant headsets.
| | * Work around for errant headsets.Jaikumar Ganesh2010-10-131-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Some headsets send an AVCTP connection before an AVDTP connection When that AVCTP connection fails, we get stuck in IncomingA2DP state because we don't handle AVCTP signals for now. We need to handle the signals and fix it better. 2. Also when ACL gets disconnected, reset state i.e when the low level connection disconnected reset our state. This is like a fail safe in case we get stuck. Bug: 3051490 Change-Id: Ibcf188103999ffb1e08c36c2554504c639fb7f50
* | | resolved conflicts for merge of 738aadd7 to masterJake Hamby2010-09-301-2/+2
|\| | | | | | | | | | | Change-Id: I8810cc6dbd532de002d6a623ad93e86afb48c0b4
| * | resolved conflicts for merge of 0a972acf to gingerbread-plus-aospJake Hamby2010-09-301-2/+2
| |\| | | | | | | | | | Change-Id: Id8dc5038edc214b4433bdf690243f2f5fe5b4812
| | * Typo fixes in comments and minor code cleanups.Jake Hamby2010-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | | am c10207b6: am a5c742bf: Merge "Update local cache before sending intent." ↵Jaikumar Ganesh2010-09-301-6/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | into gingerbread Merge commit 'c10207b6bfcfe09636dd2035b4237f1001008a48' * commit 'c10207b6bfcfe09636dd2035b4237f1001008a48': Update local cache before sending intent.
| * | am a5c742bf: Merge "Update local cache before sending intent." into gingerbreadJaikumar Ganesh2010-09-291-6/+6
| |\| | | | | | | | | | | | | | | | | | | Merge commit 'a5c742bfd08df55849418cd1c77065ac54d83502' into gingerbread-plus-aosp * commit 'a5c742bfd08df55849418cd1c77065ac54d83502': Update local cache before sending intent.
| | * Update local cache before sending intent.Jaikumar Ganesh2010-09-291-6/+6
| | | | | | | | | | | | Change-Id: I0e016cae3070b1811dd68958afb8a8501081097d