summaryrefslogtreecommitdiffstats
path: root/core/jni/android_server_BluetoothEventLoop.cpp
Commit message (Collapse)AuthorAgeFilesLines
* frameworks/base: bluetooth: AVRCP 1.3 feature changesPrabhakaran Mc2012-03-301-0/+13
| | | | | | | | | | | | | | | | | Bluetooth module will listen metadata/event change intents from Music app and post data to Bluez stack. Modified by Chris Boyle: removed PLAYSTATUS_REQUEST/RESPONSE. See http://review.cyanogenmod.com/14001 Conflicts: core/java/android/server/BluetoothA2dpService.java core/jni/android_server_BluetoothEventLoop.cpp Gingerbread change Icbfb1712dde98c9677f57c869bcfffed2bb42a14 Change-Id: Id8cbec68302b53befbec4273013668a58c755369
* Fix a compile error when debug is turned onMatthew Xie2011-09-121-1/+1
| | | | | | logv uses a variable that is declared after its use Change-Id: Id5c09698e4a0a91befa3ce2f60ce02ec28733889
* Add error codes for channel disconnection / connection.Jaikumar Ganesh2011-09-081-0/+37
| | | | | | | | 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
* Merge "Listen to the right Bluez signal for Channel deletion."Jaikumar Ganesh2011-08-221-1/+1
|\
| * Listen to the right Bluez signal for Channel deletion.Jaikumar Ganesh2011-08-211-1/+1
| | | | | | | | | | | | | | | | | | Health device channel deletion was looking at the wrong dbus interface. Reported by: Sungjun<sj222.choi@samsung.com> Change-Id: I48e7c464fdcdd8bd47dc8cc9cd55b14ba8ea6bbf
* | am 294539df: am 3e941347: am 6f6b21b4: am 4733d3a6: Merge "Bluetooth event ↵Jaikumar Ganesh2011-08-181-0/+14
|\ \ | |/ |/| | | | | | | | | loop dispatches dbus data on wakeup" * commit '294539df2c05eb62c417e25b2e1c8a71474b09e6': Bluetooth event loop dispatches dbus data on wakeup
| * am 3e941347: am 6f6b21b4: am 4733d3a6: Merge "Bluetooth event loop ↵Jaikumar Ganesh2011-08-181-0/+14
| |\ | | | | | | | | | | | | | | | | | | dispatches dbus data on wakeup" * commit '3e9413473f87ad17f3767ffbb0c57046c2db29be': Bluetooth event loop dispatches dbus data on wakeup
| | * Bluetooth event loop dispatches dbus data on wakeupAlbert Mojir2011-08-161-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some occasions when the event loop thread and a binder thread are both waiting for a message from dbus, both threads are not woken up when a message is received. This causes applications not receiving responses or events. This happens because both threads are listening to same socket and both threads are not guaranteed to wake up when there is data to read. To fix this we subscribe to callback to wake the eventloop when an message is added to incoming queue. To reproduce the issue: 1. Activate BT 2. Make phone Discoverable 3. Clock is ticking down from 120s 4. At 20s tap the setting again 5. Crash due to keyDispatchingTimedOut 6. Not possible to scan for other devices or making your phone discoverable again 7. Restart necessary Tell tale sign: 07-25 16:37:12.240 E/ActivityManager( 262): ANR in com.android.settings (com.android.settings/.bluetooth.BluetoothSettings) 07-25 16:37:12.240 E/ActivityManager( 262): Reason: keyDispatchingTimedOut Test case to verify this patch: android.bluetooth.BluetoothStressTest#testDiscoverable Change-Id: I7696b5722805e85cd0204ce2597e91594cbe6789
| | * am b38fa2a0: Merge "DO NOT MERGE Incoming Bluetooth Connection requests - ↵Jaikumar Ganesh2011-06-211-23/+5
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | dialog." into gingerbread * commit 'b38fa2a0ac2bde56504929de6a3dd61ac723958e': DO NOT MERGE Incoming Bluetooth Connection requests - dialog.
| | | * DO NOT MERGE Incoming Bluetooth Connection requests - dialog.Jaikumar Ganesh2011-06-211-23/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This sends the intents to the Settings app to show the dialogs for the incoming connection requests. Change-Id: Ibe267f7cda28ce2a46c25800df2e8ac685b0b9e6
* | | | Bluetooth : fix for bluetooth turning on issue.(limit: 64times)hyungseoung.yoo2011-08-101-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bluetooth fails to turn on after 64 iterations. When setUpEventLoop is called, Adapter is not ready yet. However, we have already added the Dbus match rules. These match rules are not deleted and we hit the dbus limit. Change-Id: If207d4d33574685520a852b53a641adfbeb45d43 Author: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
* | | | Fix invalid JNI call signature.Jeff Brown2011-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 5029536 Change-Id: I1f9b3faa77d49e26ef43982ff57cbbf0c3be8b40
* | | | Incoming Bluetooth Connection requests - dialog.Matthew Xie2011-07-071-23/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | am 69ed0b62: am d1735ef9: am 4b41df61: Merge "Use proper type for oob ↵Jaikumar Ganesh2011-05-211-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | variable in register_agent. Without this change the BluetoothEventLoop crashes on my armv5 arch board." * commit '69ed0b628e18570f3fc7909fcdadc1e06f42e944': Use proper type for oob variable in register_agent. Without this change the BluetoothEventLoop crashes on my armv5 arch board.
| * | | am d1735ef9: am 4b41df61: Merge "Use proper type for oob variable in ↵Jaikumar Ganesh2011-05-201-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | register_agent. Without this change the BluetoothEventLoop crashes on my armv5 arch board." * commit 'd1735ef91af201ff140f8d954dd07eff80836d20': Use proper type for oob variable in register_agent. Without this change the BluetoothEventLoop crashes on my armv5 arch board.
| | * | Use proper type for oob variable in register_agent.Nicu Pavel2011-05-051-1/+1
| | |/ | | | | | | | | | | | | | | | Without this change the BluetoothEventLoop crashes on my armv5 arch board. Change-Id: Ia10382f0aea4736be268512ccf9d5c5cde052851
* | | Disable Out of Band pairing for Bluez upgrade.Jaikumar Ganesh2011-04-051-1/+0
|/ / | | | | | | | | | | This is a temporary change, till OOB pairing is redone. Change-Id: I3e25fc7923eb4c70b4139880da884acf43098386
* | Fix compiler errors when compiled with debug option.Jaikumar Ganesh2011-02-221-11/+11
| | | | | | | | | | | | The Logv statement was missing the format specifier. Change-Id: Ibf986d28dabfdbb3fbfd75381cb349448c6e57e7
* | Make connection / disconnect failure more robust.Jaikumar Ganesh2011-01-191-16/+34
| | | | | | | | | | | | Add error codes so that the states can be tracked better. Change-Id: Ic07a5d34589134b68dedeb4803ccb523aa01b567
* | Clean up some logging to make it more useful to debug.Jaikumar Ganesh2010-10-261-1/+1
| | | | | | | | Change-Id: Ic30210ea6886b1c4630d7671a4b01736512e9da8
* | Rework Bluetooth tethering networking configuration.Jaikumar Ganesh2010-09-141-1/+4
| | | | | | | | | | | | Limit it to 5 for now, and store the iface. Change-Id: Ia6044b8e8f886dcd587ab0bb57273e0c11b6cd74
* | resolved conflicts for merge of 0522f5e9 to masterJaikumar Ganesh2010-09-131-0/+60
|\ \ | |/ | | | | Change-Id: Ie0a7ece33dced1042948087053e49665f6235fc2
| * Out Of Band API for Secure Simple Pairing.Jaikumar Ganesh2010-09-131-0/+60
| | | | | | | | Change-Id: I54ded27ab85d46eef3d2cca84f2394b1ffe88ced
| * DO NOT MERGE: Remove Device Bluez-Dbus interface watch.Jaikumar Ganesh2010-09-091-1/+1
| | | | | | | | Change-Id: I6bc04efd1292784bae5fc4786949d9da79e4aa22
* | Use the new signals sent by Bluez for PAN.Jaikumar Ganesh2010-09-021-3/+66
| | | | | | | | Change-Id: I092b5d6b23bacb37a5bc2ca6d8c47bc6a99467ec
* | bluetooth tetheringDanica Chang2010-08-181-3/+50
| | | | | | | | Change-Id: Id6d5fb1922facc7013abc29214d3e1141995b767
* | Add HID to the state machine and add native call backs.Jaikumar Ganesh2010-07-211-1/+29
| | | | | | | | Change-Id: Ib9f3e476d4176bc04e23e7674dc54aa5a6417308
* | Handle Input and network signal changes for HID and tethering.Jaikumar Ganesh2010-07-151-0/+14
| | | | | | | | Change-Id: I7f0c2884bb766189b41093bdcd6241f4540a31f3
* | HID profile.Jaikumar Ganesh2010-06-171-0/+21
|/ | | | Change-Id: I52e965a6537bce02c751ba26fe7b44dd03832510
* Delete local references to avoid reference table overflow.Jaikumar Ganesh2010-06-031-4/+14
| | | | Change-Id: I2218b97647e381bfe6d329b1b6134bb76c1832b6
* Fix crash while turning bluetooth on, due to a race condition.Jaikumar Ganesh2010-03-311-2/+7
| | | | | | | | | | | | | Bug: 2561150 Race condition: We were basing whether the event loop is running or not on whether nat->pollData was null or not. In rare cases, eventLoopMain would have not started, isEventLoopRunning returns true; java side makes a dbus call and the watches get set to null, causing a crash in dbus_connection_set_watch_functions when eventLoopMain starts. Change-Id: I863f182185a8e956fd53cb58783b7fe0ecfb2ddb
* merge from open-source masterThe Android Open Source Project2010-03-221-5/+12
|\ | | | | | | Change-Id: Ie60db5faf407344b8fbe3d5c1e7c01e927ff251e
| * Everytime Bluetooth was turned off two file descriptors were not closedJohannes Carlsson2010-03-161-5/+12
| | | | | | | | | | | | Using close instead of shutdown on the file descriptors and only clear the file descriptor that was closed. If both file descriptors are cleared the thread will not be able to close it.
* | Set error condition correctly when device is already created.Jaikumar Ganesh2010-02-171-1/+2
| | | | | | | | | | | | When device is already created, and we call CreateDevice, we need to report the error correctly. Only then the SDP query will be done from java land.
* | Fix leak of DBus match rule.Nick Pelly2010-01-221-1/+1
|/ | | | | | | We were registering a match for 'AudioSink', but unregistering 'audio.sink'. This does not immediately cause an error, but stress testing of BT off/on found that the leak causes a DBus Limits Error after ~300 iterations. It then becomes impossible to turn BT on again until a reboot.
* Revert "Remove STOPSHIP comment."Nick Pelly2009-10-141-1/+1
| | | | | | | This reverts commit 3d0726b4d8a30e57852b70f1dcf4d8d20508cd1e Change-Id: Ie1ce5d09cc0b799ef0799f30eedc95f0ca5d3fad DrNo: jerrryw
* Remove STOPSHIP comment.Nick Pelly2009-10-141-2/+1
| | | | | | | Change-Id: I2492bffe57bded65fdbef5cf98e22cef3937e537 DrNo: eastham Bug: 2089423 Joke: Why don't anteaters get sick? Because they're full of anty-bodies!
* Encourage developers to connect RFCOMM by UUID instead of Channel.Nick Pelly2009-10-071-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add new API for fetching UUIDs using SDP.Jaikumar Ganesh2009-09-191-0/+54
| | | | | | | | | 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
* Changes for BT 2.1Jaikumar Ganesh2009-09-111-6/+51
| | | | | | | | | | 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
* Handle DisconnectRequested message sent by Bluez.Jaikumar Ganesh2009-09-111-0/+11
|
* Wait for HCI to come up if getting the adapter path fails.Jaikumar Ganesh2009-09-011-18/+42
|
* Add local frames for parsing properties and processing events.Jaikumar Ganesh2009-08-251-25/+41
| | | | | | | We were running out of local refs when there are lots of devices. Instead of deleting every single local ref, create a local stack frame. This operation is inexpensive so doesn't add a high overload and keeps the code clean instead of deleting every single local ref.
* Fix the scanning panic issueCharles Lu2009-08-071-0/+3
| | | | | Phone panics while streaming over A2DP and scanning for new device BluetoothEventLoop should delete reference
* Initial support of 2.1 pairing.Jaikumar Ganesh2009-07-171-0/+38
| | | | | Note: Some cases have not been tested yet, as we would need to get proper UI support.
* Revert "Initial support of 2.1 pairing."Jaikumar Ganesh2009-07-171-38/+0
| | | | This reverts commit 228b2f3a813e93413a0f9e2f29dfbfc54590a356.
* Initial support of 2.1 pairing.Jaikumar Ganesh2009-07-171-0/+38
| | | | | Note: Some cases have not been tested yet, as we would need to get proper UI support.
* am c9dc19bb: Merge change 4668 into donutAndroid (Google) Code Review2009-06-181-11/+21
|\ | | | | | | | | | | | | Merge commit 'c9dc19bb96d2d77ec50f6e40fc22d1ff615f2044' * commit 'c9dc19bb96d2d77ec50f6e40fc22d1ff615f2044': Fix runtime restarts due to sending the wrong flags to dbus.
| * Fix runtime restarts due to sending the wrong flags to dbus.Nick Pelly2009-06-181-11/+21
| | | | | | | | | | | | | | | | | | In eventLoopMain we were correctly translating from unix events to dbus flags, but a coding typo then gave the unix events to dbus. Fix this typo. Also noticed that we were passing raw dbus flags to poll() in another area. This did not cause any immediate problem, since POLLIN | POLLPRI is harmless and we do not usually need POLLOUT. But fixed anyway.