summaryrefslogtreecommitdiff
path: root/core/java/android/server/BluetoothAdapterStateMachine.java
Commit message (Collapse)AuthorAgeFilesLines
* Delete various Bluetooth files for stack integration.Jaikumar Ganesh2012-07-131-822/+0
|
* Get rid of the extra bt_disable call when turning on airplane modeMatthew Xie2012-06-271-5/+2
| | | | | | | | | | | | | Get rid of enabling bt when in airplane mode. Current code has 2 paths that trying to place bluetooth in cold state when turning airplane mode on. This caused extra call of bt_disable that causing a kernel sleep failure. The fix removes one of the sys call. This CL keeps Bluetooth in cold state after turning airplane mode on instead of seting it to hotoff state bug 6563480 Change-Id: I30c413707157acb4a8e83ded9452256cf6260899
* When turning off, broadcast STATE_OFF in the last HotOff stateMatthew Xie2012-05-071-17/+41
| | | | | | | | | This is because we do HotOff -> PowerOff -> HotOff for USER_TURN_OFF Donot do poweroff for perprocess turn off. Add small time delays for calls into stack to reset dbus timing. bug 6438556 Change-Id: Iae8bdd24e41824ed4bc34aca96d082f9284f169c
* Always move Bluetooth Adapter to cold state when turn off Bluetooth.Matthew Xie2012-05-021-5/+7
| | | | | | | | | | quick switch feature introduced in ICS does not work very well. Reported logs indicate the Bluez stack cannot sustain the long time ON/hotoff state. This change will always move the adapter to code but move it to hotoff to be able to turn on quickly. bug 5792792 Change-Id: I41c39d4bf11bb5eb3cd83279e8ec81e01774e008
* am 1890fa82: am 79d84930: Merge "Set Bluetooth adapter to PowerOff mode when ↵Matthew Xie2012-01-121-1/+1
|\ | | | | | | | | | | | | turnoff with airplane on" into ics-mr1 * commit '1890fa822091ea700b7409ac79a57cf650b55003': Set Bluetooth adapter to PowerOff mode when turnoff with airplane on
| * Set Bluetooth adapter to PowerOff mode when turnoff with airplane onMatthew Xie2012-01-111-1/+1
| | | | | | | | | | | | | | | | | | Currently, when airplane mode was on and BT was on, turning BT off moved BT to hotoff state. This fix moves BT all the way to Poweroff state to have better power performance. bug 5854282 Change-Id: I7ba41797a46a81ddb3a576453f2a8303b5eed525
* | am 18ad6514: am ed0830c5: Merge "Move broadcastState STATE_TURNING_ON before ↵Matthew Xie2011-12-121-1/+1
|\| | | | | | | | | | | | | persistSwitchSetting" into ics-mr1 * commit '18ad6514bbeb68a96c12ba1636ab8df8e3945f37': Move broadcastState STATE_TURNING_ON before persistSwitchSetting
| * Move broadcastState STATE_TURNING_ON before persistSwitchSettingMatthew Xie2011-12-121-1/+1
| | | | | | | | | | | | | | | | | | CTS test revealed that persistSwitchSetting could take more than 1 second. STATE_TURNING_ON intent missed the test timing. We move the broadcast before persistSwitchSetting bug 5740715 Change-Id: I54a0a0afc8d1c4fc28f84e6122809af2f1456ca7
* | am 12479141: am 0d9a41e7: Merge "Broadcast turning on/off intent as early as ↵Matthew Xie2011-12-051-5/+5
|\| | | | | | | | | | | | | possible when switch on/off BT" into ics-mr1 * commit '12479141dd3e63a5f26a4509d0922c9ef9e3d78c': Broadcast turning on/off intent as early as possible when switch on/off BT
| * Broadcast turning on/off intent as early as possible when switch on/off BTMatthew Xie2011-12-051-5/+5
| | | | | | | | | | | | | | | | Move broadcastState(BluetoothAdapter.STATE_TURNING_ON/OFF) before any other method calls when turn on/off Bluetooth. Bug 5703346 Change-Id: Iddbdab58367a7d648708aa23671eb09701d66793
* | Add more comments to the file header to explain the state diagramMatthew Xie2011-11-111-0/+11
|/ | | | | | | The state diagram does not capture every messages. Here we explain the missing parts to make the diagram clearer. Change-Id: Ic5de5eb0556be4339d98023b0e7947d6e2cb30d1
* Send TURN_HOT message to the state machine from BluetoothService after it startsMatthew Xie2011-10-031-15/+11
| | | | | | | | | All the messages sent to the StateMachine were ignored before the StateMachine starts. To avoid TURN_HOT message from being ignored, move it out to BluetoothService to send to the BluetoothAdapterStateMachine after the state machine starts bug 5333923 Change-Id: I14ccd6dd7e6430aad2bca9230d01578b5327cc3f
* Check null of pidPair to skip the case the service record has been removedMatthew Xie2011-09-191-14/+12
| | | | | | | | | Check null of pidPair instead of pidPair.first which caused a nullpointer exception. clean local variables after sending out STATE_OFF intent. Check bluetooth state in removeServiceRecord. bug 5330367 Change-Id: Ib0af8143223bea48d3f587cca18544c4aef29980
* Apply timeout for powerdown event and reset state machine when bluez crashesMatthew Xie2011-09-081-3/+75
| | | | | | | | | | 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
* Change prepare bluetooth timeout from 7 seconds to 10 secondsMatthew Xie2011-08-151-1/+1
| | | | | | | It was observed that the preparing bluetooth could take up to 8 seconds before the SD loaded event came in. Change-Id: I722f94ed9cbd12bdd033ca405838366139c61383
* Implement switchConnectable with Powered property setting instead of scan modesMatthew Xie2011-08-151-44/+81
| | | | | | | | | | 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
* Add a timeout for disconnecting devices to recover from error situationMatthew Xie2011-08-031-17/+55
| | | | | | | | | Start the timer (3 second) just after calling disconnect devices. If the timer expires, it indicates an error condition. we don't wait on the ALL_DEVICES_DISCONNECTED event upon the error. Instead, get out of switching state and turn off BT to reset out of the error condition. Change-Id: I27aa8cd7b6fe50d9191e2d32fc2d6eac50424403
* Move mBluetoothService.runBluetooth after broadcasting the STATE_ON intent.Matthew Xie2011-08-021-19/+13
| | | | | | | | | | 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
* Add ability to turn BT on / off on a per application basis.Jaikumar Ganesh2011-07-261-47/+187
| | | | | | | | | | 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-0/+513
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